summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl
diff options
context:
space:
mode:
authorVladislav Grishenko <themiron@mail.ru>2020-08-09 03:20:00 +0500
committerVladislav Grishenko <themiron@mail.ru>2020-08-09 03:20:00 +0500
commit43e39c0c6e7511548c59103145ca7926a0a4cf58 (patch)
treefda07abb62471748ef824b4a80a5b14ed4f5616c /accel-pppd/ctrl
parent8d1f8733b1a202431b0faf91d70f935f65b0cec2 (diff)
downloadaccel-ppp-43e39c0c6e7511548c59103145ca7926a0a4cf58.tar.gz
accel-ppp-43e39c0c6e7511548c59103145ca7926a0a4cf58.zip
sstp: switch to async sending
Diffstat (limited to 'accel-pppd/ctrl')
-rw-r--r--accel-pppd/ctrl/sstp/sstp.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/accel-pppd/ctrl/sstp/sstp.c b/accel-pppd/ctrl/sstp/sstp.c
index 847851c7..b75ab6e0 100644
--- a/accel-pppd/ctrl/sstp/sstp.c
+++ b/accel-pppd/ctrl/sstp/sstp.c
@@ -181,7 +181,6 @@ static mempool_t conn_pool;
static unsigned int stat_starting;
static unsigned int stat_active;
-static int sstp_write(struct triton_md_handler_t *h);
static inline void sstp_queue(struct sstp_conn_t *conn, struct buffer_t *buf);
static int sstp_send(struct sstp_conn_t *conn, struct buffer_t *buf);
static inline void sstp_queue_deferred(struct sstp_conn_t *conn, struct buffer_t *buf);
@@ -1177,7 +1176,9 @@ static int ppp_read(struct triton_md_handler_t *h)
}
#endif
}
- return sstp_write(&conn->hnd);
+ if (!list_empty(&conn->out_queue))
+ triton_md_enable_handler(&conn->hnd, MD_MODE_WRITE);
+ return 0;
drop:
sstp_disconnect(conn);
@@ -1230,7 +1231,8 @@ static inline void ppp_queue(struct sstp_conn_t *conn, struct buffer_t *buf)
static int ppp_send(struct sstp_conn_t *conn, struct buffer_t *buf)
{
ppp_queue(conn, buf);
- return ppp_write(&conn->ppp_hnd) ? -1 : 0;
+ triton_md_enable_handler(&conn->ppp_hnd, MD_MODE_WRITE);
+ return 0;
}
/* sstp */
@@ -2065,7 +2067,8 @@ static inline void sstp_queue(struct sstp_conn_t *conn, struct buffer_t *buf)
static int sstp_send(struct sstp_conn_t *conn, struct buffer_t *buf)
{
sstp_queue(conn, buf);
- return sstp_write(&conn->hnd) ? -1 : 0;
+ triton_md_enable_handler(&conn->hnd, MD_MODE_WRITE);
+ return 0;
}
static void sstp_msg_echo(struct triton_timer_t *t)