Skip to content

Commit c595cc0

Browse files
fixing return codes
1 parent 3bbaccd commit c595cc0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: libraries/lwIpWrapper/src/lwipClient.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ int lwipClient::connect(const char* host, uint16_t port) {
8989
IPAddress remote_addr;
9090

9191
int ret = CLwipIf::getInstance().getHostByName(host, remote_addr); // TODO test this
92-
if (ret == 1) {
92+
if (ret == 0) {
9393
return connect(remote_addr, port);
9494
} else {
9595
return 0;
@@ -287,7 +287,7 @@ size_t lwipClient::write(const uint8_t* buffer, size_t size) {
287287
tcp_output(this->tcp_info->pcb);
288288

289289
arduino::unlock();
290-
return buffer - buffer_cursor;
290+
return buffer_cursor - buffer;
291291
}
292292

293293
int lwipClient::read() {

0 commit comments

Comments
 (0)