Mercurial > dovecot > original-hg > dovecot-1.2
comparison src/lib-imap/imap-bodystructure.c @ 862:375923d2f910 HEAD
BODYSTRUCTURE reply was incorrect. pine didn't like it.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 27 Dec 2002 22:57:11 +0200 |
parents | 41ec8cadd238 |
children | 7935347f54f1 |
comparison
equal
deleted
inserted
replaced
861:7498eab8903f | 862:375923d2f910 |
---|---|
177 (void)message_content_parse_header(t_strndup(value, value_len), | 177 (void)message_content_parse_header(t_strndup(value, value_len), |
178 parse_content_type, | 178 parse_content_type, |
179 parse_save_params_list, | 179 parse_save_params_list, |
180 part_data); | 180 part_data); |
181 part_data->content_type_params = | 181 part_data->content_type_params = |
182 p_strdup(pool, str_c(part_data->str)); | 182 p_strdup_empty(pool, str_c(part_data->str)); |
183 } else if (strcasecmp(name, "Content-Transfer-Encoding") == 0 && | 183 } else if (strcasecmp(name, "Content-Transfer-Encoding") == 0 && |
184 part_data->content_transfer_encoding == NULL) { | 184 part_data->content_transfer_encoding == NULL) { |
185 (void)message_content_parse_header(t_strndup(value, value_len), | 185 (void)message_content_parse_header(t_strndup(value, value_len), |
186 parse_content_transfer_encoding, | 186 parse_content_transfer_encoding, |
187 NULL, part_data); | 187 NULL, part_data); |
199 (void)message_content_parse_header(t_strndup(value, value_len), | 199 (void)message_content_parse_header(t_strndup(value, value_len), |
200 parse_content_disposition, | 200 parse_content_disposition, |
201 parse_save_params_list, | 201 parse_save_params_list, |
202 part_data); | 202 part_data); |
203 part_data->content_disposition_params = | 203 part_data->content_disposition_params = |
204 p_strdup(pool, str_c(part_data->str)); | 204 p_strdup_empty(pool, str_c(part_data->str)); |
205 } else if (strcasecmp(name, "Content-Language") == 0) { | 205 } else if (strcasecmp(name, "Content-Language") == 0) { |
206 (void)message_content_parse_header(t_strndup(value, value_len), | 206 (void)message_content_parse_header(t_strndup(value, value_len), |
207 parse_content_language, NULL, | 207 parse_content_language, NULL, |
208 part_data); | 208 part_data); |
209 } else if (strcasecmp(name, "Content-MD5") == 0 && | 209 } else if (strcasecmp(name, "Content-MD5") == 0 && |
281 if (data->content_disposition == NULL) | 281 if (data->content_disposition == NULL) |
282 str_append(str, "NIL"); | 282 str_append(str, "NIL"); |
283 else { | 283 else { |
284 str_append_c(str, '('); | 284 str_append_c(str, '('); |
285 str_append(str, data->content_disposition); | 285 str_append(str, data->content_disposition); |
286 if (data->content_disposition_params != NULL) { | 286 str_append_c(str, ' '); |
287 str_append(str, " ("); | 287 |
288 if (data->content_disposition_params == NULL) | |
289 str_append(str, "NIL"); | |
290 else { | |
291 str_append_c(str, '('); | |
288 str_append(str, data->content_disposition_params); | 292 str_append(str, data->content_disposition_params); |
289 str_append_c(str, ')'); | 293 str_append_c(str, ')'); |
290 } | 294 } |
291 str_append_c(str, ')'); | 295 str_append_c(str, ')'); |
292 } | 296 } |
372 if (data->content_disposition == NULL) | 376 if (data->content_disposition == NULL) |
373 str_append(str, "NIL"); | 377 str_append(str, "NIL"); |
374 else { | 378 else { |
375 str_append_c(str, '('); | 379 str_append_c(str, '('); |
376 str_append(str, data->content_disposition); | 380 str_append(str, data->content_disposition); |
377 str_append_c(str, ')'); | 381 str_append_c(str, ' '); |
378 | 382 |
379 if (data->content_disposition_params != NULL) { | 383 if (data->content_disposition_params == NULL) |
380 str_append(str, " ("); | 384 str_append(str, "NIL"); |
385 else { | |
386 str_append_c(str, '('); | |
381 str_append(str, data->content_disposition_params); | 387 str_append(str, data->content_disposition_params); |
382 str_append_c(str, ')'); | 388 str_append_c(str, ')'); |
383 } | 389 } |
390 | |
391 str_append_c(str, ')'); | |
384 } | 392 } |
385 | 393 |
386 str_append_c(str, ' '); | 394 str_append_c(str, ' '); |
387 if (data->content_language == NULL) | 395 if (data->content_language == NULL) |
388 str_append(str, "NIL"); | 396 str_append(str, "NIL"); |
436 } | 444 } |
437 | 445 |
438 return part_get_bodystructure(*part, extended); | 446 return part_get_bodystructure(*part, extended); |
439 } | 447 } |
440 | 448 |
441 static int imap_write_list(ImapArg *args, String *str) | 449 static int imap_write_list(const ImapArg *args, String *str) |
442 { | 450 { |
443 /* don't do any typechecking, just write it out */ | 451 /* don't do any typechecking, just write it out */ |
444 str_append_c(str, '('); | 452 str_append_c(str, '('); |
445 while (args->type != IMAP_ARG_EOL) { | 453 while (args->type != IMAP_ARG_EOL) { |
446 switch (args->type) { | 454 switch (args->type) { |
469 } | 477 } |
470 str_append_c(str, ')'); | 478 str_append_c(str, ')'); |
471 return TRUE; | 479 return TRUE; |
472 } | 480 } |
473 | 481 |
474 static int imap_parse_bodystructure_args(ImapArg *args, String *str) | 482 static int imap_parse_bodystructure_args(const ImapArg *args, String *str) |
475 { | 483 { |
476 ImapArg *subargs; | 484 ImapArg *subargs; |
477 int i, multipart, text, message_rfc822; | 485 int i, multipart, text, message_rfc822; |
478 | 486 |
479 multipart = FALSE; | 487 multipart = FALSE; |