Can anyone point me to the code in mongrel2 that calculates the 
content-length header?  Looking at wireshark traces the content length 
is correct when I access my service with a browser, but too long when I 
access it with curl.  Searching the code for content-length or 
HTTP_CONTENT_LENGTH didn't turn up any obvious location.

Also is there a decent primer that talks about the mongrel2 code?  
Something that could act as a quicker start then just reading the code?

Thanks.

-Rob

On 5/17/12 12:49 PM, Rob LaRubbio wrote:
> I had thought that could be the issue so I added an explicit close, 
> but no change.  With or without sending the close message (we're using 
> Tir on the backend) I see Mongrel2 run my filter on either RESP_SENT 
> or CLOSE if I hit my service from a browser, and it never executes it 
> if I hit it from curl (or libcurl)
>
> -Rob
>
> On 5/17/12 12:16 PM, Justin Karneges wrote:
>> This week I noticed that Mongrel2's python library doesn't issue close
>> messages by default. Of course this is to ensure streaming works, but 
>> for some
>> reason I figured if Content-Length was passed and enough content 
>> sent, then
>> either the python library would send a close message or Mongrel2 would
>> automatically close the connection but it turns out that neither of 
>> these
>> things actually happen.
>>
>> Curl and pretty much every browser seems to receive HTTP responses 
>> just fine
>> with this behavior. But some other clients are pickier, and need the 
>> explicit
>> close (like Pingdom for example). I'm not sure what the right server 
>> behavior
>> is, but I've started issuing explicit close messages from my handlers 
>> when my
>> intention is that the HTTP response is complete.
>>
>> I don't know if this is the issue you're seeing, but I'm mentioning 
>> it just in
>> case.
>>
>> On Thursday, May 17, 2012 11:49:00 AM Alberto Salce wrote:
>>> Could this be related to why ApacheBenchmark and Mongrel2 don't get
>>> along. AB just hangs like if the connections are not being accepted.
>>> Siege works just fine.
>>>
>>> On 5/17/2012 12:14 PM, Rob LaRubbio wrote:
>>>> I'm trying to write a filter that I can use to track how long requests
>>>> are taking to run through my system.  The filter is pretty simple, it
>>>> just intercepts the REQ_RECV and RESP_SENT states, tracks the time of
>>>> each and prints it.
>>>>
>>>> When I run my filter and access my server with a browser I see both
>>>> states execute and the filter correctly prints the time.  However if I
>>>> access my server using curl on the command line I only see 
>>>> REQ_RECV.  I
>>>> do see the response from my service in the terminal and the curl 
>>>> command
>>>> returns.  I've also tried different combination of states with 
>>>> HANDLER&
>>>> CLOSED but I still see the same results.  I'm a little stumped by this
>>>> so any suggestions on where to look next would be really helpful.
>>>>
>>>> -Rob

Reply via email to