server: send quit if we don't add a job
authorJens Axboe <axboe@kernel.dk>
Wed, 5 Oct 2011 18:41:06 +0000 (20:41 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 5 Oct 2011 18:41:06 +0000 (20:41 +0200)
Otherwise the client gets stuck.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
server.c

index 0f64c23586aef13f3b830ab4effd650553a12e9f..f586235fc1a44b16a6b3ae2f488410e38a0bf124 100644 (file)
--- a/server.c
+++ b/server.c
@@ -282,8 +282,10 @@ static int handle_job_cmd(struct fio_net_cmd *cmd)
        char *buf = (char *) cmd->payload;
        int ret;
 
-       if (parse_jobs_ini(buf, 1, 0))
+       if (parse_jobs_ini(buf, 1, 0)) {
+               fio_server_send_quit_cmd();
                return -1;
+       }
 
        fio_net_send_simple_cmd(server_fd, FIO_NET_CMD_START, 0);
 
@@ -308,8 +310,10 @@ static int handle_jobline_cmd(struct fio_net_cmd *cmd)
                dprint(FD_NET, "server: %d: %s\n", i, argv[i]);
        }
 
-       if (parse_cmd_line(pdu->argc, argv))
+       if (parse_cmd_line(pdu->argc, argv)) {
+               fio_server_send_quit_cmd();
                return -1;
+       }
 
        fio_net_send_simple_cmd(server_fd, FIO_NET_CMD_START, 0);