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.wa...@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 >
signature.asc
Description: OpenPGP digital signature