static void test_client_echo_continue(void *context);
-static void test_client_echo_finished(unsigned int files_idx)
+static void test_client_echo_finished(struct test_client_request *tcreq)
{
+ unsigned int files_idx = tcreq->files_idx;
const char **paths;
unsigned int count;
struct istream *payload = tcreq->payload;
const unsigned char *pdata, *fdata;
size_t psize, fsize, pleft;
- unsigned int files_idx = tcreq->files_idx;
off_t ret;
timeout_reset(to_client_progress);
tcreq->files_idx);
}
- /* dereference payload stream; finishes the request */
+ /* finished */
tcreq->payload = NULL;
+ test_client_echo_finished(tcreq);
+
+ /* dereference payload stream; finishes the request */
+ i_stream_unref(&tcreq->file_in);
io_remove(&tcreq->io); /* holds a reference too */
i_stream_unref(&payload);
-
- /* finished */
- test_client_echo_finished(files_idx);
}
}
path, tcreq->files_idx);
}
i_stream_unref(&fstream);
- test_client_echo_finished(tcreq->files_idx);
+ test_client_echo_finished(tcreq);
return;
}