I'm missing the problem... declaring a constant at the beginning of a block
is perfectly legal:

  if((rc = checkURLsecurity(requestedURL)) != 0) {
    traceEvent(CONST_TRACE_ERROR, "URL security: '%s' rejected
(code=%d)(client=%s)",
               requestedURL, rc, _intoa(from, tmpStr, sizeof(tmpStr)));

#if defined(MAX_NUM_BAD_IP_ADDRESSES) && (MAX_NUM_BAD_IP_ADDRESSES > 0)
  {
   /* Note if the size of the table is zero, we simply nullify all of this
      code (why bother wasting the work effort
          Burton M. Strauss III <[EMAIL PROTECTED]>, June 2002
    */

    int found = 0;
...
  }
#endif

    returnHTTPaccessForbidden();
    return;
  }

Doing this might look a little cleaner, but it's not necessary:

  if((rc = checkURLsecurity(requestedURL)) != 0) {

#if defined(MAX_NUM_BAD_IP_ADDRESSES) && (MAX_NUM_BAD_IP_ADDRESSES > 0)
   /* Note if the size of the table is zero, we simply nullify all of this
      code (why bother wasting the work effort
          Burton M. Strauss III <[EMAIL PROTECTED]>, June 2002
    */

    int found = 0;
...
#endif
    traceEvent(CONST_TRACE_ERROR, "URL security: '%s' rejected
(code=%d)(client=%s)",
               requestedURL, rc, _intoa(from, tmpStr, sizeof(tmpStr)));
    returnHTTPaccessForbidden();
    return;
  }

But both are legal.  What compiler is giving you errors? And what's the
message???


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf
Of Chris Turbeville
Sent: Tuesday, August 26, 2003 9:31 PM
To: [EMAIL PROTECTED]
Subject: [Ntop-dev] Sparc Sol9 patches


Here's the summary of the work I've done to get NTOP running on Solaris:

This fixes a declaration ocurring after code in a block. This moves the
code after the decls.
Index: ntop/http.c
===================================================================
RCS file: /export/home/ntop/ntop/http.c,v
retrieving revision 2.145
diff -r2.145 http.c
2499,2500d2498
<     traceEvent(CONST_TRACE_ERROR, "URL security: '%s' rejected
(code=%d)(client=%s)",
<              requestedURL, rc, _intoa(from, tmpStr, sizeof(tmpStr)));
2532a2531,2532
>     traceEvent(CONST_TRACE_ERROR, "URL security: '%s' rejected
(code=%d)(client=%s)",
>              requestedURL, rc, _intoa(from, tmpStr, sizeof(tmpStr)));

<snip/>

--
[EMAIL PROTECTED]           Chris Turbeville
NTT/VERIO
       Send mail with subject "send PGP Key" for PGP 6.5.2 Public key

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

Reply via email to