gfio: fix attempt to add multiple entries to disk util frame
[fio.git] / server.c
index 2da0c83edf2e75f1b4090bf574c6985eb68336d6..9110707656ad3e2ca4f8166521b9d407efe57551 100644 (file)
--- a/server.c
+++ b/server.c
@@ -55,6 +55,7 @@ static const char *fio_server_ops[FIO_NET_CMD_NR] = {
        "SERVER_START",
        "ADD_JOB",
        "CMD_RUN"
+       "CMD_IOLOG",
 };
 
 const char *fio_server_op(unsigned int op)
@@ -955,7 +956,10 @@ int fio_send_iolog(struct thread_data *td, struct io_log *log, const char *name)
 
                stream.avail_out = FIO_SERVER_MAX_FRAGMENT_PDU;
                stream.next_out = out_pdu;
-               assert(deflate(&stream, Z_FINISH) == Z_OK);
+               ret = deflate(&stream, Z_FINISH);
+               /* may be Z_OK, or Z_STREAM_END */
+               if (ret < 0)
+                       goto err_zlib;
 
                this_len = FIO_SERVER_MAX_FRAGMENT_PDU - stream.avail_out;