From 9296f1db314d172f96a25f7d804347b5c5eb3de7 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Mon, 10 Oct 2011 11:49:50 -0400 Subject: [PATCH] Fixing bug in Ethernet (recv() in socket.cpp). (Paul Stoffregen) http://code.google.com/p/arduino/issues/detail?id=670 --- libraries/Ethernet/utility/socket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Ethernet/utility/socket.cpp b/libraries/Ethernet/utility/socket.cpp index f717c0fcb..03ff8504c 100644 --- a/libraries/Ethernet/utility/socket.cpp +++ b/libraries/Ethernet/utility/socket.cpp @@ -151,7 +151,7 @@ uint16_t recv(SOCKET s, uint8_t *buf, uint16_t len) { // No data available. uint8_t status = W5100.readSnSR(s); - if ( s == SnSR::LISTEN || s == SnSR::CLOSED || s == SnSR::CLOSE_WAIT ) + if ( status == SnSR::LISTEN || status == SnSR::CLOSED || status == SnSR::CLOSE_WAIT ) { // The remote end has closed its side of the connection, so this is the eof state ret = 0;