[Top][All Lists]

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

Re: [libmicrohttpd] MHD_add_connection multiple requests

From: Christian Grothoff
Subject: Re: [libmicrohttpd] MHD_add_connection multiple requests
Date: Thu, 02 Jan 2014 19:43:35 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131005 Icedove/17.0.9

Dear Wolfgang,

You might be confusing a few issues here.

1) if you get the first request, the problem is unlikely to
   be NAT-related.  Similarly, MHD_add_connection is most
   likely not the answer to your problem.  Unless, of course,
   you are already using that function to deal with NAT in
   the first place, in which case you should elaborate on
   your solution (HTTP with connection reversal is usually
   a pretty insane thing to try as a solution for NAT in my
2) I'm not sure why you do not get the 2nd 'GET' request,
   short of having crashed / misbehaved during the first one.
   You only say what your client generates, but what would
   be interesting to know is what you get behind the NAT
   (in terms of traffic) and what exactly you see at the API

Furthermore, from what you quote, you _may_ have a completely different
issue, which is that MHD itself does _not_ handle range requests.
That doesn't mean you cannot support range requests, but it is
the responsibility of the application to
1) set the 'Accept-Ranges' header in the response, and to
2) parse the range request and adjust the generated responses

So unless your application does both, it is conceivable that
you're actually receiving the 2nd request, but are treating it just
like the 1st request (ignoring the range) and then the media player
is unlikely to like what it gets.

Happy hacking!


On 01/02/2014 07:08 PM, Wolfgang Haupt wrote:
> Hi,
> I face following situation:
> I wrote a very simple implementation of a webserver for handling
> streaming of videos and music.
> This works very well, now I need to handle the situation that this
> server is behind a NAT firewall.
> So I came up with the MHD_add_connection function.
> I managed to get the first GET response from the media player, but I my
> response-callback isn't called when the media player requests another
> part of the current media item.
> I imagine in "normal" daemon mode the player uses a new connection for
> sending further GET-Requests, but in case of using MHD_add_connection
> how can I do this?
> Eg.:
> Player:
> bytes=0-*
> Server:
> HTTP Partial Content
> Range-Bytes=0-745125/745126
> (following GET never comes across)
> Player:
> bytes=245458-*
> I did not find any hints for MHD_add_connection in the docs.
> Can anyone help me here?
> Thx and kind regards,
> Wolfgang

Attachment: 0x48426C7E.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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