Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/net_ws.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,13 @@ static ssize_t read_ws_payloadlen_short(struct mosquitto *mosq)
}

mosq->wsd.mask = (hbuf & 0x80) >> 7;
if(mosq->wsd.mask == 0){
/* RFC 6455 5.1: a server MUST close the connection on receipt of a frame
* that is not masked. */
mosq->wsd.disconnect_reason = 0xEA;
errno = EPROTO;
return -1;
}
plen = hbuf & 0x7F;

if(plen == 126){
Expand Down
3 changes: 2 additions & 1 deletion src/session_expiry.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ void session_expiry__check(void)
last_check = db.now_real_s;

DL_FOREACH_SAFE(expiry_list, item, tmp){
if(item->context->session_expiry_time < db.now_real_s){
if(item->context->session_expiry_time < db.now_real_s
&& item->context->bridge == NULL){ /* Outgoing bridge connections never expire */

context = item->context;
session_expiry__remove(context);
Expand Down