I'm running on Linux and compile my application with g++.  0.9.49 works for
me (on both x86 and an ARM processor, for what that's worth).  I didn't
change a line of code to go from 0.9.43 to 0.9.49.  I do not use an 'accept
policy callback', but naturally I need the 'access handler' callback and it
does get called.  Among other differences, I also specify a specific web
port and I use thread-per-connection mode.

I haven't studied your test case, but is it possible you've got some kind
of C++ function name mangling problem that could be resolved with some
'extern "C"' prefixes?  Seems like a long shot, but something to think
about when interfacing with a C library.

Have you tried your test case with an older version of MHD?  If that works,
that implies a bug was actually introduced in 0.9.49.


Ken



On Tue, Apr 12, 2016 at 12:01 PM, Martin Bonner <[email protected]>
wrote:

> That is the same.  The name of a function decays into a pointer to that
> function in just the same way
>
> as the name of an array decays into a pointer to the first element.  The
> only exception is if the function
>
> name is the argument of the address-of operator.  So “AcceptPolicyCallback“
> and “&AcceptPolicyCallback“
>
> have the same value and the same type.
>
>
>
> Pretty sure that is true in both C and C++.
>
>
>
> *Von:* libmicrohttpd [mailto:libmicrohttpd-bounces+martin.bonner=
> [email protected]] *Im Auftrag von *silvioprog
> *Gesendet:* Dienstag, 12. April 2016 16:37
> *An:* libmicrohttpd development and user mailinglist <
> [email protected]>
> *Betreff:* Re: [libmicrohttpd] libmicrohttpd 0.9.49 released
>
>
>
> It worked fine here on Windows. I don't know how C++ declares pointers,
> but looking at this line:
>
>
>
>     struct MHD_Daemon *daemon = MHD_start_daemon( daemon_flags, 0,
>
>
> http_AcceptPolicyCallback, NULL,
>
>
> http_AccessHandlerCallback, NULL, ...
>
>
>
> You should use something like this:
>
>
>
>     struct MHD_Daemon *daemon = MHD_start_daemon( daemon_flags, 0,
>
>
> &http_AcceptPolicyCallback, NULL,
>
>
> &http_AccessHandlerCallback, NULL, ...
>
>
>
> Try the "A minimal example" available at MHD home page:
> https://www.gnu.org/software/libmicrohttpd/ .
>
>
>
> On Tue, Apr 12, 2016 at 11:10 AM, Markus Doppelbauer <[email protected]>
> wrote:
>
> Hello,
>
>
>
> Thanks a lot.
>
> For me, 0.9.49 does not work - it never enters the
>
> "AccessHandlerCallback()" handler. I have attached
>
> a small testcase.
>
>
>
> Steps to reproduce:
>
> g++ -o testmhd test.cpp -I/tmp/libmicrohttpd-0.9.49/src/include/
> -L/tmp/libmicrohttpd-0.9.49/src/microhttpd/.libs/ -lmicrohttpd
>
> LD_LIBRARY_PATH=/tmp/libmicrohttpd-0.9.49/src/microhttpd/.libs/ ./testmhd
>
>
> wget -O /dev/null 127.0.0.1:8080
>
>
>
> --
>
> Silvio Clécio
>

Reply via email to