break;
}
o_stream_uncork(server->output);
+ if (server->output->closed)
+ ret = -1;
if (ret < 0)
master_service_stop(master_service);
int ret;
if ((ret = o_stream_flush(output)) < 0)
- return 1;
-
- if (server->cur_cmd != NULL) {
+ ret = 1;
+ else if (server->cur_cmd != NULL) {
o_stream_cork(output);
(void)proxy_server_run_cmd(server);
o_stream_uncork(output);
- if (server->cur_cmd == NULL && server->io == NULL) {
- server->io = io_add(server->fd_in, IO_READ,
- proxy_server_input, server);
+ if (server->cur_cmd == NULL) {
+ if (server->io == NULL) {
+ server->io = io_add(server->fd_in, IO_READ,
+ proxy_server_input, server);
+ }
/* handle pending input */
proxy_server_input(server);
}
}
+ if (output->closed)
+ master_service_stop(master_service);
return ret;
}
#include "strescape.h"
#include "istream.h"
#include "ostream.h"
+#include "master-service.h"
#include "test-common.h"
#include "dsync-proxy-server.h"
#include "test-dsync-worker.h"
#define ALL_MAIL_FLAGS "\\Answered \\Flagged \\Deleted \\Seen \\Draft \\Recent"
+struct master_service *master_service;
static string_t *out;
static struct dsync_proxy_server *server;
static struct test_dsync_worker *test_worker;
static struct dsync_proxy_server_command *cur_cmd;
static const char *cur_cmd_args[20];
+void master_service_stop(struct master_service *service ATTR_UNUSED) {}
+
static void out_clear(void)
{
o_stream_seek(server->output, 0);