From: Liu Yuan <[email protected]> - rename it to clear_client_info() - move dprintf in it instead of call dprintf every time after clear_client()
Signed-off-by: Liu Yuan <[email protected]> --- sheep/sdnet.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sheep/sdnet.c b/sheep/sdnet.c index 00ec065..31193bb 100644 --- a/sheep/sdnet.c +++ b/sheep/sdnet.c @@ -391,7 +391,7 @@ static void requeue_request(struct request *req) queue_request(req); } -static void clear_client(struct client_info *ci); +static void clear_client_info(struct client_info *ci); static struct request *alloc_local_request(void *data, int data_length) { @@ -492,9 +492,8 @@ void put_request(struct request *req) eventfd_write(req->wait_efd, value); } else { if (conn_tx_on(&ci->conn)) { - dprintf("connection seems to be dead\n"); free_request(req); - clear_client(ci); + clear_client_info(ci); } else { list_add(&req->request_list, &ci->done_reqs); } @@ -662,10 +661,12 @@ static void destroy_client(struct client_info *ci) free(ci); } -static void clear_client(struct client_info *ci) +static void clear_client_info(struct client_info *ci) { struct request *req, *t; + dprintf("connection seems to be dead\n"); + if (ci->rx_req) { free_request(ci->rx_req); ci->rx_req = NULL; @@ -745,8 +746,7 @@ static void client_handler(int fd, int events, void *data) if (is_conn_dead(&ci->conn)) { err: - dprintf("connection seems to be dead\n"); - clear_client(ci); + clear_client_info(ci); } } -- 1.7.10.2 -- sheepdog mailing list [email protected] http://lists.wpkg.org/mailman/listinfo/sheepdog
