]> git.ipfire.org Git - thirdparty/squid.git/commit - src/comm/IoCallback.cc
Push SBuf down into Comm::IoCallback
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 15 Mar 2014 02:30:08 +0000 (19:30 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 15 Mar 2014 02:30:08 +0000 (19:30 -0700)
commit5ddf7edc175aa07bed5abd31d09ffb2547af14bd
tree2d918ad8058a0ea498ef5f796340a7703a41720c
parent8a64f7f1191d1536ff3079e32bb6b6b5aa8dcc3a
Push SBuf down into Comm::IoCallback

Use a pointer to the SBuf instead of the rawSpace() because using a SBuf
copy can potentially cause different MemBlob to exist behind the Comm
read classes and the caller (ConnStateData) class. They need to be kept
identical so as not to loose any existing bytes in the I/O buffer when
a read callback handler is run.

Pointer to SBuf also avoids race conditions between comm_read async calls
and BodyPipe notifications which can potentially change the MemBlob
underneath comm_read() and invalidate te char* buffer pointer used
previously.
src/CommCalls.h
src/client_side.cc
src/client_side.h
src/comm.cc
src/comm.h
src/comm/IoCallback.cc
src/comm/IoCallback.h
src/tests/stub_client_side.cc