From 96f1be5daca3c6b589cb8a7cd4d4902a87e832b6 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Sun, 26 Oct 1997 09:33:16 +0000 Subject: [PATCH] Define ERR_COMM_CLOSING error status code to be used when the comm_write callback is called from comm_close(). --- src/comm.cc | 4 ++-- src/defines.h | 1 + src/ftp.cc | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/comm.cc b/src/comm.cc index cc5cd097a5..1f0956daf1 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,6 +1,6 @@ /* - * $Id: comm.cc,v 1.195 1997/10/26 01:46:08 wessels Exp $ + * $Id: comm.cc,v 1.196 1997/10/26 02:33:17 wessels Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -569,7 +569,7 @@ comm_close(int fd) assert(F->open); assert(F->type != FD_FILE); BIT_SET(F->flags, FD_CLOSING); - CommWriteStateCallbackAndFree(fd, COMM_ERROR); + CommWriteStateCallbackAndFree(fd, COMM_ERR_CLOSING); commCallCloseHandlers(fd); if (F->uses) /* assume persistent connect count */ pconnHistCount(1, F->uses); diff --git a/src/defines.h b/src/defines.h index 5c8b9347e0..3dce0fb788 100644 --- a/src/defines.h +++ b/src/defines.h @@ -33,6 +33,7 @@ #define COMM_INPROGRESS (-6) #define COMM_ERR_CONNECT (-7) #define COMM_ERR_DNS (-8) +#define COMM_ERR_CLOSING (-9) #define COMM_NONBLOCKING (0x1) #define COMM_NOCLOEXEC (0x8) diff --git a/src/ftp.cc b/src/ftp.cc index bf396aaabc..d29503ef2d 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.150 1997/10/25 17:22:42 wessels Exp $ + * $Id: ftp.cc,v 1.151 1997/10/26 02:33:16 wessels Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -957,6 +957,8 @@ ftpWriteCommandCallback(int fd, char *buf, int size, int errflag, void *data) StoreEntry *entry = ftpState->entry; ErrorState *err; debug(9, 7) ("ftpWriteCommandCallback: wrote %d bytes\n", size); + if (errflag == COMM_ERR_CLOSING) + return; if (errflag) { debug(50, 1) ("ftpWriteCommandCallback: FD %d: %s\n", fd, xstrerror()); if (entry->mem_obj->inmem_hi == 0) { -- 2.47.3