Lines Matching defs:body
48 static const char *get_body_name(const struct imap_fetch_body_data *body)
53 if (body->binary_size)
55 else if (body->binary)
59 str_printfa(str, "[%s]", body->section);
60 if (body->partial) {
62 imap_msgpart_get_partial_offset(body->msgpart));
68 const struct imap_fetch_body_data *body,
79 str_append(str, get_body_name(body));
83 else if (has_nuls && body->binary)
137 get_body_human_name(pool_t pool, struct imap_fetch_body_data *body)
143 if (body->binary)
147 str_append(str, body->section);
150 partial_offset = imap_msgpart_get_partial_offset(body->msgpart);
151 partial_size = imap_msgpart_get_partial_size(body->msgpart);
174 struct imap_fetch_body_data *body)
180 imap_msgpart_free(&body->msgpart);
184 if (imap_msgpart_open(mail, body->msgpart, &result) < 0)
190 ctx->state.cur_human_name = get_body_human_name(ctx->ctx_pool, body);
192 fetch_state_update_stats(ctx, body->msgpart);
193 str = get_prefix(&ctx->state, body, ctx->state.cur_size,
202 struct imap_fetch_body_data *body)
208 imap_msgpart_free(&body->msgpart);
212 if (imap_msgpart_size(mail, body->msgpart, &size) < 0)
220 str_printfa(str, "%s %"PRIuUOFF_T, get_body_name(body), size);
236 struct imap_fetch_body_data *body, const char *prefix,
264 body->section = str_c(str);
268 static int body_parse_partial(struct imap_fetch_body_data *body,
282 body->partial = TRUE;
307 imap_msgpart_set_partial(body->msgpart, offset, size);
313 struct imap_fetch_body_data *body;
321 body = p_new(ctx->pool, struct imap_fetch_body_data, 1);
339 if (body_header_fields_parse(ctx, body, p+1,
346 body->section = p+1;
347 p = strchr(body->section, ']');
352 body->section = p_strdup_until(ctx->pool, body->section, p);
355 if (imap_msgpart_parse(body->section, &body->msgpart) < 0) {
360 imap_msgpart_get_fetch_data(body->msgpart);
361 imap_msgpart_get_wanted_headers(body->msgpart, &ctx->fetch_ctx->all_headers);
363 if (body_parse_partial(body, p, &error) < 0) {
370 ctx->name = p_strdup(ctx->pool, get_body_name(body));
372 "NIL", fetch_body_msgpart, body);
378 struct imap_fetch_body_data *body;
386 body = p_new(ctx->pool, struct imap_fetch_body_data, 1);
387 body->binary = TRUE;
392 body->binary_size = TRUE;
410 if (body_header_fields_parse(ctx, body, p+1,
417 body->section = p+1;
418 p = strchr(body->section, ']');
423 body->section = p_strdup_until(ctx->pool, body->section, p);
426 if (imap_msgpart_parse(body->section, &body->msgpart) < 0) {
430 imap_msgpart_set_decode_to_binary(body->msgpart);
432 imap_msgpart_get_fetch_data(body->msgpart);
434 if (!body->binary_size) {
435 if (body_parse_partial(body, p, &error) < 0) {
443 ctx->name = p_strdup(ctx->pool, get_body_name(body));
444 if (body->binary_size) {
446 "0", fetch_binary_size, body);
449 "NIL", fetch_body_msgpart, body);