MCPcopy Create free account
hub / github.com/apache/trafficserver / StateAuthProxyCompleteContent

Function StateAuthProxyCompleteContent

plugins/authproxy/authproxy.cc:588–606  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

586}
587
588static TSEvent
589StateAuthProxyCompleteContent(AuthRequestContext *auth, void * /* edata ATS_UNUSED */)
590{
591 unsigned needed;
592 int64_t avail;
593
594 avail = TSIOBufferReaderAvail(auth->iobuf.reader);
595 needed = HttpGetContentLength(auth->rheader.buffer, auth->rheader.header);
596
597 AuthLogDebug("we have %u of %u needed bytes", (unsigned)avail, needed);
598
599 if (avail >= needed) {
600 // OK, we have what we need. Let's respond to the client request.
601 AuthChainAuthorizationResponse(auth);
602 return TS_EVENT_HTTP_SEND_RESPONSE_HDR;
603 }
604 // We got EOS before reading all the content we expected.
605 return TS_EVENT_ERROR;
606}
607
608// Terminal state. Force a 403 Forbidden response.
609static TSEvent

Callers

nothing calls this directly

Calls 3

TSIOBufferReaderAvailFunction · 0.85
HttpGetContentLengthFunction · 0.85

Tested by

no test coverage detected