Changeset 3487
- Timestamp:
- 03/12/08 19:26:53
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/camel-mime-parser.c (modified) (5 diffs)
- trunk/libtinymail-camel/camel-lite/camel/camel-mime-parser.h (modified) (1 diff)
- trunk/libtinymail-camel/camel-lite/camel/camel-mime-part-utils.c (modified) (2 diffs)
- trunk/libtinymail-camel/tny-camel-mime-part.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r3486 r3487 1 2008-03-12 Alberto Garcia Gonzalez <agarcia@igalia.com> 2 3 * Reverted the "Leave on disk, MIME parsing" patch, as it's 4 causing serious problems. 5 1 6 2008-03-11 Jose Dapena Paz <jdapena@igalia.com> 2 7 trunk/libtinymail-camel/camel-lite/camel/camel-mime-parser.c
r3462 r3487 146 146 }; 147 147 148 static void folder_scan_step_hdr(struct _header_scan_state *s, char **databuffer, size_t *datalength, int *hdr_end);149 148 static void folder_scan_step(struct _header_scan_state *s, char **databuffer, size_t *datalength); 150 149 static void folder_scan_drop_step(struct _header_scan_state *s); … … 623 622 624 623 folder_scan_step(s, databuffer, datalength); 625 } else626 s->unstep--;627 628 d(printf("NEW STATE: '%s' :\n", states[s->state]));629 630 return s->state;631 }632 633 634 camel_mime_parser_state_t635 camel_mime_parser_step_hdr (CamelMimeParser *parser, char **databuffer, size_t *datalength, int *hdr_end)636 {637 struct _header_scan_state *s = _PRIVATE (parser);638 639 d(printf("OLD STATE: '%s' :\n", states[s->state]));640 641 if (s->unstep <= 0) {642 char *dummy;643 size_t dummylength;644 645 if (databuffer == NULL) {646 databuffer = &dummy;647 datalength = &dummylength;648 }649 650 folder_scan_step_hdr (s, databuffer, datalength, hdr_end);651 624 } else 652 625 s->unstep--; … … 1546 1519 1547 1520 static void 1548 folder_scan_step _hdr (struct _header_scan_state *s, char **databuffer, size_t *datalength, int *hdr_end)1521 folder_scan_step(struct _header_scan_state *s, char **databuffer, size_t *datalength) 1549 1522 { 1550 1523 struct _header_scan_stack *h, *hb; … … 1679 1652 case CAMEL_MIME_PARSER_STATE_HEADER: 1680 1653 s->state = CAMEL_MIME_PARSER_STATE_BODY; 1681 *hdr_end = folder_tell (s);1682 1654 1683 1655 case CAMEL_MIME_PARSER_STATE_BODY: … … 1796 1768 } 1797 1769 1798 static void1799 folder_scan_step (struct _header_scan_state *s, char **databuffer, size_t *datalength)1800 {1801 int i;1802 folder_scan_step_hdr (s, databuffer, datalength, &i);1803 }1804 1805 1770 /* drops the current state back one */ 1806 1771 static void trunk/libtinymail-camel/camel-lite/camel/camel-mime-parser.h
r3462 r3487 100 100 101 101 /* normal interface */ 102 camel_mime_parser_state_t camel_mime_parser_step_hdr (CamelMimeParser *parser, char **buf, size_t *buflen, int *hdr_end);103 102 camel_mime_parser_state_t camel_mime_parser_step (CamelMimeParser *parser, char **buf, size_t *buflen); 104 103 void camel_mime_parser_unstep (CamelMimeParser *parser); trunk/libtinymail-camel/camel-lite/camel/camel-mime-part-utils.c
r3463 r3487 61 61 GByteArray *buffer = NULL; 62 62 CamelStream *stream; 63 int start = -1, end;63 off_t start, end; 64 64 int fd = -1; 65 65 size_t len; 66 66 char *buf; 67 gboolean done = FALSE; 68 camel_mime_parser_state_t state; 69 67 70 68 d(printf ("simple_data_wrapper_construct_from_parser()\n")); 71 69 72 70 if (!(stream = camel_mime_parser_stream (mp))) 73 71 fd = camel_mime_parser_fd (mp); 74 else if (!CAMEL_IS_SEEKABLE_S TREAM (stream))72 else if (!CAMEL_IS_SEEKABLE_SUBSTREAM (stream)) 75 73 stream = NULL; 76 74 … … 81 79 buffer = g_byte_array_new (); 82 80 } 83 84 do { 85 86 state = camel_mime_parser_step_hdr (mp, &buf, &len, &start); 87 88 if (state == CAMEL_MIME_PARSER_STATE_BODY) { 89 //start = camel_mime_parser_tell (mp); 90 done = TRUE; 91 } 92 81 82 while (camel_mime_parser_step (mp, &buf, &len) != CAMEL_MIME_PARSER_STATE_BODY_END) { 93 83 if (buffer != NULL) { 94 84 d(printf("appending o/p data: %d: %.*s\n", len, len, buf)); 95 85 g_byte_array_append (buffer, (guint8 *) buf, len); 96 86 } 97 } while (state != CAMEL_MIME_PARSER_STATE_BODY_END); 98 99 87 } 88 100 89 if (buffer == NULL) { 101 90 end = camel_mime_parser_tell (mp); 91 102 92 if (stream != NULL) 103 93 stream = camel_seekable_substream_new ((CamelSeekableStream *) stream, start, end); trunk/libtinymail-camel/tny-camel-mime-part.c
r3463 r3487 28 28 #include <string.h> 29 29 #include <errno.h> 30 #include <ctype.h>31 30 32 31 #include <tny-mime-part.h>
