I spent about 5-6 hours last night working on the source code for the GoAhead webserver in XBMC. FYI, the ticket for tracking this issue is here:
http://trac.xbmc.org/ticket/4970
Alas, I don't have posting privileges there, so I'm going to have to post my update here in hopes somebody can copy it there.
First off, I was unable to fix all the bugs, but I did fix a couple. As you might expect, the original author made multiple assumptions that sizeof(int) == sizeof(void*) (or whatever kind of pointer), where in reality sizeof(long) == sizeof(void*). I traced the bug that caused the "isset" error to h.c, where a generic framework called hAlloc/hFree adds and removes entries to variable-sized tables -- this is used by the symbol table framework. Unfortunately, that code does inline booking in the "table" using two ints (which are at the front of the table) and bugginess ensues from there on 64-bit platforms.
So that got around that bug, but there are others. For example, multiple callback functions take an "int arg" as an extra parameter. So I tried fixing some of those.
The end result is that hitting the webserver starts bringing up the interface -- but then the server thread crashes (i.e. the connection hangs with the interface partially displayed). Here's my patch as it exists now:
Code:
(forum says it's too long! Anyone know where I can send a patch?!)
I apologize for the ugliness of this initial patch. I
just now discovered the trace() function in the code, so I may work on converting my debugging output to use that function and post another patch.