Skip to content

Commit

Permalink
fixing counter overflow in tcp send
Browse files Browse the repository at this point in the history
  • Loading branch information
andreagilardoni committed Jan 24, 2024
1 parent ee01ce7 commit 610c14c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/lwIpWrapper/src/lwipClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ size_t lwipClient::write(const uint8_t* buffer, size_t size) {
arduino::lock();

uint8_t* buffer_cursor = (uint8_t*)buffer;
uint8_t bytes_to_send = 0;
uint16_t bytes_to_send = 0;

do {
bytes_to_send = min(size - (buffer - buffer_cursor), tcp_sndbuf(this->tcp_info->pcb));
Expand All @@ -282,7 +282,7 @@ size_t lwipClient::write(const uint8_t* buffer, size_t size) {
} else if(res == ERR_MEM) {
// FIXME handle this: we get into this case only if the sent data cannot be put in the send queue
}
} while(buffer_cursor < buffer + size);
} while(buffer_cursor - buffer < size);

tcp_output(this->tcp_info->pcb);

Expand Down

0 comments on commit 610c14c

Please sign in to comment.