Lines Matching defs:attach

91 	struct mail_save_attachment *attach = ctx->data.attach;
98 i_assert(attach->cur_file == NULL);
115 attach->cur_file = fs_file_init(attach->fs, path,
118 extref = array_append_space(&attach->extrefs);
121 extref->path = p_strdup(attach->pool,
126 *output_r = fs_write_stream(attach->cur_file);
135 struct mail_save_attachment *attach = ctx->data.attach;
138 i_assert(attach->cur_file != NULL);
141 fs_write_stream_abort_error(attach->cur_file, &output, "%s", *error);
142 else if (fs_write_stream_finish(attach->cur_file, &output) < 0) {
144 fs_file_path(attach->cur_file),
145 fs_file_last_error(attach->cur_file));
148 fs_file_deinit(&attach->cur_file);
151 array_delete(&attach->extrefs,
152 array_count(&attach->extrefs)-1, 1);
161 struct mail_save_attachment *attach;
166 i_assert(ctx->data.attach == NULL);
185 attach = p_new(pool, struct mail_save_attachment, 1);
186 attach->pool = pool;
187 attach->fs = fs;
188 attach->input = i_stream_create_attachment_extractor(input, &set, ctx);
189 p_array_init(&attach->extrefs, attach->pool, 8);
190 ctx->data.attach = attach;
210 struct mail_save_attachment *attach = ctx->data.attach;
215 if (attach->input->stream_errno != 0)
219 ret = i_stream_read(attach->input);
221 data = i_stream_get_data(attach->input, &size);
223 i_stream_skip(attach->input, size);
226 if (ret == 0 && !i_stream_attachment_extractor_can_retry(attach->input)) {
232 if (attach->input->stream_errno != 0) {
234 i_stream_get_name(attach->input),
235 i_stream_get_error(attach->input));
247 struct mail_save_attachment *attach = ctx->data.attach;
249 (void)i_stream_read(attach->input);
250 i_assert(attach->input->eof);
251 return attach->input->stream_errno == 0 ? 0 : -1;
256 struct mail_save_attachment *attach = ctx->data.attach;
258 if (attach != NULL) {
259 i_stream_unref(&attach->input);
260 pool_unref(&attach->pool);
261 ctx->data.attach = NULL;
268 return ctx->data.attach == NULL ? NULL :
269 &ctx->data.attach->extrefs;