From 75c07aba7acf9c07c800c497f868ed48b073fe75 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Petr=20P=C3=ADsa=C5=99?= Date: Tue, 2 Mar 2010 12:21:20 +0100 Subject: [PATCH] Aborted transfer does not close connection Former practice was to close connection what forced application to relog-in on next operation. This has been found as wrong attitude and it do not close connection since now. It will return new error code IE_ABORTED instead of IE_NETWORK. --- src/isds.c | 2 ++ src/isds.h | 3 ++- src/soap.c | 7 +++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/isds.c b/src/isds.c index 1a28c9c..9748915 100644 --- a/src/isds.c +++ b/src/isds.c @@ -553,6 +553,8 @@ const char *isds_strerror(const isds_error error) { return(_("Values not uqual")); break; case IE_PARTIAL_SUCCESS: return(_("Some suboperations failed")); break; + case IE_ABORTED: + return(_("Operation aborted")); break; default: return(_("Unknown error")); } diff --git a/src/isds.h b/src/isds.h index 07e8c26..fbb11f0 100644 --- a/src/isds.h +++ b/src/isds.h @@ -48,7 +48,8 @@ typedef enum { IE_2SMALL, IE_NOTUNIQ, IE_NOTEQUAL, - IE_PARTIAL_SUCCESS + IE_PARTIAL_SUCCESS, + IE_ABORTED } isds_error; typedef enum { diff --git a/src/soap.c b/src/soap.c index de252a1..e8f9b81 100644 --- a/src/soap.c +++ b/src/soap.c @@ -275,7 +275,10 @@ static isds_error http(struct isds_ctx *context, const char *url, /* Check for errors so far */ if (curl_err) { isds_log_message(context, curl_easy_strerror(curl_err)); - err = IE_NETWORK; + if (curl_err == CURLE_ABORTED_BY_CALLBACK) + err = IE_ABORTED; + else + err = IE_NETWORK; goto leave; } @@ -391,7 +394,7 @@ leave: *charset = NULL; } - close_connection(context); + if (err != IE_ABORTED) close_connection(context); } *response = body.data; -- 2.11.4.GIT