libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] Consider adding "are there active/suspended connecti


From: Christian Grothoff
Subject: Re: [libmicrohttpd] Consider adding "are there active/suspended connections" information
Date: Mon, 27 Oct 2014 18:14:22 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.8.1

On 10/27/2014 06:07 PM, Milan Straka wrote:
> Hi Christian,
> 
>> -----Original message-----
>> From: Christian Grothoff <address@hidden>
>> Sent: 27 Oct 2014, 18:00
>>
>> On 10/27/2014 05:50 PM, Milan Straka wrote:
>>
>> ...
>>
>>> The information is readily available inside MHD_Daemon using the
>>> connections_head (and possibly suspended_connections_head).
>>>
>>> Would you consider allowing access to this information, for example using
>>> MHD_get_daemon_info? Either as 0/1 information with
>>> MHD_DAEMON_INFO_ANY_ACTIVE_CONNECTIONS (and possibly also with
>>> MHD_DAEMON_INFO_ANY_SUSPENDED_CONNECTIONS), or return the number
>>> of active connections with MHD_DAEMON_INFO_ACTIVE_CONNECTIONS
>>> (and possibly the suspended with MHD_DAEMON_INFO_SUSPENDED_CONNECTIONS)?
>>
>> Sounds useful enough, please propose a patch.
> 
> Would you prefer the true/false _ANY_ versions (which would be O(1))
> or the number-returning versions which run in linear time?

What about storing the original value of max_connections (from

daemon.c:          daemon->max_connections = va_arg (ap, unsigned int);
daemon.c:  daemon->max_connections = MHD_MAX_CONNECTIONS_DEFAULT;
) and calculating the difference between the current value and the
max to determine the number of active connections? That'd give us
O(1) *and* the more precise information.

> I am new to libmicrohttpd -- how should I send a patch? If there is
> a GIT repo somewhere, so that I can create the commits and send the repo
> to you, or should I just email the svn diff?

There is a Subversion repo at https://gnunet.org/svn/libmicrohttpd/,
you can just use 'svn diff' to create a patch and send it to the list or
to me personally (especially if it seems likely to be accepted as-is
without discussion, no need to always bother everybody).


Happy hacking!

Christian

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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