File lnanosmtp.c changed (mode: 100644) (index a5feff9..705d1fe) |
... |
... |
static u8 cnx_sock_send_wait(void) |
223 |
223 |
#undef byte_shift |
#undef byte_shift |
224 |
224 |
|
|
225 |
225 |
#define CNX_SOCK_SEND_LINE_FAILURE -1 |
#define CNX_SOCK_SEND_LINE_FAILURE -1 |
226 |
|
static sl cnx_sock_send_line(u64 sz) |
|
|
226 |
|
static sl cnx_sock_send_line(ul offset, u64 sz) |
227 |
227 |
{ |
{ |
228 |
228 |
sl bytes_sent_n; |
sl bytes_sent_n; |
229 |
229 |
|
|
|
... |
... |
static sl cnx_sock_send_line(u64 sz) |
234 |
234 |
options? |
options? |
235 |
235 |
This is TCP, not UDP. |
This is TCP, not UDP. |
236 |
236 |
*/ |
*/ |
237 |
|
bytes_sent_n = write(cnx_sock, &cmd_resp_line[0], sz); |
|
|
237 |
|
bytes_sent_n = write(cnx_sock, &cmd_resp_line[0] + offset, sz); |
238 |
238 |
if (bytes_sent_n != -EINTR) { |
if (bytes_sent_n != -EINTR) { |
239 |
239 |
if (ISERR(bytes_sent_n)) |
if (ISERR(bytes_sent_n)) |
240 |
240 |
bytes_sent_n = CNX_SOCK_SEND_LINE_FAILURE; |
bytes_sent_n = CNX_SOCK_SEND_LINE_FAILURE; |
|
... |
... |
static void maildir_uniq_build(void) |
535 |
535 |
|
|
536 |
536 |
static u8 smtp_line_send(u64 line_sz) |
static u8 smtp_line_send(u64 line_sz) |
537 |
537 |
{ |
{ |
|
538 |
|
ul offset; /* pointer size arithmetics */ |
|
539 |
|
|
|
540 |
|
offset = 0; |
|
541 |
|
|
538 |
542 |
loop { |
loop { |
539 |
543 |
u8 r; |
u8 r; |
540 |
544 |
sl bytes_sent_n; |
sl bytes_sent_n; |
|
... |
... |
static u8 smtp_line_send(u64 line_sz) |
543 |
547 |
if (r == CNX_SOCK_SEND_WAIT_FAILURE) |
if (r == CNX_SOCK_SEND_WAIT_FAILURE) |
544 |
548 |
return SMTP_CLOSE; |
return SMTP_CLOSE; |
545 |
549 |
|
|
546 |
|
bytes_sent_n = cnx_sock_send_line(line_sz); |
|
|
550 |
|
bytes_sent_n = cnx_sock_send_line(offset, line_sz); |
547 |
551 |
if (bytes_sent_n == CNX_SOCK_SEND_LINE_FAILURE |
if (bytes_sent_n == CNX_SOCK_SEND_LINE_FAILURE |
548 |
552 |
|| bytes_sent_n == 0) |
|| bytes_sent_n == 0) |
549 |
553 |
break;/* 0 means the connection was closed */ |
break;/* 0 means the connection was closed */ |
|
... |
... |
static u8 smtp_line_send(u64 line_sz) |
552 |
556 |
|
|
553 |
557 |
if (line_sz == 0) |
if (line_sz == 0) |
554 |
558 |
return SUCCESS; /* the line was sent */ |
return SUCCESS; /* the line was sent */ |
|
559 |
|
|
|
560 |
|
offset += (ul)bytes_sent_n; |
555 |
561 |
} |
} |
556 |
562 |
return SMTP_CLOSE; |
return SMTP_CLOSE; |
557 |
563 |
} |
} |