]> git.ipfire.org Git - thirdparty/squid.git/commit
Optimization: Do not zero-terminate Server::inBuf (#1889)
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 21 Aug 2024 07:09:15 +0000 (07:09 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Wed, 21 Aug 2024 14:41:21 +0000 (14:41 +0000)
commit46b10098e9a62c4d822d1dba8a013e8f8dc25a0d
treedbf5c2b11ae2ec9c89ab39a86e995dc61ffb2afe
parentebbcff227644f07f2addfe58bd7b52d7726fa37c
Optimization: Do not zero-terminate Server::inBuf (#1889)

... when storing unencoded request body bytes in ConnStateData::bodyPipe

Calling SBuf::c_str() is unnecessary in this context because
BodyPipe::append() does not need/expect a zero-terminated buffer. The
call is relatively expensive when the previous Comm::ReadNow() was able
to fill the entire inBuf trailing space, which is a common occurrence
because Server::maybeMakeSpaceAvailable() uses CLIENT_REQ_BUF_SZ as
idealSpace size, and CLIENT_REQ_BUF_SZ is hard-coded to just 4096 bytes.

The call was added in 2014 commit e7287625 that converted inBuf to SBuf.
src/client_side.cc