From 7806ec11ee45d6888c65e98da2bb4b6e56d19dcd Mon Sep 17 00:00:00 2001 From: nick Date: Tue, 25 Feb 2014 15:45:41 +0000 Subject: [PATCH] client: cork/uncork around NBD_REQUEST_READ responses We don't cork/uncork around NBD_REQUEST_WRITE responses because they're only 16 bytes, and we're using blocking writes. --- src/common/client.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/client.c b/src/common/client.c index 7458068..a838366 100644 --- a/src/common/client.c +++ b/src/common/client.c @@ -419,9 +419,9 @@ void client_reply_to_read( struct client* client, struct nbd_request request ) { off64_t offset; - // TODO: cork debug("request read %ld+%d", request.from, request.len); - client_write_reply( client, &request, 0); + sock_set_tcp_cork( client->socket, 1 ); + client_write_reply( client, &request, 0 ); offset = request.from; @@ -438,7 +438,7 @@ void client_reply_to_read( struct client* client, struct nbd_request request ) offset, request.len); - // TODO: uncork + sock_set_tcp_cork( client->socket, 0 ); }