From df79e097ad8ce9f14753318f9ccb3b8cd6240f73 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Thu, 16 May 2013 17:04:31 +0400 Subject: [PATCH] page-server: Clos last loc xfer on connection close Currsntly this affects nothing, but xfer close should be called. Signed-off-by: Pavel Emelyanov --- page-xfer.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/page-xfer.c b/page-xfer.c index 1a3b4c8b8..8864e940c 100644 --- a/page-xfer.c +++ b/page-xfer.c @@ -50,6 +50,12 @@ static struct page_xfer_job cxfer = { .dst_id = ~0, }; +static void page_server_close(void) +{ + if (cxfer.dst_id != ~0) + cxfer.loc_xfer.close(&cxfer.loc_xfer); +} + static int page_server_open(struct page_server_iov *pi) { int type; @@ -59,8 +65,7 @@ static int page_server_open(struct page_server_iov *pi) id = decode_pm_id(pi->dst_id); pr_info("Opening %d/%ld\n", type, id); - if (cxfer.dst_id != ~0) - cxfer.loc_xfer.close(&cxfer.loc_xfer); + page_server_close(); if (open_page_xfer(&cxfer.loc_xfer, type, id)) return -1; @@ -183,6 +188,7 @@ static int page_server_serve(int sk) break; } + page_server_close(); pr_info("Session over\n"); close(sk);