Skip to content

Commit ea10d96

Browse files
committed
Fixed the fix - shifting the position increment affects other conditions
1 parent 2ca43be commit ea10d96

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,13 @@ static ssize_t fdget(int s, struct iovec *iov, size_t iovlen, int block,
132132
hdr.msg_iov = vec;
133133
hdr.msg_iovlen = veclen;
134134
ssize_t sz = recvmsg(s, &hdr, 0);
135-
pos += sz;
136-
if(dsock_fast(sz == len)) return pos;
135+
if(dsock_fast(sz == len)) return pos + sz;
137136
if(dsock_slow(sz == 0)) {errno = ECONNRESET; return -1;}
138137
if(dsock_slow(sz < 0 && errno != EWOULDBLOCK && errno != EAGAIN))
139138
return -1;
140139
if(dsock_fast(sz > 0)) {
141140
if(!block) return sz;
141+
pos += sz;
142142
len -= sz;
143143
}
144144
int rc = fdin(s, deadline);

0 commit comments

Comments
 (0)