[sslh] [PATCH 02/10] Let defer_write accumulate data

ondra+sslh at mistotebe.net ondra+sslh at mistotebe.net
Tue Sep 24 17:14:23 CEST 2013


On Tue, Sep 24, 2013 at 04:43:53PM +0200, Yves Rutschle wrote:
> On Tue, Sep 24, 2013 at 04:19:57PM +0200, ondra at mistotebe.net wrote:
>> > Ok, so maybe I misunderstood the indent of your patch 
>> Yes, to allow adding more data to a buffer with some data already
>> present, so that a probe can say it does not have enough data to respond
>> and the test is performed once more data has arrived. For this,
>> defer_write does not have to worry about about a partially drained
>> buffer as there is nowhere to drain to yet.
> 
> Oh I see! So you can add more data *before* the first ever
> flushing (while probing), and once it starts draining you
> can no longer add more data before flushing the entire
> buffer?

That's the aim of the proposed implementation, yes. Removing the
limitation would be simple, but there was no need to do that.

> I'll need to re-read the patch tonight with this in mind
> (that'll deserve a comment in the code though)

I guess the assert checking begin_deferred_data == deferred_data should
be descriptive enough for anyone reviewing the code/trying to use it.

In the later patches, when adding the PROBE_AGAIN functionality, I did
not update the test cases to cover that. The reason for that is that my
Perl skills are mostly limited to reading the code. I certainly do not
know how to write a non-blocking I/O testcase with Perl. If you could
show me how to do it efficiently or draft a proof of concept, I could
extend the testcases then.



More information about the sslh mailing list