[dovecot-cvs] dovecot/src/imap imap-fetch.c,1.10,1.11
cras at procontrol.fi
cras at procontrol.fi
Mon Sep 8 05:46:17 EEST 2003
- Previous message: [dovecot-cvs]
dovecot/src/lib failures.c,1.22,1.23 printf-upper-bound.c,1.3,1.4
printf-upper-bound.h,1.1,1.2 str.c,1.10,1.11 strfuncs.c,1.31,1.32
- Next message: [dovecot-cvs]
dovecot/src/lib-storage/index index-mail-headers.c,1.7,1.8
index-mail.h,1.9,1.10 index-search.c,1.78,1.79
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/dovecot/src/imap
In directory danu:/tmp/cvs-serv30219
Modified Files:
imap-fetch.c
Log Message:
Write envelope, body and bodystructure directly into output stream.
Index: imap-fetch.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/imap-fetch.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- imap-fetch.c 6 Aug 2003 20:15:30 -0000 1.10
+++ imap-fetch.c 8 Sep 2003 01:46:14 -0000 1.11
@@ -88,7 +88,20 @@
if (body == NULL)
return FALSE;
- str_printfa(ctx->str, "BODY (%s) ", body);
+ if (ctx->first) {
+ if (o_stream_send_str(ctx->output, "BODY (") < 0)
+ return FALSE;
+ ctx->first = FALSE;
+ } else {
+ if (o_stream_send_str(ctx->output, " BODY(") < 0)
+ return FALSE;
+ }
+
+ if (o_stream_send_str(ctx->output, body) < 0)
+ return FALSE;
+
+ if (o_stream_send(ctx->output, ")", 1) < 0)
+ return FALSE;
return TRUE;
}
@@ -101,7 +114,20 @@
if (bodystructure == NULL)
return FALSE;
- str_printfa(ctx->str, "BODYSTRUCTURE (%s) ", bodystructure);
+ if (ctx->first) {
+ if (o_stream_send_str(ctx->output, "BODYSTRUCTURE (") < 0)
+ return FALSE;
+ ctx->first = FALSE;
+ } else {
+ if (o_stream_send_str(ctx->output, " BODYSTRUCTURE(") < 0)
+ return FALSE;
+ }
+
+ if (o_stream_send_str(ctx->output, bodystructure) < 0)
+ return FALSE;
+
+ if (o_stream_send(ctx->output, ")", 1) < 0)
+ return FALSE;
return TRUE;
}
@@ -113,7 +139,20 @@
if (envelope == NULL)
return FALSE;
- str_printfa(ctx->str, "ENVELOPE (%s) ", envelope);
+ if (ctx->first) {
+ if (o_stream_send_str(ctx->output, "ENVELOPE (") < 0)
+ return FALSE;
+ ctx->first = FALSE;
+ } else {
+ if (o_stream_send_str(ctx->output, " ENVELOPE(") < 0)
+ return FALSE;
+ }
+
+ if (o_stream_send_str(ctx->output, envelope) < 0)
+ return FALSE;
+
+ if (o_stream_send(ctx->output, ")", 1) < 0)
+ return FALSE;
return TRUE;
}
@@ -233,15 +272,6 @@
if (ctx->fetch_data & MAIL_FETCH_SIZE)
if (!fetch_rfc822_size(ctx, mail))
break;
- if (ctx->fetch_data & MAIL_FETCH_IMAP_BODY)
- if (!fetch_body(ctx, mail))
- break;
- if (ctx->fetch_data & MAIL_FETCH_IMAP_BODYSTRUCTURE)
- if (!fetch_bodystructure(ctx, mail))
- break;
- if (ctx->fetch_data & MAIL_FETCH_IMAP_ENVELOPE)
- if(!fetch_envelope(ctx, mail))
- break;
/* send the data written into temp string */
len = str_len(ctx->str);
@@ -253,6 +283,18 @@
break;
data_written = TRUE;
+
+ /* medium size data .. seems to be faster without
+ putting through string */
+ if (ctx->fetch_data & MAIL_FETCH_IMAP_BODY)
+ if (!fetch_body(ctx, mail))
+ break;
+ if (ctx->fetch_data & MAIL_FETCH_IMAP_BODYSTRUCTURE)
+ if (!fetch_bodystructure(ctx, mail))
+ break;
+ if (ctx->fetch_data & MAIL_FETCH_IMAP_ENVELOPE)
+ if(!fetch_envelope(ctx, mail))
+ break;
/* large data */
if (ctx->imap_data & IMAP_FETCH_RFC822)
- Previous message: [dovecot-cvs]
dovecot/src/lib failures.c,1.22,1.23 printf-upper-bound.c,1.3,1.4
printf-upper-bound.h,1.1,1.2 str.c,1.10,1.11 strfuncs.c,1.31,1.32
- Next message: [dovecot-cvs]
dovecot/src/lib-storage/index index-mail-headers.c,1.7,1.8
index-mail.h,1.9,1.10 index-search.c,1.78,1.79
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list