libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] How to close all upgraded connections when shutting


From: Evgeny Grin
Subject: Re: [libmicrohttpd] How to close all upgraded connections when shutting down MHD_Daemon?
Date: Thu, 4 May 2017 16:54:41 +0300
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 04.05.2017 16:41, Nicolas Mora wrote:
>>
>> Do you use HTTP or HTTPS?
> Eventually, since it's a framework for both http and https, I will use
> both protocols.
Behavior in undefined situation can differ in HTTP and HTTPS modes.
MHD_stop_daemon() should close all upgraded connections in HTTPS mode.


>> You must not call MHD_stop_daemon() while you still have some not closed
>> "upgraded" connections.
>> May be we should add more alarming message in case of such API violation.
> I understand.
> What I have thought of is to store a signature of all opened upgraded
> connections in an array, then before calling MHD_stop_daemon(), going
> through each connection, and close them. I guess that's the most clean
> way to do it.

Yes, it's most correct way.


>> Could you provide a minimal example?
>>
> The file
> https://github.com/babelouest/ulfius/blob/2.0/example_programs/websocket_example/websocket_example.c
> provides a minimal example of what I intend to do, although it's still
> in progress.

>From MHD point of view it's not minimal - a lot of functions and
variables that not required to trigger this behavior.

-- 
Wishes,
Evgeny




reply via email to

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