Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

[win32] bump libmicrohttpd to 0.9.17 #2262

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
10 participants
Owner

Montellese commented Feb 18, 2013

After libmicrohttpd has been bumped from 0.4.6 to 0.9.x for darwin (not sure about linux?) I've taken a look into updating it for win32 as well. I went for the 0.9.17 release because it's the newest release with pre-built win32 binaries.

The first commit contains some general cleanup concerning the webserver. The second commit cleans up the includes used by microhttpd.h. The third commit changes the loaded libmicrohttpd DLL (the dependency file hasn't been uploaded to our mirrors yet).

I didn't do any extensive testing except starting and stopping the webserver a few times, playing around with the webinterface and making some json-rpc requests over HTTP but I didn't notice anything out of the ordinary.

PS: This bump increases the size of the win32 install exe by approximately 2 MB because of the included HTTPS/TLS support.

@wsoltys wsoltys was assigned Feb 18, 2013

Member

wsoltys commented Feb 19, 2013

Nice. Did you build your own import lib or was it already included? In the last package only a mingw import lib .a was available which didn't played nicely with XBMC.

Owner

Montellese commented Feb 19, 2013

I built my own libmicrohttpd.dll.lib import file as the distributed .a file is for MinGW and not for VC++. It will obviously be part of the updated dependency package.

Contributor

davilla commented Feb 19, 2013

any relation to #2143
can windows go to 0.9.24 ?

Owner

Montellese commented Feb 19, 2013

I just went with the release version that also came with pre-built win32 binaries. All the other releases are source code only. I can try to build another version with MinGW though.

While discussing these versions: why did darwin bump to 0.9.24 and not to 0.9.20 which is distributed by Quantal and is also the version in the Ubuntu development repo? If we want to use the same version on all platforms, 0.9.20 seems like the best candidate.

Contributor

davilla commented Feb 19, 2013

@ulion , why 0.9.24 and not to 0.9.20 ?

Member

wsoltys commented Feb 19, 2013

libmicro has a lot of dependencies which need to be pulled in our mingw env. Beside that I only had bad experiences with compiling it by myself.

Contributor

ulion commented Feb 20, 2013

libmicrohttpd need be tested on each platform, when using thread pool mode, it directly copy pthread mutex struct and share using it in multiple worker threads, it cause crash on some platform if the mutex struct is not copy and sharable. marked and some links in #2143

Owner

Montellese commented Feb 22, 2013

OK I did a few more tests on win32 by starting and stopping the webserver multiple times and doing several HTTP requests in between and didn't run into any crashes or anything. So looks like win32 is not affected by that bug @ulion discovered.

Member

theuni commented Feb 22, 2013

Note that Android can't be bumped here, due to gplv3.

Contributor

ulion commented Feb 22, 2013

copy and share use different copy of pthread_mutex_t is not a good idea anyway. I suggest we should switch to one thread per connection mode before libmicrohttpd fix it. if no one do that, I will make a pr for it later.

Contributor

davilla commented Feb 22, 2013

android can't be bumped at all or can't be bumped to 0.9.20 or 0.9.24 ?

Member

theuni commented Feb 22, 2013

at all. IIRC we're currently as high as we can go.

I only mention it because I didn't want anyone worrying about android compat wrt any new threading changes.

Contributor

davilla commented Feb 22, 2013

eh ? 0.4.6 has a threading problem that ulion found that causes crashes under iOS.

Member

theuni commented Feb 22, 2013

hmm, looks like it's actually lgplv3. Possible that if we break it out to be dlopened we could possibly bump. I'll investigate and bring this up elsewhere.

Owner

Montellese commented Feb 22, 2013

Did libmicrohttpd change its license between 0.4.6 and 0.9.x? I checked the COPYING file of 0.4.6 and 0.9.20 and both are LGPL v2.1 unless you don't compile with https support, then it's either LGPL v2.1 or eCos license. So not sure what would change with a bump.

Member

theuni commented Feb 22, 2013

Yes, I'm seeing that now as well. Though I swear when I first did the port the current license was gplv3, as stated in copying. Am I going crazy?

Either way, looks like we're free to bump as needed, assuming it actually builds on android. I'll put this on the todo for unified-depends, that's much easier than splitting them up, anyway :)

Owner

Montellese commented Feb 27, 2013

See #2316.

Owner

Montellese commented Mar 1, 2013

So what's the consensus here? The problem with building libmicrohttpd from source on win32 is that it depends on a lot of other libraries like libgcrypt and ligbnutls which again depend on other libraries etc. We'd need to setup a complete MinGW build environment and system to be able to build all those binaries.

The drawbacks of this bump is that it increases the final size of the XBMC installer and it means we have to switch to one connection per thread because of the bug discovered by @ulion (his fix has just been commited to the libmicrohttpd svn) but who knows when libmicrohttpd will release updated win32 binaries.

Contributor

davilla commented Mar 1, 2013

how high can you easily go on window, then we set the others to match.

Owner

Montellese commented Mar 1, 2013

0.9.17 is currently the highest version with a release containing win32 binaries. But as mentioned earlier Ubuntu et. al. distribute 0.9.20-1.

Owner

Montellese commented Mar 10, 2013

Can I push this in?

Owner

MartijnKaijser commented Apr 1, 2013

ok for this merge window?

Owner

Montellese commented Apr 1, 2013

Not a clue. The one that bumps libmicrohttpd for osx has been closed by @ulion.

@Montellese Montellese was assigned Apr 1, 2013

Contributor

ulion commented Apr 1, 2013

I closed the one because we switched to the unified deps. but currently we have unified deps, we are still stuck on bumping things because some other platforms not using unified deps have a mainline lower version of some package because of that we do not bump the one in unified deps?
how about make every platform to use the unified deps to end this?

Owner

Montellese commented Apr 1, 2013

Good luck with win32 and unified deps ;-)

Member

wsoltys commented Apr 2, 2013

No way for unified deps on win32 yet. We use precompiled libs where possible.

Member

jmarshallnz commented Apr 8, 2013

So pick a version and run with it. Whatever is easiest for win32 is probably easiest for all?

Owner

Montellese commented Apr 8, 2013

The problem is that anything between 0.9.11 and 0.9.26 (excluded) has a (platform-dependent) bug mentioned by ulion. So e.g. iOS can't go with 0.9.17 because then it would have to use a different threading model than the others. Not sure what other platforms have the same problem, I just know that win32 doesn't. So if possible we should use 0.9.26+ but there's no pre-built win32 binary for anything newer than 0.9.17.

Member

wsoltys commented Apr 14, 2013

So, many opinions and no progress. We have so many different library versions across the platforms and even different problems with the same library version. So my opinion is to go for the version with fits best if we can't have matching versions.
I'm fine with this going in.

Owner

MartijnKaijser commented May 4, 2013

@Montellese
ok to merge?

Owner

Montellese commented May 5, 2013

I don't know what the status of a libmicrohttpd bump on other platforms is. IMO we should bump all (more or less) together.

Member

theuni commented May 5, 2013

fwiw, I did manage to get a reasonable way through win32 deps using mingw in unified deps. mysql looked pretty hopeless though.

Member

da-anda commented Jan 22, 2014

is this one dead and should be closed? Or do we start another attempt to use the same lib versions on all platforms? (ofc not for Gotham)

Contributor

Tolriq commented Jan 11, 2015

Since Helix is now out and still have a "bugged" webserver maybe there's a way to advance on this one ?

Most linux distributions use a way more recent libmicrohttpd have have a perfectly working webserver, while windows lack this a lot :(

Ping @Montellese

Owner

Montellese commented Jan 11, 2015

I'm currently refactoring the webserver implementation to be more generic when it comes to caching, ranged requests etc. After that I can look into this again.

@Tolriq: Do you know of any specific bugs with libmicrohttpd? I have heard of some crashes in the webserver and I've seen it once as well but that was not in libmicrohttpd but in the JSON-RPC request evaluation logic (but wasn't able to figure out why).

Contributor

Tolriq commented Jan 11, 2015

Well the main problem in Windows is speed, but I can't reproduce I just have numerous reports :(

File downloading is very very very slow (As streaming media ), and it seems there's some caching problems like you can download 50 to 300MB (depends on users) then need to pause to continue or webserver do no more send data.

(This is not the case when using UPNP webserver so not a problem on the host client or the connection between host and real media)

For crashes in Kodi, there's 2 things, pure crash but there's lots of reports on forums with logs (http://forum.kodi.tv/showthread.php?tid=212085 so maybe what you reproduce once)

And lots of other just internal crash of the webserver, Kodi continue to work correctly but webserver is in a stuck state, no more answering and no way to stop Kodi without killing process.
http://yatse.leetzone.org/redmine/issues/1164 I can contact this user that seems to be able to reproduce each time so he contact you for more details.

Owner

Paxxi commented Feb 10, 2015

@Montellese We talked a bit about this last week and I built a fresh version of 0.9.39 if you'd care to try it out. You can get a packaged dependency file at http://delusional.nu/libmicrohttpd-0.9.39-win32.7z or if you'd rather build your own you can check out https://github.com/Paxxi/xbmc-deps/ it should build without fuzz.

I noticed that Karlson2k has been moonlighting so it actually builds on win32 now without any weirdness.

Owner

Montellese commented Feb 11, 2015

@Paxxi: Thanks for the heads up. We should probably go with libmicrohttpd 0.9.37 because that's what is being used in current ubuntu stable release. We MUST NOT use 0.9.35 or 0.9.36 because they messed up big time in those two releases due to a change that went in between 0.9.34 and 0.9.35 and was then reverted and properly fixed for 0.9.37.

@Montellese Montellese closed this Feb 22, 2015

@Montellese Montellese deleted the Montellese:win32_libmicrohttpd_bump branch Feb 24, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment