summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Pokrovsky <dpokrovsky@hotmail.com>2024-06-14 13:48:12 +0300
committerDmitry Pokrovsky <dpokrovsky@hotmail.com>2024-06-14 13:48:12 +0300
commite7a0368462368d2b356eccdd738f776b85b1d4c3 (patch)
treea7da264d2de547d23cc22b157fe81f6b38291b3b
parent635ab1b77b06a8891479a46a0e1ba88315ff3958 (diff)
downloadaccel-ppp-e7a0368462368d2b356eccdd738f776b85b1d4c3.tar.gz
accel-ppp-e7a0368462368d2b356eccdd738f776b85b1d4c3.zip
Revert "1. Fixes the issue #124 "HTTP replay for non SSTP query""
This reverts commit 635ab1b77b06a8891479a46a0e1ba88315ff3958.
-rw-r--r--accel-pppd/ctrl/sstp/sstp.c77
-rw-r--r--accel-pppd/triton/triton.c2
2 files changed, 39 insertions, 40 deletions
diff --git a/accel-pppd/ctrl/sstp/sstp.c b/accel-pppd/ctrl/sstp/sstp.c
index e21a7769..2e2c4d3b 100644
--- a/accel-pppd/ctrl/sstp/sstp.c
+++ b/accel-pppd/ctrl/sstp/sstp.c
@@ -1925,44 +1925,6 @@ static int sstp_handler(struct sstp_conn_t *conn, struct buffer_t *buf)
return 0;
}
-static int sstp_write(struct triton_md_handler_t *h)
-{
- struct sstp_conn_t *conn = container_of(h, typeof(*conn), hnd);
- struct buffer_t *buf;
- int n;
-
- while (!list_empty(&conn->out_queue)) {
- buf = list_first_entry(&conn->out_queue, typeof(*buf), entry);
- while (buf->len) {
- n = conn->stream->write(conn->stream, buf->head, buf->len);
- if (n < 0) {
- if (errno == EINTR)
- continue;
- if (errno == EAGAIN)
- goto defer;
- if (conf_verbose && errno != EPIPE)
- log_ppp_info2("sstp: write: %s\n", strerror(errno));
- goto drop;
- } else if (n == 0)
- goto defer;
- buf_pull(buf, n);
- }
- list_del(&buf->entry);
- free_buf(buf);
- }
-
- triton_md_disable_handler(h, MD_MODE_WRITE);
- return 0;
-
-defer:
- triton_md_enable_handler(h, MD_MODE_WRITE);
- return 0;
-
-drop:
- triton_context_call(&conn->ctx, (triton_event_func)sstp_disconnect, conn);
- return 1;
-}
-
static int sstp_read(struct triton_md_handler_t *h)
{
struct sstp_conn_t *conn = container_of(h, typeof(*conn), hnd);
@@ -1994,7 +1956,6 @@ static int sstp_read(struct triton_md_handler_t *h)
return 0;
drop:
- n = sstp_write(h);
sstp_disconnect(conn);
return 1;
}
@@ -2088,6 +2049,44 @@ drop:
return 1;
}
+static int sstp_write(struct triton_md_handler_t *h)
+{
+ struct sstp_conn_t *conn = container_of(h, typeof(*conn), hnd);
+ struct buffer_t *buf;
+ int n;
+
+ while (!list_empty(&conn->out_queue)) {
+ buf = list_first_entry(&conn->out_queue, typeof(*buf), entry);
+ while (buf->len) {
+ n = conn->stream->write(conn->stream, buf->head, buf->len);
+ if (n < 0) {
+ if (errno == EINTR)
+ continue;
+ if (errno == EAGAIN)
+ goto defer;
+ if (conf_verbose && errno != EPIPE)
+ log_ppp_info2("sstp: write: %s\n", strerror(errno));
+ goto drop;
+ } else if (n == 0)
+ goto defer;
+ buf_pull(buf, n);
+ }
+ list_del(&buf->entry);
+ free_buf(buf);
+ }
+
+ triton_md_disable_handler(h, MD_MODE_WRITE);
+ return 0;
+
+defer:
+ triton_md_enable_handler(h, MD_MODE_WRITE);
+ return 0;
+
+drop:
+ triton_context_call(&conn->ctx, (triton_event_func)sstp_disconnect, conn);
+ return 1;
+}
+
static inline void sstp_queue(struct sstp_conn_t *conn, struct buffer_t *buf)
{
list_add_tail(&buf->entry, &conn->out_queue);
diff --git a/accel-pppd/triton/triton.c b/accel-pppd/triton/triton.c
index 841bd008..395a42df 100644
--- a/accel-pppd/triton/triton.c
+++ b/accel-pppd/triton/triton.c
@@ -55,7 +55,7 @@ static __thread struct triton_context_t *this_ctx;
static __thread jmp_buf jmp_env;
static __thread void *thread_frame;
-//#define log_debug2(fmt, ...)
+#define log_debug2(fmt, ...)
void triton_thread_wakeup(struct _triton_thread_t *thread)
{