This is an automated email from the ASF dual-hosted git repository.
bcall pushed a commit to branch 9.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/9.1.x by this push:
new 590f87304 authproxy: Handle WRITE_READY event (#9243)
590f87304 is described below
commit 590f87304b233791169af3d5899c5ba135bb61fa
Author: Masakazu Kitajo <[email protected]>
AuthorDate: Tue Dec 13 16:09:27 2022 -0700
authproxy: Handle WRITE_READY event (#9243)
(cherry picked from commit 71a80d1abb3fbcb2e30ff850c8bca0a371589b5a)
---
plugins/authproxy/authproxy.cc | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/plugins/authproxy/authproxy.cc b/plugins/authproxy/authproxy.cc
index 88dadd09c..c49d7e200 100644
--- a/plugins/authproxy/authproxy.cc
+++ b/plugins/authproxy/authproxy.cc
@@ -80,6 +80,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 *);
@@ -127,6 +128,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}};
@@ -532,6 +534,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 */)
{