summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorJenkins2 <jenkins2@gerrit.asterisk.org>2018-01-08 06:51:40 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2018-01-08 06:51:40 -0600
commit94e7a7675b6f38d3d11bb04c5336a3278376fc41 (patch)
tree00653f24e81b25501f0c9f9beb265fe4207d87bd /res
parent9c746dc55e20d85eab7feb4a4e889df8de5f46b6 (diff)
parentf84fcc1fc18604f6989636adb8d06ec8d38aed17 (diff)
Merge "General: Avoid implicit conversion to char when changes value to negative."
Diffstat (limited to 'res')
-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 baaa40fd9..86a154787 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 */