Changes propose by Dave Inglis.
Showing
3 changed files
with
23 additions
and
13 deletions
1 | 2001-05-30 Dave Inglis | ||
2 | |||
3 | * mailbox/filter_trans.c (base64_decode): The variable should | ||
4 | be unsigned char not signed char. By default gcc treats a | ||
5 | declaration of "char*" like "signed char*", CC Watcom did not. | ||
6 | (base64_encode): Likewised. | ||
7 | * mailbox/mime.c: Read 'itl the end of the stream. | ||
8 | |||
1 | 2001-05-29 Sergey Poznyakoff | 9 | 2001-05-29 Sergey Poznyakoff |
2 | * imap4d/uid.c, imap4d/search.c: support for UID SEARCH command; | 10 | * imap4d/uid.c, imap4d/search.c: support for UID SEARCH command; |
3 | * imap4d/util.c: forgotten fix to util_msgset(). | 11 | * imap4d/util.c: forgotten fix to util_msgset(). |
... | @@ -29,6 +37,7 @@ | ... | @@ -29,6 +37,7 @@ |
29 | not supported, though. | 37 | not supported, though. |
30 | 38 | ||
31 | 2001-05-27 Sam Roberts | 39 | 2001-05-27 Sam Roberts |
40 | |||
32 | * mailbox/address.c: removed unfolding of lines at a NL before parsing. | 41 | * mailbox/address.c: removed unfolding of lines at a NL before parsing. |
33 | * mailbox/parse822.c: consider LF and CRLF equivalent for purposes | 42 | * mailbox/parse822.c: consider LF and CRLF equivalent for purposes |
34 | of unfolding lines. | 43 | of unfolding lines. | ... | ... |
... | @@ -269,7 +269,7 @@ base64_decode (const char *iptr, size_t isize, char *optr, size_t osize, | ... | @@ -269,7 +269,7 @@ base64_decode (const char *iptr, size_t isize, char *optr, size_t osize, |
269 | { | 269 | { |
270 | int i = 0, tmp = 0, pad = 0; | 270 | int i = 0, tmp = 0, pad = 0; |
271 | size_t consumed = 0; | 271 | size_t consumed = 0; |
272 | char data[4]; | 272 | unsigned char data[4]; |
273 | 273 | ||
274 | (void) line_len; | 274 | (void) line_len; |
275 | *nbytes = 0; | 275 | *nbytes = 0; |
... | @@ -316,6 +316,7 @@ base64_encode (const char *iptr, size_t isize, char *optr, size_t osize, | ... | @@ -316,6 +316,7 @@ base64_encode (const char *iptr, size_t isize, char *optr, size_t osize, |
316 | int pad = 0; | 316 | int pad = 0; |
317 | const char *b64 = | 317 | const char *b64 = |
318 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | 318 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; |
319 | const unsigned char* ptr = iptr; | ||
319 | 320 | ||
320 | *nbytes = 0; | 321 | *nbytes = 0; |
321 | if (isize <= 3) | 322 | if (isize <= 3) |
... | @@ -330,12 +331,10 @@ base64_encode (const char *iptr, size_t isize, char *optr, size_t osize, | ... | @@ -330,12 +331,10 @@ base64_encode (const char *iptr, size_t isize, char *optr, size_t osize, |
330 | if ((*nbytes + 4) > osize) | 331 | if ((*nbytes + 4) > osize) |
331 | return consumed; | 332 | return consumed; |
332 | } | 333 | } |
333 | *optr++ = b64[iptr[0] >> 2]; | 334 | *optr++ = b64[ptr[0] >> 2]; |
334 | *optr++ = b64[((iptr[0] << 4) + (--isize ? (iptr[1] >> 4): 0)) & 0x3f]; | 335 | *optr++ = b64[((ptr[0] << 4) + (--isize ? (ptr[1] >> 4): 0)) & 0x3f]; |
335 | *optr++ = isize ? | 336 | *optr++ = isize ? b64[((iptr[1] << 2) + (--isize ? (ptr[2] >> 6) : 0 )) & 0x3f] : '='; |
336 | b64[((iptr[1] << 2) + (--isize ? (iptr[2] >> 6) : 0 )) & 0x3f] | 337 | *optr++ = isize ? b64[ptr[2] & 0x3f] : '='; |
337 | : '='; | ||
338 | *optr++ = isize ? b64[iptr[2] & 0x3f] : '='; | ||
339 | iptr += 3; | 338 | iptr += 3; |
340 | consumed += 3; | 339 | consumed += 3; |
341 | (*nbytes) += 4; | 340 | (*nbytes) += 4; | ... | ... |
... | @@ -348,7 +348,7 @@ _mimepart_body_read(stream_t stream, char *buf, size_t buflen, off_t off, size_t | ... | @@ -348,7 +348,7 @@ _mimepart_body_read(stream_t stream, char *buf, size_t buflen, off_t off, size_t |
348 | read_len = (int)mime_part->len - (int)off; | 348 | read_len = (int)mime_part->len - (int)off; |
349 | if ( read_len <= 0 ) { | 349 | if ( read_len <= 0 ) { |
350 | if ( !stream_is_seekable (mime_part->mime->stream) ) { | 350 | if ( !stream_is_seekable (mime_part->mime->stream) ) { |
351 | while( ( ret = stream_read(mime_part->mime->stream, buf, buflen, mime_part->offset + off, nbytes) ) == 0 && *nbytes > 0 ) | 351 | while( ( ret = stream_read(mime_part->mime->stream, buf, buflen, mime_part->offset + off, nbytes) ) == 0 && *nbytes ) |
352 | off += *nbytes; | 352 | off += *nbytes; |
353 | *nbytes = 0; | 353 | *nbytes = 0; |
354 | } | 354 | } |
... | @@ -447,7 +447,7 @@ _mime_body_read(stream_t stream, char *buf, size_t buflen, off_t off, size_t *nb | ... | @@ -447,7 +447,7 @@ _mime_body_read(stream_t stream, char *buf, size_t buflen, off_t off, size_t *nb |
447 | body_t body = stream_get_owner(stream); | 447 | body_t body = stream_get_owner(stream); |
448 | message_t msg = body_get_owner(body); | 448 | message_t msg = body_get_owner(body); |
449 | mime_t mime = message_get_owner(msg); | 449 | mime_t mime = message_get_owner(msg); |
450 | int ret = 0, len; | 450 | int ret = 0; |
451 | size_t part_nbytes = 0; | 451 | size_t part_nbytes = 0; |
452 | stream_t msg_stream = NULL; | 452 | stream_t msg_stream = NULL; |
453 | 453 | ||
... | @@ -469,8 +469,8 @@ _mime_body_read(stream_t stream, char *buf, size_t buflen, off_t off, size_t *nb | ... | @@ -469,8 +469,8 @@ _mime_body_read(stream_t stream, char *buf, size_t buflen, off_t off, size_t *nb |
469 | 469 | ||
470 | if ( ( ret = _mime_set_content_type(mime) ) == 0 ) { | 470 | if ( ( ret = _mime_set_content_type(mime) ) == 0 ) { |
471 | do { | 471 | do { |
472 | len = 0; | ||
473 | if ( mime->nmtp_parts > 1 ) { | 472 | if ( mime->nmtp_parts > 1 ) { |
473 | int len; | ||
474 | if ( mime->flags & MIME_INSERT_BOUNDARY ) { | 474 | if ( mime->flags & MIME_INSERT_BOUNDARY ) { |
475 | if ( ( mime->flags & MIME_ADDING_BOUNDARY ) == 0 ) { | 475 | if ( ( mime->flags & MIME_ADDING_BOUNDARY ) == 0 ) { |
476 | mime->boundary_len = strlen(mime->boundary); | 476 | mime->boundary_len = strlen(mime->boundary); |
... | @@ -508,14 +508,16 @@ _mime_body_read(stream_t stream, char *buf, size_t buflen, off_t off, size_t *nb | ... | @@ -508,14 +508,16 @@ _mime_body_read(stream_t stream, char *buf, size_t buflen, off_t off, size_t *nb |
508 | body_get_stream(part_body, &msg_stream); | 508 | body_get_stream(part_body, &msg_stream); |
509 | } | 509 | } |
510 | ret = stream_read(msg_stream, buf, buflen, mime->part_offset, &part_nbytes ); | 510 | ret = stream_read(msg_stream, buf, buflen, mime->part_offset, &part_nbytes ); |
511 | len += part_nbytes; | 511 | if ( part_nbytes ) { |
512 | mime->part_offset += part_nbytes; | 512 | mime->part_offset += part_nbytes; |
513 | mime->cur_offset += part_nbytes; | ||
513 | if ( nbytes ) | 514 | if ( nbytes ) |
514 | *nbytes += len; | 515 | *nbytes += part_nbytes; |
515 | mime->cur_offset += len; | 516 | } |
516 | if ( ret == 0 && part_nbytes == 0 ) { | 517 | if ( ret == 0 && part_nbytes == 0 ) { |
517 | mime->flags |= MIME_INSERT_BOUNDARY; | 518 | mime->flags |= MIME_INSERT_BOUNDARY; |
518 | mime->cur_part++; | 519 | mime->cur_part++; |
520 | ADD_CHAR(buf, '\n', mime->cur_offset, buflen, *nbytes); | ||
519 | } | 521 | } |
520 | } while( ret == 0 && part_nbytes == 0 && mime->cur_part <= mime->nmtp_parts ); | 522 | } while( ret == 0 && part_nbytes == 0 && mime->cur_part <= mime->nmtp_parts ); |
521 | } | 523 | } | ... | ... |
-
Please register or sign in to post a comment