]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
fixed ident coredumps. The callback data was "hardcoded" as connStateData,
authorwessels <>
Tue, 17 Mar 1998 07:38:52 +0000 (07:38 +0000)
committerwessels <>
Tue, 17 Mar 1998 07:38:52 +0000 (07:38 +0000)
when the callback function was expecting a clientHttpRequest.

src/client_side.cc
src/ident.cc
src/protos.h
src/structs.h

index e0c2a71d3325fb86493163869aaa311514b44c88..0286fcd6dfae81ae9c1abdc8e55608596caf37de 100644 (file)
@@ -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)) {
index 199c7d530e8deae28a710bd3117ae44b261afd78..a81b525b63f911bd92b2215354df426e04938e00 100644 (file)
@@ -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);
 }
index 2400bcb8c7eb6ef97d9e19414b8b5e3c8d052a6d..23fc25e9ddd2acb8b2d884a7a003e554c6c61ba5 100644 (file)
@@ -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);
index 64f4cb5e6b1f5b8da057f5bb1962fa7d005516c1..7021108d09eb1bd94a02c6f2d94780b44b32511a 100644 (file)
@@ -679,6 +679,7 @@ struct _ConnStateData {
        char ident[ICP_IDENT_SZ];
        IDCB *callback;
        int state;
+       void *callback_data;
     } ident;
     CommWriteStateData *commWriteState;
     int nrequests;