[Libwebsockets] Code in dumb_increment receive section

Andy Green andy at warmcat.com
Tue May 15 20:50:50 CEST 2018



On May 15, 2018 10:17:42 PM GMT+08:00, jon at keyonsec.com wrote:
>Hi Andy/all,
>
> 
>
>Is there any significance to the following code in the dumb_increment
>receive callback?
>
> 
>
>      case LWS_CALLBACK_RECEIVE:
>
>            if (len < 6)
>
>                  break;
>
> 
>
> 
>
>I'm thinking maybe you put it there to debug or protect against some
>unwanted response from the client at some point. I have removed it from
>my
>code and don't see any issues w/it but just want to be sure. Please
>advise.

On v3 it proceeds to do some memcmp() on the data that came for that particular protocol.  They are 6 bytes or bigger.

It's just cruft now by the look of it.

-Andy

>
>Thanks, 
>
>Jon



More information about the Libwebsockets mailing list