Re: libsoup server
- From: Dan Winship <danw novell com>
- To: Dennis Jacobfeuerborn <d jacobfeuerborn conversis de>
- Cc: libsoup-list gnome org
- Subject: Re: libsoup server
- Date: Mon, 10 Jul 2006 11:21:19 -0400
Dennis Jacobfeuerborn wrote:
> Hi!
> I'm trying to build a small server using libsoup but seem to get into
> trouble early on. The following app seems to listen on port 8888 just fine
> but when I send a request with Firefox sits there saying "Waiting for
> localhost..." and nothing happens:
>
> int main( int argc, char *argv[] ) {
> g_type_init();
> g_thread_init(NULL);
> SoupServer *soup_server = soup_server_new(SOUP_SERVER_PORT , 8888, NULL);
> soup_server_run(soup_server);
> return 0;
> }
>
> Using strace on this app results in the following output:
>
> fcntl64(6, F_GETFL) = 0x802 (flags O_RDWR|O_NONBLOCK)
> read(6, "GET / HTTP/1.1\r\nHost: localhost:"..., 8192) = 396
> rt_sigaction(SIGPIPE, {SIG_IGN}, {SIG_DFL}, 8) = 0
> write(6, "HTTP/1.1 404 Not Found\r\n\r\n", 26) = 26
> rt_sigaction(SIGPIPE, {SIG_DFL}, {SIG_IGN}, 8) = 0
> read(6, 0x83717a0, 8192) = -1 EAGAIN (Resource temporarily
> unavailable)
>
> So it seems libsoup is sending out the expected 404 error (since no handler
> is defined) but for some reason the response doesn't arrive at the other
> end. Can somebody tell me what I am doing wrong here?
You're not doing anything wrong. It looks like SoupServer's built-in 404
handler is broken; it needs to either include "Content-Length: 0" in the
response, or close the connection after it.
So you'll have to register a default handler (a handler with path ==
NULL) and have it return a correct 404 error for any URL that you don't
handle.
2.2.95 has already gone out, so this won't be fixed in libsoup until 2.2.96.
-- Dan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]