From: wessels <> Date: Wed, 22 Oct 1997 00:24:02 +0000 (+0000) Subject: handle read() == 0 from control socket X-Git-Tag: SQUID_3_0_PRE1~4743 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cc11e161458887d6a518b72dde8bca0cd9517abb;p=thirdparty%2Fsquid.git handle read() == 0 from control socket --- diff --git a/src/ftp.cc b/src/ftp.cc index 6b217401bd..87cda78e88 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.140 1997/10/20 19:06:02 wessels Exp $ + * $Id: ftp.cc,v 1.141 1997/10/21 18:24:02 wessels Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -1064,17 +1064,18 @@ ftpReadControlReply(int fd, void *data) return; } if (len == 0) { - debug(9, 1) ("Read 0 bytes from FTP control socket?\n"); - assert(len); - if (entry->object_len == 0) { - err = xcalloc(1, sizeof(ErrorState)); - err->type = ERR_READ_ERROR; - err->http_status = HTTP_INTERNAL_SERVER_ERROR; - err->errno = errno; - err->request = requestLink(ftpState->request); - errorAppendEntry(entry, err); + debug(9, 1) ("ftpReadControlReply: FD %d Read 0 bytes\n", fd); + if (entry->store_status == STORE_PENDING) { + storeReleaseRequest(entry); + if (entry->mem_obj->inmem_hi == 0) { + err = xcalloc(1, sizeof(ErrorState)); + err->type = ERR_READ_ERROR; + err->http_status = HTTP_INTERNAL_SERVER_ERROR; + err->errno = errno; + err->request = requestLink(ftpState->request); + errorAppendEntry(entry, err); + } } - storeAbort(entry, 0); comm_close(fd); return; }