Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 e728762 that converted inBuf to SBuf.
- Loading branch information