X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fwebsock.c;h=c578eba46a714e7667219663083ae3252df96045;hb=9e3afb8aa598f3e69e2c3723335507c12b4cd1f1;hp=e583a49da0f2c6f6564184cf26772ff0a952dfdc;hpb=911df9d068b3e259dcab970ded4132a7397f565f;p=src%2Fapp-framework-binder.git diff --git a/src/websock.c b/src/websock.c index e583a49d..c578eba4 100644 --- a/src/websock.c +++ b/src/websock.c @@ -199,10 +199,10 @@ static int check_control_header(struct websock *ws) return 0; if (FRAME_GET_RSV3(ws->header[0]) != 0) return 0; - if (FRAME_GET_MASK(ws->header[1])) - return 0; if (FRAME_GET_OPCODE(ws->header[0]) == OPCODE_CLOSE) return FRAME_GET_PAYLOAD_LEN(ws->header[1]) != 1; + if (FRAME_GET_MASK(ws->header[1])) + return 0; return FRAME_GET_PAYLOAD_LEN(ws->header[1]) == 0; } @@ -346,7 +346,7 @@ loop: (size_t) ws->length); else ws->itf->on_close(ws->closure, - WEBSOCKET_CODE_UNSET, 0); + WEBSOCKET_CODE_NOT_SET, 0); ws->itf->disconnect(ws->closure); return 0; default: