Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EthernetClient::write returns wrong value when buffer size exceeds W5100.SSIZE #141

Open
rayshobby opened this issue Jul 19, 2020 · 0 comments · May be fixed by #187, #142 or #242
Open

EthernetClient::write returns wrong value when buffer size exceeds W5100.SSIZE #141

rayshobby opened this issue Jul 19, 2020 · 0 comments · May be fixed by #187, #142 or #242
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@rayshobby
Copy link

The return value of EthernetClient::write should be the return value of Ethernet::socketSend:

if (Ethernet.socketSend(sockindex, buf, size)) return size;

Otherwise if the buffer to be sent is larger than W5100.SSIZE it will only send W5100.SSIZE number of characters,
https://github.com/arduino-libraries/Ethernet/blob/master/src/socket.cpp#L428
yet EthernetClient::write still returns 'size'.

A better way to implement EthernetClient::write is to add a loop until the whole content is sent.

@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Feb 22, 2022
@per1234 per1234 linked a pull request Mar 30, 2022 that will close this issue
@per1234 per1234 linked a pull request Nov 23, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
2 participants