Re: [libmicrohttpd] [Windows] Build fails on MinGW-w64 (0.9.62)

2019-02-06 Thread silvioprog
Just to confirm: it compiled like a charm from trunk! :-)

On Fri, Jan 4, 2019 at 7:42 PM silvioprog  wrote:

> Thanks for answering dude! :-)
>
> I'm going to test it ... šŸƒ
>
> On Fri, Jan 4, 2019 at 5:56 PM Evgeny Grin  wrote:
>
>> Hi,
>>
>> It was fixed already in Git master by
>> 1616caa17764c878bc18c6344a0f7f60b2cb596c
>>
>> --
>> Best Wishes,
>> Evgeny Grin
>>
>>  28.12.2018, 09:08, "silvioprog" :
>>
>> Hello,
>>
>> I've tried to compile the latest stable version on MinGW-w64, but it
>> raises the following error at build time (cut relevant parts only):
>>
>> wget --continue --content-disposition
>> https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.62.tar.gz
>> tar -zxvf libmicrohttpd-0.9.62.tar.gz
>> cd libmicrohttpd-0.9.62/ && mkdir build && cd build/
>> ../configure --enable-static=yes --enable-shared=no --enable-messages=yes
>> --enable-https=yes --enable-asserts=no --enable-coverage=no
>> --disable-httpupgrade --disable-dauth --disable-doc --disable-examples
>> --disable-curl
>>
>> ...
>>
>> configure: GNU libmicrohttpd 0.9.62 Configuration Summary:
>>   Target directory:  /mingw32
>>   Cross-compiling:   no
>>   Operating System:  mingw32
>>   Shutdown of listening socket trigger select: no
>>   Inter-thread comm: socketpair
>>   poll support:  yes
>>   epoll support: no
>>   sendfile used: no
>>   HTTPS support: yes (using libgnutls)
>>   Threading lib: w32
>>   Use thread names:  no
>>   Use debug asserts: no
>>   Messages:  yes
>>   Gettext:   yes
>>   Basic auth.:   yes
>>   Digest auth.:  no
>>   HTTP "Upgrade":no
>>   Postproc:  yes
>>   Build docs:no
>>   Build examples:no
>>   Test with libcurl: no, many unit tests will not run
>>
>> configure: HTTPS subsystem configuration:
>>   License :  LGPL only
>>
>> configure: WARNING: This will be a custom build with missing symbols. Do
>> NOT use this build in a distribution. Building with these kinds of
>> configure options is only for custom builds for embedded systems.
>>
>> Now the make:
>>
>> make
>>
>> ...
>>
>> ../../../src/microhttpd/daemon.c: In function
>> 'thread_main_handle_connection':
>> ../../../src/microhttpd/daemon.c:1781:17: error: array type has
>> incomplete element type 'struct pollfd'
>>struct pollfd p[1 + EXTRA_SLOTS];
>>  ^
>> ../../../src/microhttpd/daemon.c:1843:29: error: 'POLLIN' undeclared
>> (first use in this function); did you mean 'POINT'?
>>p[0].events = POLLIN;
>>  ^~
>>  POINT
>> ../../../src/microhttpd/daemon.c:1843:29: note: each undeclared
>> identifier is reported only once for each function it appears in
>> In file included from ../../../src/microhttpd/internal.h:72:0,
>>  from ../../../src/microhttpd/daemon.c:32:
>> ../../../src/microhttpd/mhd_sockets.h:340:27: warning: implicit
>> declaration of function 'WSAPoll'; did you mean 'WSANtohl'?
>> [-Wimplicit-function-declaration]
>>  #define MHD_sys_poll_ WSAPoll
>>^
>> ../../../src/microhttpd/daemon.c:1846:23: note: in expansion of macro
>> 'MHD_sys_poll_'
>>if (0 > MHD_sys_poll_ (p,
>>^
>> ../../../src/microhttpd/mhd_sockets.h:362:38: error: 'POLLRDBAND'
>> undeclared (first use in this function); did you mean 'POLLIN'?
>>  #define MHD_POLL_EVENTS_ERR_DISC POLLRDBAND
>>   ^
>> ../../../src/microhttpd/daemon.c:2012:32: note: in expansion of macro
>> 'MHD_POLL_EVENTS_ERR_DISC'
>> p[0].events |= POLLIN | MHD_POLL_EVENTS_ERR_DISC;
>> ^~~~
>> ../../../src/microhttpd/daemon.c:2015:23: error: 'POLLOUT' undeclared
>> (first use in this function); did you mean 'POLLIN'?
>> p[0].events |= POLLOUT | MHD_POLL_EVENTS_ERR_DISC;
>>^~~
>>POLLIN
>> ../../../src/microhttpd/daemon.c:2055:39: error: 'POLLERR' undeclared
>> (first use in this function); did you mean 'POLLOUT'?
>> (0 != (p[1].revents & (POLLERR | POLLHUP | POLLIN))) )
>>^~~
>>POLLOUT
>> ../../../src/microhttpd/daemon.c:2055:49: error: 'POLLHUP' undeclared
>> (first use in this function); did you mean 'POLLOUT'?
>> (0 != (p[1].revents & (POLLERR | POLLHUP | POLLIN))) )
>>  ^~~
>>  POLLOUT
>> In file included from ../../../src/microhttpd/daemon.c:44:0:
>> ../../../src/microhttpd/daemon.c: In function 'MHD_poll_all':
>> ../../../src/microhttpd/daemon.c:3736:30: error: invalid application of
>> 'sizeof' to incomplete type 'struct pollfd'
>>   sizeof (struct pollfd));
>>   ^
>> ../../../src/microhttpd/mhd_compat.h:79:38: note

[libmicrohttpd] Raw query string issue

2019-02-06 Thread Justin Graves
Hello!

First off, thank you for all of the hard work on libmicrohttpd!

I have built an API using the library, but have an issue with retrieving the 
raw query string, and query string parsing in general. I have implemented theĀ 
MHD_OPTION_URI_LOG_CALLBACK function, but the URI provided here has been 
partially parsed already. More specifically, if I send a query string param 
with an encoded ampersand, such as "q=this%20%26%20that", I expect this 
callback to have exactly that text in the passed in uri. However, what I 
receive is "q=this & that". Not only does this not allow me to log/record/parse 
the original values, but it breaks the built-in parser later, as it will 
attempt to split the query string at this now-decoded &. As far as I can tell, 
this makes it impossible to use an ampersand in a passed-in query string value.

Am I mistaken? Or perhaps there is alternative functionality or options I am 
unaware of here.

Thank you for any help!

-
Justin Graves