zeromq / zbroker

Elastic pipes
Mozilla Public License 2.0
50 stars 11 forks source link

Problem: zpipes_client_read returns ambiguous results #15

Closed rpedde closed 10 years ago

rpedde commented 10 years ago

in zpipes_client.c, zpipes_client_read returns 0 ambiguously.

zpipes_msg_recv returns NULL on both malloc error and on EINTR (blowing the entire message frame, it looks like). Returning a 0 here looks like a graceful pipe shutdown, and should return an error (-1 with errno set to EIO? It's probably not retryable, so EINTR is probably out.)

Same with a timeout condition -- this should return an error as well, so as to distinguish itself from a graceful pipe close.

rpedde commented 10 years ago

I guess this also means zpipes_client_read should return ssize_t.