if (t.tv_sec > 30*60)
mainlog_close();
else
- {
- fd_set r;
- FD_ZERO(&r); FD_SET(0, &r);
- t.tv_sec = 30*60 - t.tv_sec; t.tv_usec = 0;
- if (select(1, &r, NULL, NULL, &t) == 0) mainlog_close();
- }
+ if (poll_one_fd(0, POLLIN, (30*60 - t.tv_sec) * 1000) == 0)
+ mainlog_close();
}
}
/* Before sending an SMTP response in a TCP/IP session, we check to see if the
connection has gone away. This can only be done if there is no unconsumed input
waiting in the local input buffer. We can test for this by calling
-receive_smtp_buffered(). RFC 2920 (pipelining) explicitly allows for additional
+receive_hasc(). RFC 2920 (pipelining) explicitly allows for additional
input to be sent following the final dot, so the presence of following input is
not an error.
connection will vanish between the time of this test and the sending of the
response, but the chance of this happening should be small. */
-if (smtp_input && sender_host_address && !f.sender_host_notsocket &&
- !receive_smtp_buffered())
+if ( smtp_input && sender_host_address && !f.sender_host_notsocket
+ && !receive_hasc())
{
- struct timeval tv = {.tv_sec = 0, .tv_usec = 0};
- fd_set select_check;
- FD_ZERO(&select_check);
- FD_SET(fileno(smtp_in), &select_check);
-
- if (select(fileno(smtp_in) + 1, &select_check, NULL, NULL, &tv) != 0)
+ if (poll_one_fd(fileno(smtp_in), POLLIN, 0) != 0)
{
int c = (receive_getc)(GETC_BUFFER_UNLIMITED);
if (c != EOF) (receive_ungetc)(c); else
the socket. */
smtp_printf("250- %u byte chunk, total %d\r\n250 OK id=%s\r\n",
- receive_smtp_buffered(),
+ receive_hasc(),
chunking_datasize, message_size+message_linecount, message_id);
chunking_state = CHUNKING_OFFERED;
}
else
- smtp_printf("250 OK id=%s\r\n", receive_smtp_buffered(), message_id);
+ smtp_printf("250 OK id=%s\r\n", receive_hasc(), message_id);
if (host_checking)
fprintf(stdout,