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 fffb35a

Browse filesBrowse files
lucasssvazNPaolini
andcommitted
fix(network): Avoid returning zero if connection is not dropped
Co-authored-by: NPaolini <75562717+NPaolini@users.noreply.github.com>
1 parent 3dd4b0d commit fffb35a
Copy full SHA for fffb35a

File tree

1 file changed

+1
-1
lines changed
Filter options

1 file changed

+1
-1
lines changed

‎libraries/Network/src/NetworkClient.cpp

Copy file name to clipboardExpand all lines: libraries/Network/src/NetworkClient.cpp
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ uint8_t NetworkClient::connected() {
549549
}
550550
if (_connected) {
551551
uint8_t dummy;
552-
int res = recv(fd(), &dummy, 0, MSG_DONTWAIT);
552+
int res = recv(fd(), &dummy, 1, MSG_DONTWAIT | MSG_PEEK);
553553
// avoid unused var warning by gcc
554554
(void)res;
555555
// recv only sets errno if res is <= 0

0 commit comments

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