After r13324 patch the SBuf argument of the ConnStateData::handleReadData member
is used only to check if ConnStateData::In::buf is correctly filled with read
data. ConnStateData::handleReadData considers that the data already written
in ConnStateData::in.buf and checks if the passed Sbuf argument is the
ConnStateData::in.buf:
bool ConnStateData::handleReadData(SBuf *buf)
{
assert(buf == &in.buf);
.....
The httpsSslBumpAccessCheckDone function needs to write the CONNECT request
generated internally to force tunnel mode, in ConnStateData::In::buf and then
call ConnStateData::handleReadData method.
// fake a CONNECT request to force connState to tunnel
static char ip[MAX_IPSTRLEN];
connState->clientConnection->local.toUrl(ip, sizeof(ip));
- SBuf reqStr;
- reqStr.append("CONNECT ").append(ip).append(" HTTP/1.1\r\nHost: ").append(ip).append("\r\n\r\n");
- bool ret = connState->handleReadData(&reqStr);
+ connState->in.buf.append("CONNECT ").append(ip).append(" HTTP/1.1\r\nHost: ").append(ip).append("\r\n\r\n");
+ bool ret = connState->handleReadData(&connState->in.buf);
if (ret)
ret = connState->clientParseRequests();