Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:pchenthill
evolution-data-server
fix-gw-attach-corruption.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fix-gw-attach-corruption.diff of Package evolution-data-server
Index: camel/providers/groupwise/camel-groupwise-folder.c =================================================================== RCS file: /cvs/gnome/evolution-data-server/camel/providers/groupwise/camel-groupwise-folder.c,v retrieving revision 1.142 diff -u -p -r1.142 camel-groupwise-folder.c --- camel/providers/groupwise/camel-groupwise-folder.c 28 Aug 2006 15:12:28 -0000 1.142 +++ camel/providers/groupwise/camel-groupwise-folder.c 30 Oct 2006 12:29:17 -0000 @@ -1593,29 +1591,30 @@ groupwise_folder_item_to_msg( CamelFolde EGwItemAttachment *attach = (EGwItemAttachment *)al->data; if (!g_ascii_strcasecmp (attach->name, "Mime.822")) { if (attach->size > MAX_ATTACHMENT_SIZE) { - long count = 0; - int i, t_len=0, offset=0, t_offset=0; + int len_iter = 0, t_len , offset = 0, t_offset = 0; char *t_attach = NULL; GString *gstr = g_string_new (NULL); - - count = (attach->size)/(1024*1024); - count++; + len = 0; - for (i = 0; i<count; i++) { + do { status = e_gw_connection_get_attachment_base64 (cnc, attach->id, t_offset, MAX_ATTACHMENT_SIZE, (const char **)&t_attach, &t_len, &offset); if (status == E_GW_CONNECTION_STATUS_OK) { - gstr = g_string_append (gstr, t_attach); + char *temp = NULL; + + temp = soup_base64_decode(t_attach, &len_iter); + gstr = g_string_append_len (gstr, temp, len_iter); + g_free (temp); + len += len_iter; t_offset = offset; g_free (t_attach); t_attach = NULL; - t_len = 0; } - } - body = soup_base64_decode (gstr->str, &len); + } while (offset); + body = gstr->str; body_len = len; - g_string_free (gstr, TRUE); + g_string_free (gstr, FALSE); } else { status = e_gw_connection_get_attachment (cnc, attach->id, 0, -1, @@ -1729,28 +1728,31 @@ groupwise_folder_item_to_msg( CamelFolde g_object_unref (temp_item); } else { if (attach->size > MAX_ATTACHMENT_SIZE) { - long count = 0; - int i, t_len=0, offset=0, t_offset=0; + int t_len=0, offset=0, t_offset=0; char *t_attach = NULL; GString *gstr = g_string_new (NULL); - count = (attach->size)/(1024*1024); - count++; len = 0; - for (i = 0; i<count; i++) { + do { status = e_gw_connection_get_attachment_base64 (cnc, attach->id, t_offset, MAX_ATTACHMENT_SIZE, (const char **)&t_attach, &t_len, &offset); if (status == E_GW_CONNECTION_STATUS_OK) { - gstr = g_string_append (gstr, t_attach); + int len_iter = 0; + char *temp = NULL; + + temp = soup_base64_decode(t_attach, &len_iter); + gstr = g_string_append_len (gstr, temp, len_iter); + g_free (temp); + len += len_iter; t_offset = offset; g_free (t_attach); t_attach = NULL; t_len = 0; } - } - attachment = soup_base64_decode (gstr->str, &len); - g_string_free (gstr, TRUE); + } while (t_offset); + attachment = gstr->str; + g_string_free (gstr, FALSE); is_base64_encoded = FALSE; } else { status = e_gw_connection_get_attachment (cnc,
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor