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 bdc064d

Browse filesBrowse files
authored
peek() function always return first byte of data
Signed-off-by: patricklaf <patrick.lafarguette@gmail.com>
1 parent 52aba52 commit bdc064d
Copy full SHA for bdc064d

File tree

Expand file treeCollapse file tree

2 files changed

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

2 files changed

+2
-2
lines changed

‎src/EthernetClient.cpp

Copy file name to clipboardExpand all lines: src/EthernetClient.cpp
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ int EthernetClient::peek()
171171
if (!available()) {
172172
return -1;
173173
}
174-
b = pbuf_get_at(_tcp_client->data.p, 0);
174+
b = pbuf_get_at(_tcp_client->data.p, _tcp_client->data.p->tot_len - _tcp_client->data.available);
175175
return b;
176176
}
177177

‎src/EthernetUdp.cpp

Copy file name to clipboardExpand all lines: src/EthernetUdp.cpp
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ int EthernetUDP::peek()
247247
if (!_remaining) {
248248
return -1;
249249
}
250-
b = pbuf_get_at(_udp.data.p, 0);
250+
b = pbuf_get_at(_udp.data.p, _udp.data.p->tot_len - _udp.data.available);
251251
return b;
252252
}
253253

0 commit comments

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