GNOME Bugzilla – Bug 729707
souphttpsrc: Add custom sticky event to contain the HTTP request and response headers
Last modified: 2014-05-28 07:21:22 UTC
Created attachment 276064 [details] [review] 0001-souphttpsrc-Add-custom-sticky-event-to-contain-the-H.patch See attached patch. This might be useful for downstream elements to know more about the data that comes next... like the cookies related to it, cache parameters, etc.
Open questions: - Are the names ok? - Should the method (GET) and the URI be included too? What about the HTTP version?
What's the use-case here ? For the URI, we have nothing else? It may make sense for other sources, like RTSP, to include that kind of information too.
For the URI we have the URI query already, yes. The use case here is rather theoretical... downstream elements might want to know about various headers, e.g. to extract cookies for later use or to know if they're allowed to cache the buffers (Cache-Control header), or ... :) I don't have any use for that right now, just seems useful to have.
I think it would be helpful to include the uri in the structure. Also, shouldn't you be calling g_value_get_string() rather than g_value_dup_string()? Otherwise, old_value would leak, wouldn't it?
I think you're right, will update the patch tomorrow :) And also include the URL, it makes sense definitely, even if you could get it from an URI query too... but that would be racy.
Created attachment 277035 [details] [review] 0001-souphttpsrc-Add-custom-sticky-event-to-contain-the-H.patch
GstBlub, is this patch useful for your use case now? Are you still working on the cookie handling? :)
Yes, I actually have cookies working with the help of this updated patch. I borrowed a lot from libsoup (but modified to make it more simplistic) and in some areas much more rudimentary and certainly not as feature rich, but it works. Still needs polishing, though.
Good to hear :) If you want some review or comments of your changes feel free to put them into a bug already or ask me via mail. Would be great if we could integrate that before 1.4 already :)
commit edc7d9027ec83bb0a028d807644ddd3e896086a9 Author: Sebastian Dröge <sebastian@centricular.com> Date: Wed May 7 14:09:06 2014 +0200 souphttpsrc: Add custom sticky event to contain the HTTP request and response headers This can be useful to e.g. get cookie information downstream. https://bugzilla.gnome.org/show_bug.cgi?id=729707