How to make libsoup read from an already-open stream?



At a certain point in my program, I have bytes coming in on a
GPollableInputStream, and I've read enough of them into memory to
be able to know that I want to parse the stream as an HTTP response.
How can I inject the stream (and the bytes already taken from it) into
libsoup, to have it parsed as a SoupMessageBody?

I know of one way: I could set up a fake web server listening on a local
socket, and connect a SoupSession to that socket, and proxy the original
stream of incoming bytes through that fake web server to the SoupSession.

But that seems overly complicated; I hope you can suggest a better way.

Some notes that might be relevant:  (1) The GPollableInputStream was
created by GSocketClient.  (2) I don't need connection persistence;
I can close the socket after the SoupMessageBody is received.

Thanks,


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