mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
wsockd: try to flush ircd-side recvq when we call close_conn()
this is so that a websocket client may receive it's ERROR message if available
This commit is contained in:
parent
7428c4e07e
commit
c3780ae27f
1 changed files with 4 additions and 0 deletions
|
@ -181,6 +181,7 @@ strcasestr(const char *s, const char *find)
|
|||
static void close_conn(conn_t * conn, int wait_plain, const char *fmt, ...);
|
||||
static void conn_mod_read_cb(rb_fde_t *fd, void *data);
|
||||
static void conn_plain_read_cb(rb_fde_t *fd, void *data);
|
||||
static void conn_plain_process_recvq(conn_t *conn);
|
||||
|
||||
#define FLAG_CORK 0x01
|
||||
#define FLAG_DEAD 0x02
|
||||
|
@ -459,6 +460,9 @@ close_conn(conn_t * conn, int wait_plain, const char *fmt, ...)
|
|||
if(IsDead(conn))
|
||||
return;
|
||||
|
||||
if (IsKeyed(conn))
|
||||
conn_plain_process_recvq(conn);
|
||||
|
||||
rb_rawbuf_flush(conn->modbuf_out, conn->mod_fd);
|
||||
rb_linebuf_flush(conn->plain_fd, &conn->plainbuf_out);
|
||||
rb_close(conn->mod_fd);
|
||||
|
|
Loading…
Reference in a new issue