From: wessels <> Date: Tue, 17 Mar 1998 07:38:52 +0000 (+0000) Subject: fixed ident coredumps. The callback data was "hardcoded" as connStateData, X-Git-Tag: SQUID_3_0_PRE1~3816 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=425ad52e6ac046d21df966869973cdc8d59441ae;p=thirdparty%2Fsquid.git fixed ident coredumps. The callback data was "hardcoded" as connStateData, when the callback function was expecting a clientHttpRequest. --- diff --git a/src/client_side.cc b/src/client_side.cc index e0c2a71d33..0286fcd6df 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.228 1998/03/16 21:59:55 wessels Exp $ + * $Id: client_side.cc,v 1.229 1998/03/17 00:38:52 wessels Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -92,7 +92,7 @@ clientAccessCheck(void *data) ConnStateData *conn = http->conn; char *browser; if (Config.onoff.ident_lookup && conn->ident.state == IDENT_NONE) { - identStart(-1, conn, clientAccessCheck); + identStart(-1, conn, clientAccessCheck, http); return; } if (checkAccelOnly(http)) { diff --git a/src/ident.cc b/src/ident.cc index 199c7d530e..a81b525b63 100644 --- a/src/ident.cc +++ b/src/ident.cc @@ -1,6 +1,6 @@ /* - * $Id: ident.cc,v 1.37 1997/11/12 00:08:54 wessels Exp $ + * $Id: ident.cc,v 1.38 1998/03/17 00:38:53 wessels Exp $ * * DEBUG: section 30 Ident (RFC 931) * AUTHOR: Duane Wessels @@ -47,9 +47,10 @@ identClose(int fdnotused, void *data) /* start a TCP connection to the peer host on port 113 */ void -identStart(int fd, ConnStateData * connState, IDCB * callback) +identStart(int fd, ConnStateData * connState, IDCB * callback, void *data) { connState->ident.callback = callback; + connState->ident.callback_data = data; connState->ident.state = IDENT_PENDING; if (fd < 0) { fd = comm_open(SOCK_STREAM, @@ -124,5 +125,5 @@ identCallback(ConnStateData * connState) { connState->ident.state = IDENT_DONE; if (connState->ident.callback) - connState->ident.callback(connState); + connState->ident.callback(connState->ident.callback_data); } diff --git a/src/protos.h b/src/protos.h index 2400bcb8c7..23fc25e9dd 100644 --- a/src/protos.h +++ b/src/protos.h @@ -547,7 +547,7 @@ extern void start_announce(void *unused); extern void sslStart(int fd, const char *, request_t *, size_t * sz); extern void waisStart(request_t *, StoreEntry *); extern void passStart(int, const char *, request_t *, size_t *); -extern void identStart(int, ConnStateData *, IDCB * callback); +extern void identStart(int, ConnStateData *, IDCB * callback, void *); extern void statInit(void); extern void pconnHistCount(int, int); diff --git a/src/structs.h b/src/structs.h index 64f4cb5e6b..7021108d09 100644 --- a/src/structs.h +++ b/src/structs.h @@ -679,6 +679,7 @@ struct _ConnStateData { char ident[ICP_IDENT_SZ]; IDCB *callback; int state; + void *callback_data; } ident; CommWriteStateData *commWriteState; int nrequests;