Re: FCGI_FAIL_ACCEPT_ON_INTR

detyh67dftgt <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel,gmane.spam.detected
Message-ID <[email protected]>
code not working please explain me more

I'm not exactly sure what this setting is supposed to do? My code looks
like this:

listen_socket = FCGX_OpenSocket(":9000", 100);
FCGX_Init();
FCGX_InitRequest(&request, listen_socket, 0 /* FCGI_FAIL_ACCEPT_ON_INTR */);
sig_int_flag = 0;

while ((sig_int_flag == 0) && (FCGX_Accept_r(&request) >= 0)) {
  char *content_type;
  FCGX_FPrintF(request.out, "Content-type: %s\r\n\r\n", content_type);
  /* do other stuff */  
  FCGX_Finish_r(&request);
}
 
/* clean up code starts here */
 ....

I have a signal handler that catches SIGTERM and sets sig_int_flag to 1.
Regardless of whether I use the FCGI_FAIL_ACCEPT_ON_INTR setting or not,
the signal is caught but it never breaks out of the loop and executes
the cleanup code. What I want to do is have the loop exit and run the
cleanup code but I am not sure how to do that with or without the
FCGI_FAIL_ACCEPT_ON_INTR setting.



[email protected] wrote:
> 
> I'm not exactly sure what this setting is supposed to do? My code looks
> like this:
> 
> listen_socket = FCGX_OpenSocket(":9000", 100);
> FCGX_Init();
> FCGX_InitRequest(&request, listen_socket, 0 /* FCGI_FAIL_ACCEPT_ON_INTR
> */);
> sig_int_flag = 0;
> 
> while ((sig_int_flag == 0) && (FCGX_Accept_r(&request) >= 0)) {
>   char *content_type;
>   FCGX_FPrintF(request.out, "Content-type: %s\r\n\r\n", content_type);
>   /* do other stuff */  
>   FCGX_Finish_r(&request);
> }
>  
> /* clean up code starts here */
>  ....
> 
> I have a signal handler that catches SIGTERM and sets sig_int_flag to 1.
> Regardless of whether I use the FCGI_FAIL_ACCEPT_ON_INTR setting or not,
> the signal is caught but it never breaks out of the loop and executes
> the cleanup code. What I want to do is have the loop exit and run the
> cleanup code but I am not sure how to do that with or without the
> FCGI_FAIL_ACCEPT_ON_INTR setting.
> 
> r
> ___________________________________
> fastcgi-developers mailing list
> http://fastcgi.com/fastcgi-developers/
> 
> 


-----
Let us get you a  http://www.lowmortgageoffer.com mortgage  quote with
minimal fuss. Our unique  http://www.cheapratemortgage.com/calculator.htm
mortgage calculator  provides all.
-- 
View this message in context: http://www.nabble.com/FCGI_FAIL_ACCEPT_ON_INTR-tf2761584.html#a14191847
Sent from the Perl - Fastcgi-Developers mailing list archive at Nabble.com.

___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.