[squid-users] [PATCH] bug? squid never uses peers for POST requests

From: Ward Vandewege <ward@dont-contact.us>
Date: Thu, 27 Jun 2002 17:43:55 +0200

Hi,

There is an issue (bug? feature?) with all squid versions 2.4.x - 2.6.x and
POST requests.

Basically these versions of squid _never_ use a peer cache server when it
comes to POST requests.

I am on a crippled internet connection that blocks all outgoing traffic to
port 80, I need to use the providers' proxy at port 8080. I had a problem
that POST requests never got through my squid proxy (with upstream peer at
port 8080), though all other traffic went through fine. After some debugging
and tracing I found the following bit of code in the peer_select.c file:

  switch (ps->direct) {
    case DIRECT_YES:
      peerGetSomeDirect(ps);
      break;
    case DIRECT_NO:
      peerGetSomeParent(ps);
      peerGetAllParents(ps);
      break;
    default:
      if (Config.onoff.prefer_direct)
--> peerGetSomeDirect(ps);
      if (request->flags.hierarchical ||
          !Config.onoff.nonhierarchical_direct)
        peerGetSomeParent(ps);
      if (!Config.onoff.prefer_direct)
--> peerGetSomeDirect(ps);
      break;
  }
  peerSelectCallback(ps);

Compare the lines with the arrows. This doesn't seem very logical. I've
updated the second occurrance to:

  if (!Config.onoff.prefer_direct) {
    peerGetSomeParent(ps);
    peerGetAllParents(ps);
  }

And voila, all of a sudden POST requests worked for me! I have attached a
patch in diff -u format. All feedback is very welcome...

Bye for now,
Ward.

--
It isn't pollution that's harming the environment. It's the impurities in
our air and water that are doing it. -- Former U.S. Vice-President Dan
Quayle

Received on Thu Jun 27 2002 - 09:44:02 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:08:51 MST