Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8566fb4

Browse filesBrowse files
Make sure to use HttpClient when upgrading the connection for websockets
Using WebSocketClient::begin I got into problems where `status = responseStatusCode();` would be trying to read the HTTP header, but because both HttpClient and WebSocketClient have a read function, the read from WebSocketClient was used, which returns a bunch of gibberish. This caused the WebSocket to think that the connection was not successfully upgraded.
1 parent 6dc4867 commit 8566fb4
Copy full SHA for 8566fb4

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎src/HttpClient.cpp

Copy file name to clipboardExpand all lines: src/HttpClient.cpp
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ int HttpClient::responseStatusCode()
421421
{
422422
if (available())
423423
{
424-
c = read();
424+
c = HttpClient::read();
425425
if (c != -1)
426426
{
427427
switch(iState)
@@ -762,7 +762,7 @@ int HttpClient::read(uint8_t *buf, size_t size)
762762

763763
int HttpClient::readHeader()
764764
{
765-
char c = read();
765+
char c = HttpClient::read();
766766

767767
if (endOfHeadersReached())
768768
{

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.