fix transmitting large mails through POP

Signed-off-by: AGentooCat <agentoocat@mail.i2p>
This commit is contained in:
2025-06-09 21:19:03 +00:00
parent da41bd74ad
commit b744ea0337
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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; \