libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libmicrohttpd] How to avoid the "Internal application error, closin


From: Kenneth Mastro
Subject: Re: [libmicrohttpd] How to avoid the "Internal application error, closing connection" message when AHC = NO?
Date: Mon, 14 Mar 2016 10:03:48 -0400

I don't know anything about using external loggers with MHD and this isn't really any of my business, but filtering log messages based on the string seems like a bad idea.  That string could change in future releases (plus I guess you're doing extra string comparisons, but I doubt that amounts to very much).

If MHD doesn't provide some kind of 'message code' or a #define constant for the string (so you could compare it to something consistent), then maybe you could just log an extra message before you return MHD_NO?  E.g., "Ignore the following message - there is no error - connection was intentionally refused."

Maybe it's just me, but I always try to promote easy maintenance and avoid fragility whenever it's reasonably possible.  This seems like one of those times, albeit for a pretty minor thing.


Ken



On Mon, Mar 14, 2016 at 9:49 AM, silvioprog <address@hidden> wrote:
Hm... I use MHD_OPTION_EXTERNAL_LOGGER, so I'll do something like:

if (msg != 'Internal application error, closing connection.\n')
  logger.log(msg);

I thought about it, but I didn't know that I could skip all messages of this type.

Thank you! :-)

On Mon, Mar 14, 2016 at 10:34 AM, Christian Grothoff <address@hidden> wrote:
You could filter those in your custom logger, which you can set using
MHD_OPTION_EXTERNAL_LOGGER.

-Christian
 
--
Silvio Clécio


reply via email to

[Prev in Thread] Current Thread [Next in Thread]