subversion-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lieven Govaerts <>
Subject Re: [serf-dev] Re: [PATCH] Serf crash on spurious data between responses
Date Mon, 12 Jan 2015 14:09:48 GMT
On Mon, Jan 12, 2015 at 12:22 PM, Philip Martin
<> wrote:
> Lieven Govaerts <> writes:
>> You're trying to capture the situation where serf has:
>> - finished writing a request ( req_bkt == NULL && writing_started )
>> - has no more requests in the pending queue
>> - and receives actual bytes of data.
>> Right?
>> Looks like your patch is a correct way to fix the problem. Some
>> comments would be welcome, and if you have the time a test.
> I'm not familiar with serf's testsuite.  The scenario:
>   - client sends first request
>   - server sends response
>   - server sends extra data, say '\n'
>   - client handles first request
>   - client creates a second request
>   - client calls serf to send second, pipelined, request
Is there a reason you specifically mention pipelined here? The first
response has been handled so it's just synchronous communication.

>   - serf reads extra data
>   - serf attempts to pass the extra data to client's callbacks
> At this point serf has not called setup_request so although the client
> has created a request is not ready to receive data.

Ok, clear.

>  How do I go about writing such a test?

The easiest way is to use existing tests as a starting point.:
- Test test_serf_connection_request_create sends 2 requests and responses.
  This tests sends two pipelined requests, but you can modifiy it to
send the 1st request, then run the serf loop, then send the 2nd
- To add the extra data to the response of the first request, you'll
have to create the raw response body.
  Have a look at test test_request_timeout, line:
      Respond(WithRawData(RESPONSE_408, strlen(RESPONSE_408)))



> --
> Philip Martin | Subversion Committer
> WANdisco // *Non-Stop Data*

View raw message