[PATCH] Convert the ConnStateData input buffer to SBuf

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Sun, 09 Mar 2014 00:13:43 +1300

Prepare the way to efficiently parse client requests using SBuf based
parser-ng.

We rely on several guarantees for this to work:

 * rawSpace(N) guarantees that the backing store is both unique to this
SBuf and has at least N bytes of unused buffer allocated.

 * SBuf member retains an active reference to the MemBlob backing store
for the duration of the read operation. Except in cases whete
ConnStateData gets destructed, in which case ConnStateData cancels the
read explicitly.

 * comm_read() is effectively a blocking operation with regards to read
on the client socket. No other read is scheduled until the callback
handler has been run.

 * parsing and other manipulations of the buffer are done synchronously
by the read handler before scheduling more reads.

FWIW: this code has had one days testing under real-world traffic from a
few heavy users with good results.

Amos

Received on Sat Mar 08 2014 - 11:14:00 MST

This archive was generated by hypermail 2.2.0 : Sun Mar 09 2014 - 12:00:11 MDT