[asterisk-commits] kharwell: branch 11 r431669 - /branches/11/res/res_http_websocket.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Feb 11 10:46:16 CST 2015
Author: kharwell
Date: Wed Feb 11 10:46:12 2015
New Revision: 431669
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=431669
Log:
res_http_websocket: websocket write timeout fails to fully disconnect
When writing to a websocket if a timeout occurred the underlying socket did not
get closed/disconnected. This patch makes sure the websocket gets disconnected
on a write timeout.
ASTERISK-24701 #close
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/4412/
Modified:
branches/11/res/res_http_websocket.c
Modified: branches/11/res/res_http_websocket.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/res/res_http_websocket.c?view=diff&rev=431669&r1=431668&r2=431669
==============================================================================
--- branches/11/res/res_http_websocket.c (original)
+++ branches/11/res/res_http_websocket.c Wed Feb 11 10:46:12 2015
@@ -255,11 +255,15 @@
if (ast_careful_fwrite(session->f, session->fd, frame, header_size, session->timeout)) {
ao2_unlock(session);
+ /* 1011 - server terminating connection due to not being able to fulfill the request */
+ ast_websocket_close(session, 1011);
return -1;
}
if (ast_careful_fwrite(session->f, session->fd, payload, actual_length, session->timeout)) {
ao2_unlock(session);
+ /* 1011 - server terminating connection due to not being able to fulfill the request */
+ ast_websocket_close(session, 1011);
return -1;
}
fflush(session->f);
More information about the asterisk-commits
mailing list