Skip to content

Commit

Permalink
Merge pull request #4 from Zewo/fdpatch
Browse files Browse the repository at this point in the history
Fix partial reads
  • Loading branch information
paulofaria authored Sep 22, 2017
2 parents 30b7cdd + 25cb095 commit e675989
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ ssize_t fd_recv(int s, struct fd_rxbuf *rxbuf, struct iolist *first,
if(errno == EPIPE) errno = ECONNRESET;
return -1;
}
/* If we have read data return it immediately */
if (read > 0) return read;
/* Wait for more data. */
int rc = fdin(s, deadline);
if(dill_slow(rc < 0)) return -1;
Expand Down

0 comments on commit e675989

Please sign in to comment.