Skip to content

Commit

Permalink
properly parse WS socket
Browse files Browse the repository at this point in the history
Credits go to Eric Tamme for reporting this
  • Loading branch information
razvancrainea committed Mar 10, 2015
1 parent 43eaaac commit d080bcc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions socket_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ inline static int parse_proto(unsigned char* s, long len, int* proto)
*proto=PROTO_SCTP; return 0;
}
break;
case PROTO2UINT('w', 's', '\0'):
if(len==2) { *proto=PROTO_WS; return 0; }
break;

default:
if(len==2 && (s[0]|0x20)=='w' && (s[1]|0x20)=='s') {
*proto=PROTO_WS; return 0;
}
return -1;
}
return -1;
Expand Down

0 comments on commit d080bcc

Please sign in to comment.