@@ -21,12 +21,12 @@ extern "C" {
21
21
static const char * LOG_TAG = " WebSocket" ;
22
22
23
23
// WebSocket op codes as found in a WebSocket frame.
24
- static const int OPCODE_CONTINUE = 0x00 ;
25
- static const int OPCODE_TEXT = 0x01 ;
26
- static const int OPCODE_BINARY = 0x02 ;
27
- static const int OPCODE_CLOSE = 0x08 ;
28
- static const int OPCODE_PING = 0x09 ;
29
- static const int OPCODE_PONG = 0x0a ;
24
+ static const uint8_t OPCODE_CONTINUE = 0x00 ;
25
+ static const uint8_t OPCODE_TEXT = 0x01 ;
26
+ static const uint8_t OPCODE_BINARY = 0x02 ;
27
+ static const uint8_t OPCODE_CLOSE = 0x08 ;
28
+ static const uint8_t OPCODE_PING = 0x09 ;
29
+ static const uint8_t OPCODE_PONG = 0x0a ;
30
30
31
31
32
32
// Structure definition for the WebSocket frame.
@@ -119,7 +119,7 @@ class WebSocketReader: public Task {
119
119
break ;
120
120
}
121
121
ESP_LOGD (" WebSocketReader" , " Waiting on socket data for socket %s" , peerSocket.toString ().c_str ());
122
- int length = peerSocket.receive ((uint8_t *)&frame, sizeof (frame), true ); // Read exact
122
+ size_t length = peerSocket.receive ((uint8_t *)&frame, sizeof (frame), true ); // Read exact
123
123
if (length != sizeof (frame)) {
124
124
ESP_LOGD (LOG_TAG, " Socket read error" );
125
125
pWebSocket->close ();
@@ -476,7 +476,7 @@ WebSocketInputStreambuf::int_type WebSocketInputStreambuf::underflow() {
476
476
// We wish to refill the buffer. We want to read data from the socket. We want to read either
477
477
// the size of the buffer to fill it or the maximum number of bytes remaining to be read.
478
478
// We will choose which ever is smaller as the number of bytes to read into the buffer.
479
- int remainingBytes = getRecordSize ()-m_sizeRead;
479
+ size_t remainingBytes = getRecordSize ()-m_sizeRead;
480
480
size_t sizeToRead;
481
481
if (remainingBytes < m_bufferSize) {
482
482
sizeToRead = remainingBytes;
@@ -485,7 +485,7 @@ WebSocketInputStreambuf::int_type WebSocketInputStreambuf::underflow() {
485
485
}
486
486
487
487
ESP_LOGD (" WebSocketInputRecordStreambuf" , " - getting next buffer of data; size request: %d" , sizeToRead);
488
- int bytesRead = m_socket.receive ((uint8_t *)m_buffer, sizeToRead, true );
488
+ size_t bytesRead = m_socket.receive ((uint8_t *)m_buffer, sizeToRead, true );
489
489
if (bytesRead == 0 ) {
490
490
ESP_LOGD (" WebSocketInputRecordStreambuf" , " << underflow: Read 0 bytes" );
491
491
return EOF;
0 commit comments