/*
- * $Id: comm.cc,v 1.190 1997/10/23 05:13:37 wessels Exp $
+ * $Id: comm.cc,v 1.191 1997/10/23 16:38:09 wessels Exp $
*
* DEBUG: section 5 Socket Functions
* AUTHOR: Harvest Derived
}
void
-commSetDefer(int fd, DEFER * func)
+commSetDefer(int fd, DEFER * func, void *data)
{
fde *F = &fd_table[fd];
F->defer_check = func;
+ F->defer_data = data;
}
static int
fde *F = &fd_table[fd];
if (F->defer_check == NULL)
return 0;
- return F->defer_check(fd, F->read_data);
+ return F->defer_check(fd, F->defer_data);
}
#if HAVE_POLL
/*
- * $Id: ftp.cc,v 1.145 1997/10/23 05:13:39 wessels Exp $
+ * $Id: ftp.cc,v 1.146 1997/10/23 16:38:10 wessels Exp $
*
* DEBUG: section 9 File Transfer Protocol (FTP)
* AUTHOR: Harvest Derived
ftpReadData,
ftpState,
0);
- commSetDefer(ftpState->data.fd, protoCheckDeferRead);
+ commSetDefer(ftpState->data.fd, protoCheckDeferRead, ftpState->entry);
ftpState->state = READING_DATA;
return;
} else if (!EBIT_TEST(ftpState->flags, FTP_TRIED_NLST)) {
ftpReadData,
ftpState,
0);
- commSetDefer(ftpState->data.fd, protoCheckDeferRead);
+ commSetDefer(ftpState->data.fd, protoCheckDeferRead, ftpState->entry);
ftpState->state = READING_DATA;
} else {
ftpFail(ftpState);
/*
- * $Id: gopher.cc,v 1.101 1997/10/23 05:13:39 wessels Exp $
+ * $Id: gopher.cc,v 1.102 1997/10/23 16:38:10 wessels Exp $
*
* DEBUG: section 10 Gopher
* AUTHOR: Harvest Derived
gopherSendComplete(int fd, char *buf, int size, int errflag, void *data)
{
GopherStateData *gopherState = (GopherStateData *) data;
- StoreEntry *entry = NULL;
- entry = gopherState->entry;
+ StoreEntry *entry = gopherState->entry;
debug(10, 5) ("gopherSendComplete: FD %d size: %d errflag: %d\n",
fd, size, errflag);
if (errflag) {
}
/* Schedule read reply. */
commSetSelect(fd, COMM_SELECT_READ, gopherReadReply, gopherState, 0);
- commSetDefer(fd, protoCheckDeferRead);
+ commSetDefer(fd, protoCheckDeferRead, entry);
if (buf)
put_free_4k_page(buf); /* Allocated by gopherSendRequest. */
}
/*
- * $Id: http.cc,v 1.194 1997/10/23 05:13:40 wessels Exp $
+ * $Id: http.cc,v 1.195 1997/10/23 16:38:11 wessels Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
COMM_SELECT_READ,
httpReadReply,
httpState, 0);
- commSetDefer(fd, protoCheckDeferRead);
+ commSetDefer(fd, protoCheckDeferRead, entry);
}
}
/*
- * $Id: main.cc,v 1.176 1997/10/23 05:13:42 wessels Exp $
+ * $Id: main.cc,v 1.177 1997/10/23 16:38:13 wessels Exp $
*
* DEBUG: section 1 Startup and Main Loop
* AUTHOR: Harvest Derived
continue;
comm_listen(fd);
commSetSelect(fd, COMM_SELECT_READ, httpAccept, NULL, 0);
- commSetDefer(fd, httpAcceptDefer);
+ commSetDefer(fd, httpAcceptDefer, NULL);
debug(1, 1) ("Accepting HTTP connections on port %d, FD %d.\n",
(int) u->i, fd);
HttpSockets[NHttpSockets++] = fd;
FREE *));
extern void commCallCloseHandlers _PARAMS((int fd));
extern int commSetTimeout _PARAMS((int fd, int, PF *, void *));
-extern void commSetDefer(int fd, DEFER * func);
+extern void commSetDefer(int fd, DEFER * func, void *);
extern void _db_init _PARAMS((const char *logfile, const char *options));
extern void _db_rotate_log _PARAMS((void));
void *lifetime_data;
close_handler *close_handler; /* linked list */
DEFER *defer_check; /* check if we should defer read */
+ void *defer_data;
CommWriteStateData *rwstate; /* State data for comm_write */
};
/*
- * $Id: wais.cc,v 1.87 1997/10/23 05:13:46 wessels Exp $
+ * $Id: wais.cc,v 1.88 1997/10/23 16:38:16 wessels Exp $
*
* DEBUG: section 24 WAIS Relay
* AUTHOR: Harvest Derived
COMM_SELECT_READ,
waisReadReply,
waisState, 0);
- commSetDefer(fd, protoCheckDeferRead);
+ commSetDefer(fd, protoCheckDeferRead, entry);
}
}