libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] MHD_lookup_connection_value for trailing keys


From: Christian Grothoff
Subject: Re: [libmicrohttpd] MHD_lookup_connection_value for trailing keys
Date: Wed, 10 Jun 2020 22:00:35 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

Hi!

Thanks for the report. The manual is wrong (/very outdated). I've fixed
it in Git d7709c55..2abe788d.  The old method was bad, because you could
not properly handle cases like  http://example.com/?trailer1&trailer2 with
it.

You should use MHD_get_connection_values() instead, that will allow you
to get all 'trailer'-values.

Happy hacking!

Christian

On 6/4/20 8:37 PM, p.wassi@gmx.at wrote:
> Hi all,
> 
> I've got a bit of a problem understanding how to use 
> MHD_lookup_connection_value for getting
> access to trailing keys.
> The documentation says:
>> A value of NULL for key can be used to lookup ’trailing’ values without a 
>> key,
>> for example if a URI is of the form “http://example.com/?trailer”, a key of 
>> NULL
>> can be used to access “tailer" The function returns NULL if no matching item 
>> was found. 
> 
> I'd expect that MHD_lookup_connection_value(connection, 
> MHD_GET_ARGUMENT_KIND, NULL)
> would return "trailer", which is not the case. It returns NULL.
> 
> During a debug session, it came up that this particular request's 
> /headers_received/ seems to be
> processed like this:
> kind = MHD_GET_ARGUMENT_KIND, header = "trailer", value = NULL
> (...)
> 
> The first for-loop in MHD_lookup_connection_value_n would stop once it found
> a header being NULL (which is not the case here). Furthermore, if it actually
> found the correct key-value-pair, it would return the value, which is NULL 
> here.
> 
> Is there a way to access "trailer" as it is described in the documentation?
> 
> Thanks, best regards,
> Paul
> 

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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