You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2022/12/13 23:09:33 UTC

[trafficserver] branch master updated: authproxy: Handle WRITE_READY event (#9243)

This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 71a80d1ab authproxy: Handle WRITE_READY event (#9243)
71a80d1ab is described below

commit 71a80d1abb3fbcb2e30ff850c8bca0a371589b5a
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Tue Dec 13 16:09:27 2022 -0700

    authproxy: Handle WRITE_READY event (#9243)
---
 plugins/authproxy/authproxy.cc | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/plugins/authproxy/authproxy.cc b/plugins/authproxy/authproxy.cc
index aa5269636..74f20ce7f 100644
--- a/plugins/authproxy/authproxy.cc
+++ b/plugins/authproxy/authproxy.cc
@@ -81,6 +81,7 @@ struct StateTransition {
 };
 
 static TSEvent StateAuthProxyConnect(AuthRequestContext *, void *);
+static TSEvent StateAuthProxyWriteReady(AuthRequestContext *, void *);
 static TSEvent StateAuthProxyWriteComplete(AuthRequestContext *, void *);
 static TSEvent StateUnauthorized(AuthRequestContext *, void *);
 static TSEvent StateAuthorized(AuthRequestContext *, void *);
@@ -128,6 +129,7 @@ static const StateTransition StateTableProxyReadHeader[] = {
 
 // State table for sending the request to the auth proxy.
 static const StateTransition StateTableProxyRequest[] = {
+  {TS_EVENT_VCONN_WRITE_READY, StateAuthProxyWriteReady, StateTableProxyRequest},
   {TS_EVENT_VCONN_WRITE_COMPLETE, StateAuthProxyWriteComplete, StateTableProxyReadHeader},
   {TS_EVENT_ERROR, StateUnauthorized, nullptr},
   {TS_EVENT_NONE, nullptr, nullptr}};
@@ -533,6 +535,13 @@ StateAuthProxyReadHeaders(AuthRequestContext *auth, void * /* edata ATS_UNUSED *
   return complete ? TS_EVENT_HTTP_READ_REQUEST_HDR : TS_EVENT_CONTINUE;
 }
 
+static TSEvent
+StateAuthProxyWriteReady(AuthRequestContext *auth, void * /* edata ATS_UNUSED */)
+{
+  TSVConnWrite(auth->vconn, auth->cont, auth->iobuf.reader, TSIOBufferReaderAvail(auth->iobuf.reader));
+  return TS_EVENT_CONTINUE;
+}
+
 static TSEvent
 StateAuthProxyWriteComplete(AuthRequestContext *auth, void * /* edata ATS_UNUSED */)
 {