From 4075f7596bd7b879706516fd84f4acbf19a7d2c5 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 10 Jul 2007 06:25:30 +0100 Subject: [PATCH] Unplug before sending close() message, to avoid screwing up interfaces which respond to close with a reopen() (e.g. iSCSI). --- src/core/job.c | 4 ++-- src/core/resolv.c | 2 +- src/core/xfer.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/job.c b/src/core/job.c index 00c0e6c4..6c2faf30 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -29,16 +29,16 @@ void job_done ( struct job_interface *job, int rc ) { struct job_interface *dest = job_get_dest ( job ); - dest->op->done ( dest, rc ); job_unplug ( job ); + dest->op->done ( dest, rc ); job_put ( dest ); } void job_kill ( struct job_interface *job ) { struct job_interface *dest = job_get_dest ( job ); - dest->op->kill ( dest ); job_unplug ( job ); + dest->op->kill ( dest ); job_put ( dest ); } diff --git a/src/core/resolv.c b/src/core/resolv.c index 5c25ddb1..808ab657 100644 --- a/src/core/resolv.c +++ b/src/core/resolv.c @@ -50,8 +50,8 @@ void resolv_done ( struct resolv_interface *resolv, struct sockaddr *sa, int rc ) { struct resolv_interface *dest = resolv_get_dest ( resolv ); - dest->op->done ( dest, sa, rc ); resolv_unplug ( resolv ); + dest->op->done ( dest, sa, rc ); resolv_put ( dest ); } diff --git a/src/core/xfer.c b/src/core/xfer.c index 06895871..3add057b 100644 --- a/src/core/xfer.c +++ b/src/core/xfer.c @@ -38,8 +38,8 @@ void xfer_close ( struct xfer_interface *xfer, int rc ) { DBGC ( xfer, "XFER %p->%p close\n", xfer, dest ); - dest->op->close ( dest, rc ); xfer_unplug ( xfer ); + dest->op->close ( dest, rc ); xfer_put ( dest ); }