On Sep 1, 2009, at 4:46 AM, [email protected] wrote:

What do the following two statements mean?

    signal(SIGALRM, quitNow);
    alarm(120); /* Don't freeze */
It will make the else branch quit execution, won't it?

If so, the child process will return right away and the following code will not be executed. That is what I observed.

the child will quit if not able to provide a reply within 2 minutes

Luca


--Xinan


--- On Mon, 8/31/09, Luca Deri <[email protected]> wrote:

From: Luca Deri <[email protected]>
Subject: Re: [Ntop-dev] "Utility: Data Dump is broken"
To: [email protected], [email protected]
Date: Monday, August 31, 2009, 3:45 PM


On Aug 26, 2009, at 9:18 PM, [email protected] wrote:

> After several-day hacking, I finally make the Data Dump working again. The version based is 3.3.10.
>
> First, here is deadcode in http.c starting at line 2681, the parent will return(0) in the then branch and the child will quit (signal(SIGALRM, quitNow)) in the else branch. Therefore, the nested strncasecmp() after that will NEVER be executed, and thus actual function of CONST_DUMP_DATA_HTML will not be executed.
>
> What is the purpose to have such kind of dead code?

I don't see any dead code. Can you please explain?

Luca

>
> Thanks
>
> --Xinan
>
>
>
> -----------------
> else {
>         *usedFork = 1;
>         /* This is zero in the parent copy of the structure */
>         if(myGlobals.childntoppid) {
>           /* father process */
>           myGlobals.numChildren++;
>           compressFile = 0;
>           if(domainNameParm != NULL) free(domainNameParm);
>           if(db_key != NULL) free(db_key);
>           if(db_val != NULL) free(db_val);
>           return(0);
>         } else {
>           detachFromTerminalUnderUnix(0);
>           /* Close inherited sockets */
> #ifdef HAVE_OPENSSL
> if(myGlobals.sslInitialized) closeNwSocket (&myGlobals.sock_ssl);
> #endif /* HAVE_OPENSSL */
> if(myGlobals.runningPref.webPort > 0) closeNwSocket (&myGlobals.sock); > //!#if defined(HAVE_ALARM) && defined(PARM_FORK_CHILD_PROCESS) && (!defined(WIN32))
>           signal(SIGALRM, quitNow);
>           alarm(120); /* Don't freeze */
>         }
>       }
> --------------------------------------------------
> _______________________________________________
> Ntop-dev mailing list
> [email protected]
> http://listgateway.unipi.it/mailman/listinfo/ntop-dev


_______________________________________________
Ntop-dev mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev

Reply via email to