Skip to content

Commit cc8310f

Browse files
patricklaffpistm
authored andcommitted
peek() function always return first byte of data
Signed-off-by: patricklaf <[email protected]>
1 parent 055af9a commit cc8310f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/EthernetClient.cpp

Lines 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

Lines 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)