server: package defrag fix
authorJens Axboe <axboe@kernel.dk>
Mon, 3 Oct 2011 13:03:08 +0000 (15:03 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 3 Oct 2011 13:03:08 +0000 (15:03 +0200)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
server.c

index 92d37bd9757872b98aa873312974217c0dfed553..7202f10fcbbd542e9d9bdc05319c20c8a24041a1 100644 (file)
--- a/server.c
+++ b/server.c
@@ -135,7 +135,6 @@ struct fio_net_cmd *fio_net_recv_cmd(int sk)
                        cmd_size += cmd.pdu_len;
 
                cmdret = realloc(cmdret, cmd_size);
-               pdu = (void *) cmdret->payload;
 
                if (first)
                        memcpy(cmdret, &cmd, sizeof(cmd));
@@ -161,7 +160,8 @@ struct fio_net_cmd *fio_net_recv_cmd(int sk)
                }
 
                pdu_offset += cmd.pdu_len;
-               cmdret->pdu_len += cmd.pdu_len;
+               if (!first)
+                       cmdret->pdu_len += cmd.pdu_len;
                first = 0;
        } while (cmd.flags & FIO_NET_CMD_F_MORE);