tor 2012-03-15 klockan 18:40 -0700 skrev Schulz: > Simply speaking, when dealing with the POST request, squid mainly use > the readRequest-->tryParseHttp-->parseHttpReq(in which using the > urlParse to find the method )
That's the general request parsing path, parsing the request into Request line Request headers Body pipe (not parsed, only transferred) this is the same for all requests with POST no different from a GET/HEAD/OPTIONS/PUT/DELETE/whatever. Even CONNECT gets parsed the same way. > When parseHttpReq retrieve all the useful info, then the tryParse > would react according to the http. But tryParse only return the bytes > it used to the readRequest. Where is the following procedure? When the request is parsed it's added to the list of pending requests on the connection and handed off to the chain of access controls. In Squid-2 the access control chain starts with clientCheckFollowXForwardedFor() and ends in clientProcessRequest(), where it checks it it's a cache etc. then if the request needs to be forwarded (which is always the case for POST) it calls fwdStart(), which does a bit of a dance to figure the right path for forwarding the request, opens a connection and hands off to the respective protocol handler, i.e. http. Up to this point the body of the POST request is not touched at all. Only the protocol handler accesses the body of the POST request. Regards Henrik
