Re: [squid-users] external_acl_fuzzy patch

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Tue, 29 Mar 2005 19:46:09 +0200 (CEST)

On Mon, 28 Mar 2005, Ilya wrote:

> Hello!
>
> Several month passed and I decided to try to solve that problem again.

Good!

> I noticed that in patch the field "client_port" of "request" struct was added
> but never initialized.

Seems to indeed be the case.

> So I added
> request->client_port = ntohs(conn->peer.sin_port);
> in client_side.c
>
> Patch:
> --- client_side.c.orig
> +++ client_side.c
> @@ -3131,6 +3131,7 @@
> safe_free(http->log_uri);
> http->log_uri = xstrdup(urlCanonicalClean(request));
> request->client_addr = conn->peer.sin_addr;
> + request->client_port = ntohs(conn->peer.sin_port);
> request->my_addr = conn->me.sin_addr;
> request->my_port = ntohs(conn->me.sin_port);
> request->http_ver = http->http_ver;
>
> It seems to work: the field %SRCPORT is filled with source port in external
> helper.
>
> Is this patch correct?

Looks good to me.

Hmm.. this is in the patch since Feb 15.

Index: client_side.c
===================================================================
RCS file: /cvsroot/squid/squid/src/client_side.c,v
retrieving revision 1.83.2.1
retrieving revision 1.83.2.2
diff -u -p -r1.83.2.1 -r1.83.2.2
--- client_side.c 16 Feb 2005 00:53:44 -0000 1.83.2.1
+++ client_side.c 16 Feb 2005 01:03:57 -0000 1.83.2.2
@@ -1,6 +1,6 @@

  /*
- * $Id: client_side.c,v 1.83.2.1 2005/02/16 00:53:44 hno Exp $
+ * $Id: client_side.c,v 1.83.2.2 2005/02/16 01:03:57 hno Exp $
   *
   * DEBUG: section 33 Client-side Routines
   * AUTHOR: Duane Wessels
@@ -355,6 +355,7 @@ clientRedirectDone(void *data, char *res
         new_request->http_ver = old_request->http_ver;
         httpHeaderAppend(&new_request->header, &old_request->header);
         new_request->client_addr = old_request->client_addr;
+ new_request->client_port = old_request->client_port;
         new_request->my_addr = old_request->my_addr;
         new_request->my_port = old_request->my_port;
         new_request->flags.redirected = 1;
@@ -3131,6 +3132,7 @@ clientReadRequest(int fd, void *data)
             safe_free(http->log_uri);
             http->log_uri = xstrdup(urlCanonicalClean(request));
             request->client_addr = conn->peer.sin_addr;
+ request->client_port = ntohs(conn->peer.sin_port);
             request->my_addr = conn->me.sin_addr;
             request->my_port = ntohs(conn->me.sin_port);
             request->http_ver = http->http_ver;

Regards
Henrik
Received on Tue Mar 29 2005 - 10:46:16 MST

This archive was generated by hypermail pre-2.1.9 : Fri Apr 01 2005 - 12:00:03 MST