[
https://issues.apache.org/jira/browse/PROTON-1165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Justin Ross updated PROTON-1165:
--------------------------------
Fix Version/s: 0.14.0
> qpid proton cpp binding posix/io.cpp tests wrong error condition
> ----------------------------------------------------------------
>
> Key: PROTON-1165
> URL: https://issues.apache.org/jira/browse/PROTON-1165
> Project: Qpid Proton
> Issue Type: Bug
> Components: cpp-binding
> Affects Versions: 0.12.0
> Environment: linux/posix
> Reporter: Roman Puls
> Assignee: Cliff Jansen
> Labels: patch
> Fix For: 0.14.0
>
>
> posix/io.cpp:
> size_t socket_engine::io_write(const char *buf, size_t size) {
> ssize_t n = ::write(socket_, buf, size);
> if (n == EAGAIN || n == EWOULDBLOCK) return 0;
> if (n < 0) check(n, "write: ");
> return n;
> }
> instead of testing n against EAGAIN/EWOULDBLOCK, n needs to be tested against
> -1 and then errno needs to be compared to EAGAIN/EWOULDBLOCK
> proposed fix:
> size_t socket_engine::io_write(const char *buf, size_t size) {
> ssize_t n = ::write(socket_, buf, size);
> if (n < 0) {
> if (errno == EAGAIN || errno == EWOULDBLOCK) {
> return 0;
> }
> check(n, "write: ");
> }
> return n;
> }
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]