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

Function StateAuthProxyConnect

plugins/authproxy/authproxy.cc:402–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400}
401
402static TSEvent
403StateAuthProxyConnect(AuthRequestContext *auth, void * /* edata ATS_UNUSED */)
404{
405 const AuthOptions *options = auth->options();
406 struct sockaddr const *ip = TSHttpTxnClientAddrGet(auth->txn);
407
408 TSReleaseAssert(ip); // We must have a client IP.
409
410 auth->method = AuthRequestGetMethod(auth->txn);
411 AuthLogDebug("client request %s a HEAD request", auth->method == TS_HTTP_METHOD_HEAD ? "is" : "is not");
412
413 auth->vconn = TSHttpConnect(ip);
414 if (auth->vconn == nullptr) {
415 return TS_EVENT_ERROR;
416 }
417 // Transform the client request into an auth proxy request and write it
418 // out to the auth proxy vconn.
419 if (!options->transform(auth)) {
420 return TS_EVENT_ERROR;
421 }
422 // Start a write and transition to WriteAuthProxyState.
423 TSVConnWrite(auth->vconn, auth->cont, auth->iobuf.reader, TSIOBufferReaderAvail(auth->iobuf.reader));
424 return TS_EVENT_CONTINUE;
425}
426
427static TSEvent
428StateAuthProxyCompleteHeaders(AuthRequestContext *auth, void * /* edata ATS_UNUSED */)

Callers

nothing calls this directly

Calls 7

TSHttpTxnClientAddrGetFunction · 0.85
AuthRequestGetMethodFunction · 0.85
TSHttpConnectFunction · 0.85
TSVConnWriteFunction · 0.85
TSIOBufferReaderAvailFunction · 0.85
optionsMethod · 0.80
transformMethod · 0.80

Tested by

no test coverage detected