/*
- * $Id: client_side.cc,v 1.112 1997/06/17 04:54:08 wessels Exp $
+ * $Id: client_side.cc,v 1.113 1997/06/20 00:00:10 wessels Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
static void
-icpHandleIMSReply(void *data, char *buf, size_t size)
+icpHandleIMSReply(void *data, char *buf, ssize_t size)
{
clientHttpRequest *http = data;
int fd = http->conn->fd;
/*
- * $Id: comm.cc,v 1.167 1997/06/18 16:00:09 wessels Exp $
+ * $Id: comm.cc,v 1.168 1997/06/20 00:00:11 wessels Exp $
*
* DEBUG: section 5 Socket Functions
* AUTHOR: Harvest Derived
/* Note we even call write if nleft == 0 */
/* We're done */
if (nleft != 0)
- debug(5, 2) ("commHandleWrite: FD %d: write failure: connection closed with %d bytes remaining.\n", fd, nleft);
+ debug(5, 1) ("commHandleWrite: FD %d: write failure: connection closed with %d bytes remaining.\n", fd, nleft);
CommWriteStateCallbackAndFree(fd, nleft ? COMM_ERROR : COMM_OK);
} else if (len < 0) {
/* An error */
/*
- * $Id: ftp.cc,v 1.125 1997/06/19 22:51:50 wessels Exp $
+ * $Id: ftp.cc,v 1.126 1997/06/20 00:00:12 wessels Exp $
*
* DEBUG: section 9 File Transfer Protocol (FTP)
* AUTHOR: Harvest Derived
if (len < 0) {
debug(50, 1) ("ftpReadData: read error: %s\n", xstrerror());
if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR) {
- commSetSelect(fd, COMM_SELECT_READ,
- ftpReadData, data, 0);
+ commSetSelect(fd, COMM_SELECT_READ, ftpReadData, data, 0);
} else {
BIT_RESET(entry->flag, ENTRY_CACHABLE);
storeReleaseRequest(entry);
ftpListingFinish(ftpState);
storeTimestampsSet(entry);
storeComplete(entry);
- ftpDataTransferDone(ftpState);
+ /* expect the "transfer complete" message on the control socket */
+ commSetSelect(ftpState->ctrl.fd,
+ COMM_SELECT_READ,
+ ftpReadControlReply,
+ ftpState,
+ 0);
} else {
if (EBIT_TEST(ftpState->flags, FTP_ISDIR)) {
ftpParseListing(ftpState, len);
StoreEntry *entry = ftpState->entry;
debug(9, 7) ("ftpWriteCommandCallback: wrote %d bytes\n", size);
if (errflag) {
+ debug(50,1)("ftpWriteCommandCallback: FD %d: %s\n", fd, xstrerror());
BIT_RESET(entry->flag, ENTRY_CACHABLE);
storeReleaseRequest(entry);
storeAbort(entry, ERR_WRITE_ERROR, xstrerror(), 0);
debug(9, 1) ("Got code %d after reading data, releasing entry\n");
storeReleaseRequest(ftpState->entry);
}
+ ftpDataTransferDone(ftpState);
}
static void
/*
- * $Id: squid.h,v 1.122 1997/06/18 00:20:03 wessels Exp $
+ * $Id: squid.h,v 1.123 1997/06/20 00:00:14 wessels Exp $
*
* AUTHOR: Duane Wessels
*
typedef void SIH _PARAMS((void *, int)); /* swap in */
typedef int QS _PARAMS((const void *, const void *)); /* qsort */
-typedef void STCB _PARAMS((void *, char *, size_t)); /* store callback */
+typedef void STCB _PARAMS((void *, char *, ssize_t)); /* store callback */
#include "cache_cf.h"
#include "fd.h"
/*
- * $Id: stmem.cc,v 1.43 1997/06/04 06:16:10 wessels Exp $
+ * $Id: stmem.cc,v 1.44 1997/06/20 00:00:15 wessels Exp $
*
* DEBUG: section 19 Memory Primitives
* AUTHOR: Harvest Derived
}
}
-size_t
+ssize_t
memCopy(const mem_ptr mem, off_t offset, char *buf, size_t size)
{
mem_node p = mem->head;
/*
- * $Id: store.cc,v 1.260 1997/06/19 22:51:55 wessels Exp $
+ * $Id: store.cc,v 1.261 1997/06/20 00:00:16 wessels Exp $
*
* DEBUG: section 20 Storeage Manager
* AUTHOR: Harvest Derived
MemObject *mem = e->mem_obj;
STCB *callback = NULL;
struct _store_client *sc;
- size_t size;
+ ssize_t size;
if (mem->clients == NULL && mem->nclients) {
debug_trap("InvokeHandlers: NULL mem->clients");
return;
assert(e->store_status == STORE_PENDING);
assert(mem != NULL);
safe_free(mem->e_abort_msg);
- mem->e_abort_msg = xstrdup(msg);
+ if (msg)
+ mem->e_abort_msg = xstrdup(msg);
debug(20, 6) ("storeAbort: %s %s\n", log_tags[abort_code], e->key);
storeNegativeCache(e);
storeReleaseRequest(e);