libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] [Q] getting full intact URL given from clients


From: Christian Grothoff
Subject: Re: [libmicrohttpd] [Q] getting full intact URL given from clients
Date: Fri, 10 May 2013 15:54:42 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

You should simply use MHD_OPTION_URI_LOG_CALLBACK to register a callback to get the full URI. You can then strdup the URI in there.

Happy hacking!

Christian

On 05/10/2013 03:19 PM, Taehwan Weon wrote:

I am using libmicrohttpd to make a full functional caching proxy which
support sub-range caching.
While the development, I had  to modify libmicohttpd to access full
intact URL string.

Currently (upto the last final release), I could not find any official
info about that.

My modification code sniffets from the version, 0.9.25 are something
like following:

  if (connection->daemon->uri_log_callback != NULL)
     connection->client_context
       =
       connection->daemon->uri_log_callback (connection->daemon->
                                             uri_log_callback_cls, uri);

   p = MHD_pool_allocate (   connection->pool,
                 strlen(uri)+1,
                             MHD_NO);
   strcpy(p, uri);
   connection->raw_url = p;


after that, I can use it from MHD_get_connection_info(..) call.
turl = (char *)MHD_get_connection_info(connection,
MHD_CONNECTION_INFO_FULL_URL);

I believe that this is very cost-effective.

But, I'm not sure if it's right way.
Any way, getting the full intact URL is necessary when proxying to any
other remote server.

Thanks in advance.

------
weon

PS) All that I have to receive from this mailing list is a digest mail.
So, I can't make reply in right manner for each individual reply.




reply via email to

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