Skip to content

Commit 98d20b0

Browse files
committed
gui: don't error on conn close, properly reset http stage
1 parent 1326424 commit 98d20b0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/waltz/http/fd_http_server.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,10 +1099,14 @@ fd_http_server_ws_send( fd_http_server_t * http,
10991099
and any connections that were previously using that allotted space
11001100
are closed. There is a small chance that ws_conn_id is one of
11011101
those connections, and has therefore already been closed. */
1102-
if( FD_LIKELY( http->pollfds[ http->max_conns+ws_conn_id ].fd==-1 ) ) return -1;
1102+
if( FD_LIKELY( http->pollfds[ http->max_conns+ws_conn_id ].fd==-1 ) ) {
1103+
http->stage_len = 0;
1104+
return 0;
1105+
}
11031106

11041107
if( FD_UNLIKELY( conn->send_frame_cnt==http->max_ws_send_frame_cnt ) ) {
11051108
close_conn( http, ws_conn_id+http->max_conns, FD_HTTP_SERVER_CONNECTION_CLOSE_WS_CLIENT_TOO_SLOW );
1109+
http->stage_len = 0;
11061110
return 0;
11071111
}
11081112

0 commit comments

Comments
 (0)