[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] [GSoC Update] Week 2
From: |
Evgeny Grin |
Subject: |
Re: [libmicrohttpd] [GSoC Update] Week 2 |
Date: |
Sat, 17 Jun 2017 22:39:46 +0300 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 17.06.2017 22:22, Didik Setiawan wrote:
> On Sat, Jun 17, 2017 at 01:30:57PM +0300, Evgeny Grin wrote:
>>
>
>> You can combine second and third methods:
>
> I use this combination.
>
>> -----------------------------------------------
>> int port_num;
>>
>> if(0) {}
>> #if MHD_VERSION >= 0x00095501
>> else if (MHD_NO !=
>> MHD_is_feature_supported (MHD_FEATURE_AUTODETECT_BIND_PORT))
>> {
>> const union MHD_DaemonInfo *dinfo;
>> dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
>> if (NULL == dinfo || 0 == dinfo->port)
>> {
>> /* Insert code to handle error. */
>> return -1;
>> }
>> port_num = (int)dinfo->port;
>> }
>> #endif /* MHD_VERSION >= 0x00095501 */
>> else
>> {
>> const union MHD_DaemonInfo *dinfo;
>> MHD_socket sock_fd;
>> dinfo = MHD_get_daemon_info (d, MHD_OPTION_LISTEN_SOCKET);
>
> Don't you mean:
>
> dinfo = MHD_get_daemon_info(d, MHD_DAEMON_INFO_LISTEN_FD);
>
> Because when I tried using MHD version < 0.9.55 the result is not as
> expected.
>
>> if (NULL == dinfo)
>> {
>> /* Insert code to handle error. */
>> return -1;
>> }
>> sock_fd = dinfo->listen_fd;
>> /* Insert code to use port detection on provided socket. */
>> }
>> -----------------------------------------------
Right, correct value is MHD_DAEMON_INFO_LISTEN_FD.
--
Wishes,
Evgeny
signature.asc
Description: OpenPGP digital signature
- Re: [libmicrohttpd] [GSoC Update] Week 1, (continued)
[libmicrohttpd] [GSoC Update] Week 2, Didik Setiawan, 2017/06/12
- Re: [libmicrohttpd] [GSoC Update] Week 2, Christian Grothoff, 2017/06/13
- Re: [libmicrohttpd] [GSoC Update] Week 2, Darshit Shah, 2017/06/13
- Re: [libmicrohttpd] [GSoC Update] Week 2, Evgeny Grin, 2017/06/14
- Re: [libmicrohttpd] [GSoC Update] Week 2, Didik Setiawan, 2017/06/17
- Re: [libmicrohttpd] [GSoC Update] Week 2, Tim Rühsen, 2017/06/17
- Re: [libmicrohttpd] [GSoC Update] Week 2, Evgeny Grin, 2017/06/17
- Re: [libmicrohttpd] [GSoC Update] Week 2, Didik Setiawan, 2017/06/17
- Re: [libmicrohttpd] [GSoC Update] Week 2,
Evgeny Grin <=
[libmicrohttpd] [GSoC Update] Week 3, Didik Setiawan, 2017/06/20