Re: Having trouble getting more than one chunk sent with chunked encoding



Did you try to write a minmal example and reproduce the issue with a dummy libsoup server/client using chunked response?

On Mon, Jan 20, 2014 at 8:47 PM, Pedro Côrte-Real <pedro pedrocr net> wrote:
Does anyone have any pointers as to what I may be doing wrong? Or is this an issue with libsoup and I should file a bug report? Cheers, Pedro On Sat, Jan 18, 2014 at 7:15 PM, Pedro Côrte-Real <pedro pedrocr net> wrote:
Hi, I'm trying to stream a chunked response in a SoupMessage taken from a Gstreamer pipeline. This is the same case of my other email about SoupMultipart. I am temporarily using the multipartmux Gstreamer element to do the actual multipart encoding so I just need libsoup to stream the bits in the response. I can get the response all setup and the first chunk sent but after that no other chunk gets sent although I'm unpausing the message. The app just seems to sit there buffering the chunks (consuming memory) and the HTTP client doesn't receive anything. My only hypothesis is that somehow having libsoup and Gstreamer on the same mainloop is causing issues. You can see the whole code here: https://github.com/pedrocr/camerasink/blob/309285054681f70214ebb22596d4f5551a9574f5/bin/camerasave.c My send_chunk function seems pretty straightforward: static void send_chunk (gpointer key, gpointer value, gpointer user_data) { GstBuffer *buffer = (GstBuffer *) user_data; SoupMessage *msg = SOUP_MESSAGE(key); SoupServer *server = SOUP_SERVER(value); GstMapInfo map; gst_buffer_map (buffer, &map, GST_MAP_READ); //g_print ("[%p] writing chunk of %lu bytes\n", msg, (unsigned long)chunk->length); soup_message_body_append (msg->response_body, SOUP_MEMORY_COPY, map.data, map.size); gst_buffer_unmap (buffer, &map); soup_server_unpause_message (server, msg); } The first chunk gets sent and I get a wrote-chunk signal. After that the program just sits there eating memory and no other wrote-chunk signals are sent and indeed the HTTP client doesn't see the response continuing. Any pointers would be very welcome. Pedro
_______________________________________________ libsoup-list mailing list libsoup-list gnome org https://mail.gnome.org/mailman/listinfo/libsoup-list


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