MCPcopy Create free account
hub / github.com/chenshuo/muduo / onBeginRequest

Method onBeginRequest

examples/fastcgi/fastcgi.cc:231–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229}
230
231bool FastCgiCodec::onBeginRequest(const RecordHeader& header, const Buffer* buf)
232{
233 assert(buf->readableBytes() >= header.length);
234 assert(header.type == kFcgiBeginRequest);
235
236 if (header.length >= kRecordHeader)
237 {
238 uint16_t role = readInt16(buf->peek()+kRecordHeader);
239 uint8_t flags = buf->peek()[kRecordHeader + sizeof(int16_t)];
240 if (role == kFcgiResponder)
241 {
242 keepConn_ = flags == kFcgiKeepConn;
243 return true;
244 }
245 }
246 return false;
247}

Callers

nothing calls this directly

Calls 3

readInt16Function · 0.85
readableBytesMethod · 0.80
peekMethod · 0.80

Tested by

no test coverage detected