You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ez...@apache.org on 2022/12/14 00:03:46 UTC
[trafficserver] branch 8.1.x updated: authproxy: Handle WRITE_READY event (#9247)
This is an automated email from the ASF dual-hosted git repository.
eze pushed a commit to branch 8.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/8.1.x by this push:
new f37d60345 authproxy: Handle WRITE_READY event (#9247)
f37d60345 is described below
commit f37d603452b1156cd5d197a768f89d9bec605d11
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Tue Dec 13 17:03:41 2022 -0700
authproxy: Handle WRITE_READY event (#9247)
(cherry picked from commit 679e93fc3b271fd354a3f616fa48fb6d9746e163)
---
plugins/authproxy/authproxy.cc | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/plugins/authproxy/authproxy.cc b/plugins/authproxy/authproxy.cc
index dd1390c39..791d1000b 100644
--- a/plugins/authproxy/authproxy.cc
+++ b/plugins/authproxy/authproxy.cc
@@ -82,6 +82,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 *);
@@ -129,6 +130,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}};
@@ -543,6 +545,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 */)
{