summaryrefslogtreecommitdiff
path: root/res/res_http_websocket.c
diff options
context:
space:
mode:
authorAlexander Traud <pabstraud@compuserve.com>2018-01-06 08:42:51 +0100
committerAlexander Traud <pabstraud@compuserve.com>2018-01-06 22:14:50 +0100
commit9865e689d2769b38624b01275a4391aa73cba3dd (patch)
treee130d89a2ef7c16d629777218c58983294e5ce5f /res/res_http_websocket.c
parentb8271826b358afd887f9476201fb7fdf12b7119c (diff)
General: Avoid implicit conversion to char when changes value to negative.
clang 5.0 warned about this. ASTERISK-27557 Change-Id: I7cceaa88e147cbdf81a3a7beec5c1c20210fa41e
Diffstat (limited to 'res/res_http_websocket.c')
-rw-r--r--res/res_http_websocket.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/res/res_http_websocket.c b/res/res_http_websocket.c
index a65fc8ae2..956c52c54 100644
--- a/res/res_http_websocket.c
+++ b/res/res_http_websocket.c
@@ -291,6 +291,7 @@ int AST_OPTIONAL_API_NAME(ast_websocket_server_remove_protocol)(struct ast_webso
/*! \brief Close function for websocket session */
int AST_OPTIONAL_API_NAME(ast_websocket_close)(struct ast_websocket *session, uint16_t reason)
{
+ enum ast_websocket_opcode opcode = AST_WEBSOCKET_OPCODE_CLOSE;
char frame[4] = { 0, }; /* The header is 2 bytes and the reason code takes up another 2 bytes */
int res;
@@ -298,7 +299,7 @@ int AST_OPTIONAL_API_NAME(ast_websocket_close)(struct ast_websocket *session, ui
return 0;
}
- frame[0] = AST_WEBSOCKET_OPCODE_CLOSE | 0x80;
+ frame[0] = opcode | 0x80;
frame[1] = 2; /* The reason code is always 2 bytes */
/* If no reason has been specified assume 1000 which is normal closure */