To do this reasonably cleanly then return a appropriate HTTP status code
and list the mirrors in HTTP headers. Then see forward.c, more
specifically fwdReforwardableStatus() and fwdReforward() for how to get
the request retried to another server.
fwdReforwardableStatus() is a quick check Squid uses while receiving the
HTTP headers to determine if the reply should be immediately sent to the
client, or delayed to be able to retry the request to another server if
needed. fwdReforward() then makes a final decision on if the request
needs to be retried, and if so retries the request to another server.
The HTTP headers of the reply is available in decoded format in
fwdReforward().
-- Henrik Nordstrom Spare time Squid hacker Laura M. Padilla wrote: > > Hi, > OK. Let me explain a little bit of what I'm trying to do. > Basically, I'm modifying a web server so that if it is busy, instead > of sending a "service unavailable" message, it sends a list of mirror > sites as a header field in its reply. The cache server will then take > that list and forward the request to one of those mirror sites. So, > basically I have been looking at HTTP code in Squid to figure out how > requests are handled and so on. But, I'm still not a 100% clear on > how it works. Anyway, this is what I have right now and I appreciate > any help you can give. > > First, I have to process a reply from the server to determine > what the mirror sites are. Now, looking at the code I found a method > called httpReadReply() and that calls other functions from there. Is > this the place where replies start getting handled or does it start > somewhere else? > > Second, I need to send a request to the mirror site, so > basically I need to build a new request based on that header field and > forward it. I know there is code for request forwarding, but in that > case, it is just forwarding a request, not creating a new one. Is > there a way to create a new request? > > Third, all this code in client_side.c I want to make sure I > have this right. From my understanding is handles the requests that > come from the client, if there is a cache miss it calls fwdStart() and > that takes care of the request forwarding. NOw, there is also a point > in that code where a reply is being built, my understanding is that > the reply is based on a cache hit. Is this correct? > > I appreciate your time and any help that you can give me. I'm working > on this completely on my own and there is no one in the department > knowledgable of Squid. > > -- > Laura M. Padilla > -------------------- > lpadilla@cise.ufl.edu > > "I and I say, Rasta come speak the truth. > For righteousness shall stand strong in Babylon". > - Cultura Profetica > > On Wed, 2 Jun 1999, Henrik Nordstrom wrote: > > > Laura M. Padilla wrote: > > > I wanted to know is there anyone in the group that has delt > > > with Squid's source code. I want to make some modifications to it for > > > my tesis project and I would like to discuss some of my questions with > > > someone. If you understand the code really well, specially all the > > > HTTP part, please contact me. Thank you. > > > > Shoot! > > > > -- > > Henrik Nordstrom > > Spare time Squid hacker > > > >Received on Tue Jul 29 2003 - 13:15:58 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:09 MST