Re: [Exim] timeout - smtp_receive_timeout ?

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Philip Hazel
Data:  
Para: Bernard Stern
CC: exim-users
Asunto: Re: [Exim] timeout - smtp_receive_timeout ?
On Thu, 16 Dec 1999, Bernard Stern wrote:

> Now I don't type anything, expecting myhost to close down the connection
> after the time configured in smtp_receive_timeout, which is 60s.
> However, the connection remains eternally (well I'm not really sure wether
> it's actually that long) open.


I have found the bug. It was, as most bugs are, a stupid oversight on my
part. Sorry about that. Patch attached. Please let me know if it fixes
the problem for you.

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.



*** exim-3.12/src/smtp_in.c Wed Dec  8 09:57:09 1999
--- smtp_in.c    Thu Dec 16 16:05:56 1999
***************
*** 624,639 ****


  smtp_reset(reset_point);                /* Reset for start of message */


! /* Deal with SMTP commands. The reading routine sets up a timeout
! for each one. If the timeout happens, or we get SIGTERM, exim just
! gives up and dies. */

- os_non_restarting_signal(SIGALRM, command_timeout_handler);
- signal(SIGTERM, command_sigterm_handler);
- 
- /* This loop is exited by setting done to a POSITIVE value. The values
- are 2 larger than the required yield of the function. */
- 
  while (done <= 0)
    {
    char *errmess;
--- 624,632 ----


  smtp_reset(reset_point);                /* Reset for start of message */


! /* Deal with SMTP commands. This loop is exited by setting done to a POSITIVE
! value. The values are 2 larger than the required yield of the function. */

  while (done <= 0)
    {
    char *errmess;
***************
*** 640,645 ****
--- 633,647 ----
    char *receiver = NULL;
    int errcode, start, end, sender_domain, receiver_domain;


+   /* The reading routine sets up a timeout for each one actual read from the
+   input (which may contain more than one command). We reset the handlers each
+   time in case they got changed as a result of some processing for the previous
+   command. If the timeout happens, or we get SIGTERM, Exim just gives up and
+   dies. */
+ 
+   os_non_restarting_signal(SIGALRM, command_timeout_handler);
+   signal(SIGTERM, command_sigterm_handler);
+ 
    switch(smtp_read_command())
      {
      /* The HELO/EHLO commands set sender_address_helo if they have
***************
*** 1540,1555 ****


if (smtp_batched_input) return smtp_setup_batch_msg();

! /* Now deal with SMTP commands. The reading routine sets up a timeout
! for each one. If the timeout happens, or we get SIGTERM, exim just
! gives up and dies. */

- os_non_restarting_signal(SIGALRM, command_timeout_handler);
- signal(SIGTERM, command_sigterm_handler);
- 
- /* This loop is exited by setting done to a POSITIVE value. The values
- are 2 larger than the required yield of the function. */
- 
  while (done <= 0)
    {
    char **argv;
--- 1542,1550 ----


if (smtp_batched_input) return smtp_setup_batch_msg();

! /* Deal with SMTP commands. This loop is exited by setting done to a POSITIVE
! value. The values are 2 larger than the required yield of the function. */

  while (done <= 0)
    {
    char **argv;
***************
*** 1576,1581 ****
--- 1571,1585 ----
    int c;
    #endif


+   /* The reading routine sets up a timeout for each one actual read from the
+   input (which may contain more than one command). We reset the handlers each
+   time in case they got changed as a result of some processing for the previous
+   command. If the timeout happens, or we get SIGTERM, Exim just gives up and
+   dies. */
+ 
+   os_non_restarting_signal(SIGALRM, command_timeout_handler);
+   signal(SIGTERM, command_sigterm_handler);
+ 
    switch(smtp_read_command())
      {
      /* The AUTH command is not permitted to occur inside a transaction, and may