aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/multi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/multi.c b/lib/multi.c
index e35b8fa19..43823cc93 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -581,7 +581,8 @@ static CURLcode multi_done(struct connectdata **connp,
&& !(conn->ntlm.state == NTLMSTATE_TYPE2 ||
conn->proxyntlm.state == NTLMSTATE_TYPE2)
#endif
- ) || conn->bits.close || premature) {
+ ) || conn->bits.close
+ || (premature && !(conn->handler->flags & PROTOPT_STREAM))) {
CURLcode res2 = Curl_disconnect(conn, premature); /* close connection */
/* If we had an error already, make sure we return that one. But