[asterisk-commits] dlee: trunk r376562 - in /trunk: ./ res/res_http_websocket.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Nov 20 16:06:08 CST 2012
Author: dlee
Date: Tue Nov 20 16:06:05 2012
New Revision: 376562
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=376562
Log:
Added missing newlines to websocket ast_logs.
Without these newlines, log messages just continue tacking onto the same
line, and do not flush immediately.
........
Merged revisions 376561 from http://svn.asterisk.org/svn/asterisk/branches/11
Modified:
trunk/ (props changed)
trunk/res/res_http_websocket.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.
Modified: trunk/res/res_http_websocket.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_http_websocket.c?view=diff&rev=376562&r1=376561&r2=376562
==============================================================================
--- trunk/res/res_http_websocket.c (original)
+++ trunk/res/res_http_websocket.c Tue Nov 20 16:06:05 2012
@@ -503,12 +503,12 @@
/* If this is not a websocket upgrade abort */
if (!upgrade || strcasecmp(upgrade, "websocket")) {
- ast_log(LOG_WARNING, "WebSocket connection from '%s' could not be accepted - did not request WebSocket",
+ ast_log(LOG_WARNING, "WebSocket connection from '%s' could not be accepted - did not request WebSocket\n",
ast_sockaddr_stringify(&ser->remote_address));
ast_http_error(ser, 426, "Upgrade Required", NULL);
return -1;
} else if (ast_strlen_zero(requested_protocols)) {
- ast_log(LOG_WARNING, "WebSocket connection from '%s' could not be accepted - no protocols requested",
+ ast_log(LOG_WARNING, "WebSocket connection from '%s' could not be accepted - no protocols requested\n",
ast_sockaddr_stringify(&ser->remote_address));
fputs("HTTP/1.1 400 Bad Request\r\n"
"Sec-WebSocket-Version: 7, 8, 13\r\n\r\n", ser->f);
@@ -516,7 +516,7 @@
} else if (key1 && key2) {
/* Specification defined in http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76 and
* http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-00 -- not currently supported*/
- ast_log(LOG_WARNING, "WebSocket connection from '%s' could not be accepted - unsupported version '00/76' chosen",
+ ast_log(LOG_WARNING, "WebSocket connection from '%s' could not be accepted - unsupported version '00/76' chosen\n",
ast_sockaddr_stringify(&ser->remote_address));
fputs("HTTP/1.1 400 Bad Request\r\n"
"Sec-WebSocket-Version: 7, 8, 13\r\n\r\n", ser->f);
@@ -548,7 +548,7 @@
uint8_t sha[20];
if (!(session = ao2_alloc(sizeof(*session), session_destroy_fn))) {
- ast_log(LOG_WARNING, "WebSocket connection from '%s' could not be accepted",
+ ast_log(LOG_WARNING, "WebSocket connection from '%s' could not be accepted\n",
ast_sockaddr_stringify(&ser->remote_address));
fputs("HTTP/1.1 400 Bad Request\r\n"
"Sec-WebSocket-Version: 7, 8, 13\r\n\r\n", ser->f);
@@ -571,7 +571,7 @@
} else {
/* Specification defined in http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-75 or completely unknown */
- ast_log(LOG_WARNING, "WebSocket connection from '%s' could not be accepted - unsupported version '%d' chosen",
+ ast_log(LOG_WARNING, "WebSocket connection from '%s' could not be accepted - unsupported version '%d' chosen\n",
ast_sockaddr_stringify(&ser->remote_address), version ? version : 75);
fputs("HTTP/1.1 400 Bad Request\r\n"
"Sec-WebSocket-Version: 7, 8, 13\r\n\r\n", ser->f);
@@ -581,7 +581,7 @@
/* Enable keepalive on all sessions so the underlying user does not have to */
if (setsockopt(ser->fd, SOL_SOCKET, SO_KEEPALIVE, &flags, sizeof(flags))) {
- ast_log(LOG_WARNING, "WebSocket connection from '%s' could not be accepted - failed to enable keepalive",
+ ast_log(LOG_WARNING, "WebSocket connection from '%s' could not be accepted - failed to enable keepalive\n",
ast_sockaddr_stringify(&ser->remote_address));
fputs("HTTP/1.1 400 Bad Request\r\n"
"Sec-WebSocket-Version: 7, 8, 13\r\n\r\n", ser->f);
More information about the asterisk-commits
mailing list