--- parser3/src/main/pa_websocket.C 2026/10/16 13:55:16 1.1 +++ parser3/src/main/pa_websocket.C 2026/10/17 22:58:09 1.3 @@ -10,7 +10,7 @@ #include "pa_sha1.h" #include "../lib/pcre/pa_pcre_internal.h" -volatile const char * IDENT_PA_WEBSOCKET_C="$Id: pa_websocket.C,v 1.1 2026/10/16 13:55:16 moko Exp $" IDENT_PA_WEBSOCKET_H; +volatile const char * IDENT_PA_WEBSOCKET_C="$Id: pa_websocket.C,v 1.3 2026/10/17 22:58:09 moko Exp $" IDENT_PA_WEBSOCKET_H; #define MAX_CONTROL_PAYLOAD 125 #define MIN_READ_SIZE 4096 @@ -126,7 +126,7 @@ bool WebSocket::fill(int timeout_ms) { int ready; while((ready=pa_sock_ready(connection.sock, false, timeout_ms))<0) { int no=pa_socks_errno(); - if(no==EINTR) + if(pa_socks_is_interrupted(no)) continue; throw Exception("httpd.read", 0, "error waiting for data: %s (%d)", pa_socks_strerr(no), no); } @@ -158,9 +158,9 @@ WebSocket::Parsed WebSocket::parse(Frame if(available<2) return INCOMPLETE; - bool fin=p[0] & 0x80; + bool fin=(p[0] & 0x80)!=0; int opcode=p[0] & 0x0F; - bool masked=p[1] & 0x80; + bool masked=(p[1] & 0x80)!=0; uint64_t length=p[1] & 0x7F; size_t header=2; @@ -322,7 +322,7 @@ void WebSocket::write_frame(int opcode, unsigned char header[10]; size_t header_size=0; - header[header_size++]=0x80 | opcode; + header[header_size++]=(unsigned char)(0x80 | opcode); if(size<126){ header[header_size++]=(unsigned char)size; } else if(size<=0xFFFF){