Re: libsoup server



Dennis Jacobfeuerborn wrote:
> Thanks for the response. I finally found some time to look into this again 
> but things still don't seem to work. I implemented a minimal handler like this:
> 
> static void server_callback (SoupServerContext *context, SoupMessage *msg,
>                               gpointer data) {
>      g_printf("callback\n");
>      soup_message_set_status (msg, SOUP_STATUS_NOT_FOUND);
>      return;
> }

You need to additionally call

  soup_server_message_set_encoding (SOUP_SERVER_MESSAGE (msg),
SOUP_TRANSFER_CONTENT_LENGTH)

which will tell it to add a "Content-Length: 0", fixing the
otherwise-broken response.

(This is not supposed to be necessary, it's just to work around the bug
in SoupServer.)

-- Dan



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