fix transmitting large mails through POP
Signed-off-by: AGentooCat <agentoocat@mail.i2p>
This commit is contained in:
@ -296,7 +296,7 @@ int pop_line(struct lineconn_t *hand) {
|
||||
freemail(&mail);
|
||||
return -1;
|
||||
}
|
||||
if (write(hand->fd, mail.lines, mail.size) < mail.size)
|
||||
if (xwrite(hand->fd, mail.lines, mail.size) < mail.size)
|
||||
return -1;
|
||||
// the ending dot-crlf comes from database
|
||||
freemail(&mail);
|
||||
|
@ -41,7 +41,7 @@ void strip_crlf(const char *text) {
|
||||
size_t rem = len; \
|
||||
while (rem > 0) { \
|
||||
ret = func(fd, &line[len - rem], rem); \
|
||||
if (ret < 0 && errno != EINTR) return ret; \
|
||||
if (ret < 0 && errno != EINTR && errno != EAGAIN && errno != EWOULDBLOCK) return ret; \
|
||||
if (ret > 0) rem -= ret; \
|
||||
} \
|
||||
return len; \
|
||||
|
Reference in New Issue
Block a user