Commit graph

156 commits

Author SHA1 Message Date
Xavier Claessens 64e4df3fe2 souphttpsrc: Add tls-database property
https://bugzilla.gnome.org/show_bug.cgi?id=750298
2015-06-10 14:10:39 -04:00
Xavier Claessens 5ada1a6cf8 souphttpsrc: fix getter of "ssl-use-system-ca-file"
https://bugzilla.gnome.org/show_bug.cgi?id=750298
2015-06-10 12:02:16 +01:00
Sebastian Dröge 8965619f13 souphttpclientsink: Implement cookies property 2015-03-08 18:04:34 +01:00
Sebastian Dröge b2bcb3d61f souphttpclientsink: Implement automatic-redirect property 2015-03-08 18:02:51 +01:00
Sebastian Dröge 814f741a28 souphttpclientsink: Implement proxy support
The properties were there before, but not used anywhere.
2015-03-08 17:54:42 +01:00
Sebastian Dröge bbcfc3b9e6 souphttpsrc: Don't return a buffer when returning not GST_FLOW_OK
basesrc assumes that we don't return a buffer if
something else than OK is returned. It will just
leak any buffer we might accidentially provide
here.

This can potentially happen during flushing.

Maybe fixes https://bugzilla.gnome.org/show_bug.cgi?id=741993
2014-12-30 16:28:09 +01:00
Branislav Katreniak 1e03ffb820 souphttpsrc: log connection events at info level
https://bugzilla.gnome.org/show_bug.cgi?id=739305
2014-11-22 15:14:58 +00:00
Nirbheek Chauhan f35f3ccf7c souphttpclientsink: Fix lifetime of stream headers and queued buffers
Stream headers are updated whenever ::set_caps is called, so we can't assume
they'll be valid before the message body is written out. We *can* assume that
for queued buffers, but SOUP_MEMORY_STATIC is still wrong for those.

Also, add some debug logging for stream header interactions.

https://bugzilla.gnome.org/show_bug.cgi?id=737771
2014-10-02 12:47:36 +03:00
Nirbheek Chauhan 374552a720 souphttpclientsink: Add some more useful debug logging 2014-10-02 09:48:49 +03:00
Nirbheek Chauhan 745d497318 souphttpclientsink: Free queued buffers in ::reset
::render sets a new callback for writing out new buffers only if there aren't
already buffers queued for writing with a previously-scheduled callback.
However, if the previously-scheduled callback is interrupted by a state change
(either manually or due to an error) and there are still buffers in the queue,
restarting the pipeline will result in buffers being queued forever, and no
callbacks will ever be scheduled, and no buffers will be written out.

https://bugzilla.gnome.org/show_bug.cgi?id=737739
2014-10-02 09:48:27 +03:00
Sebastian Dröge 53b5a44a06 souphttpsrc: If the server reports "Accept-Ranges: none" don't try range requests 2014-09-11 12:53:29 +03:00
Sebastian Dröge 4b697df494 souphttpsrc: Include redirection target in error messages
Just giving the original URI can give the false impression that e.g.
that one failed host name resolution, while actually the redirection target
did.
2014-09-04 12:14:11 +03:00
Sebastian Dröge edc7d9027e 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
2014-05-28 09:20:21 +02:00
Sebastian Dröge 2a7abc98db souphttpsrc: Clean up all pending operations from libsoup before unreffing our context
When we cancel connection attempts and similar things, there are still
some operations pending on our main context from the GCancellables. We
should let them all run before unreffing our context, otherwise we leak
file descriptors.

Unfortunately this requires libsoup 2.47.0 or newer as earlier versions
steal our main context from us and we can't use it for cleanup later
without assertions and funny crashes.

Based on a patch by Dmitry Shatrov <shatrov@gmail.com>.

https://bugzilla.gnome.org/show_bug.cgi?id=663944
2014-05-08 10:18:38 +02:00
Sebastian Dröge 3b6c17c2b6 souphttpsrc: Remember if a redirect is permanent or not and store it in the query 2014-04-28 10:04:03 +02:00
Sebastian Dröge 37609c0a82 souphttpsrc: Only keep-alive the connection in stop() if we have finished all previous messages
After cancelling a request we need to create a new connection.
2014-04-11 13:30:53 +02:00
Sebastian Dröge 847ba2a30d souphttpsrc: Also retry on unexpected network failures 2014-04-10 16:47:21 +02:00
Sebastian Dröge 037dfb6723 souphttpsrc: New property to specify the maximum number of retries before we give up 2014-04-10 16:47:07 +02:00
Alexander Zallesov b089524b21 souphttpsrc: Change default timeout to 15 seconds
If nothing happens after 15 seconds, chances are good that
our connection will never will work. Stop after 15 seconds
instead of waiting until the system's default timeout, which
can be > 1 minute.
2014-04-10 11:11:35 +02:00
Sebastian Dröge d918212e12 souphttpsrc: Use GST_FLOW_FLUSHING when flushing, not GST_FLOW_EOS
... and reset it properly after flushing is done. Fixes playback
in many cases when buffering is used.

https://bugzilla.gnome.org/show_bug.cgi?id=727821
2014-04-09 10:56:29 +02:00
Sebastian Dröge 5d06735dbd souphttpsrc: Add properties for selecting SSL/TLS certificate checking
And by default properly check certificates against the system's CA
certificates. Everything else is not a good default at all.
2014-03-12 15:32:55 +01:00
Sebastian Dröge ac83961033 souphttpsrc: Make sure to not return EOS immediately if we finished a range request
Only return EOS the next time create() is called, if at all. basesrc
should already take care of not calling it again.

Also always return immediately if the previous flow return was
not OK. This indicates an error somewhere.
2014-03-07 16:56:51 +01:00
Sebastian Dröge 9701051485 souphttpsrc: Don't forget to quit mainloop after we cancelled when we got data after the stop position 2014-03-06 13:38:09 +01:00
Sebastian Dröge 0c6f1ce998 souphttpsrc: If we had a stop position, allow for the server to finish our connection instead of just cancelling
Otherwise keep-alive does not make much sense and also the server will have
confusing things in the logs.
2014-03-06 13:36:38 +01:00
Branislav Katreniak 6f1d4da8b4 souphttpsrc: do not emit error when connection with unknown size ends
Commit 46fd12ae5e introduced connection
recovery. But when server does not specify content-size,
souphttpsrc tries to reconnect even after regular end of stream.
Http server replies  with SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE
but souphttpsrc still emits error instead of EOS.

https://bugzilla.gnome.org/show_bug.cgi?id=724717

Signed-off-by: Branislav Katreniak <bkatreniak@nuvotechnologies.com>
2014-02-19 16:59:16 +01:00
Sebastian Dröge fdb39a9f7b souphttpsrc: Use new automatic_eos API from basesrc
We want to notice ourselves that we're EOS. Otherwise we will
always cancel requests in the very end and confuse the server...
and also make it impossible to use persistent connections.
2014-02-13 12:09:13 +01:00
Sebastian Dröge 4dfad42e81 souphttpsrc: Consistently use have_size instead of content_size!=0 2014-02-13 11:11:13 +01:00
Sebastian Dröge dde171ac30 souphttpsrc: Free extra headers when finalizing the element
It's set as property by the application, we should not just reset
properties when going back to READY.
2014-02-13 10:36:29 +01:00
Sebastian Dröge a79f92ee9d souphttpsrc: Properly close the session when going back to NULL
Don't wait for that until the element is disposed.
2014-02-13 10:36:29 +01:00
Andoni Morales Alastruey 4d80d3fad9 souphttpsrc: add support for keep-alive sessions
https://bugzilla.gnome.org/show_bug.cgi?id=699926
2014-02-13 10:36:29 +01:00
Sebastian Dröge 106bc2b17b souphttpsrc: Add "compress" property to enable/disable automatic gzip/deflate content encoding handling 2014-02-12 13:00:13 +01:00
Sebastian Dröge 9cac68709a souphttpsrc: Retry connection if we're finished before the content size only if we actually have a content size
https://bugzilla.gnome.org/show_bug.cgi?id=722185
2014-02-12 12:39:10 +01:00
Sebastian Dröge 436d41fa8e souputils: Fix compiler warning
gstsouputils.c:35:25: error: comparison of constant 9 with expression of type
      'SoupLoggerLogLevel' is always false
      [-Werror,-Wtautological-constant-out-of-range-compare]
2014-02-12 10:08:50 +01:00
Reynaldo H. Verdejo Pinochet 4f42fff349 souphttp*: add ability to do HTTP session logging
This changeset adds the loggin infrastructure and
mods both souphttpsrc and souphttclientsink to use it.

https://bugzilla.gnome.org/show_bug.cgi?id=721764
2014-02-11 17:50:44 -03:00
Sebastian Dröge cf31a4284b souphttpsrc: Add mapping for NOT_FOUND and NOT_AUTHORIZED errors 2014-02-11 13:25:46 +01:00
Sebastian Dröge 5514bc2785 souphttpsrc: Don't duplicate status_code to GStreamer error mapping 2014-02-11 13:25:22 +01:00
Reynaldo H. Verdejo Pinochet 0e159e3b03 souphttpsrc: use status code macro instead of 407
Rest of the code is using the _PROXY_AUTHENTICATION_REQUIRED
macro too. Easier to understand if you don't recall HTTP
error codes by heart.
2014-01-03 14:15:59 -03:00
Thiago Santos 856c07ea00 souphttpsrc: do not emit EOS when connection drops
If the pipeline is stalled for too long, souphttpsrc will block and
stop fetching data from the network. This can cause the connection to
drop and souphttpsrc would handle it as an EOS. This patch makes it
persist and try to fetch more data until the end of the content length
or until receiving an error that it is beyong limits in case the content
is unknown.

https://bugzilla.gnome.org/show_bug.cgi?id=683536
2013-10-11 16:10:16 -03:00
Thiago Santos c84282b9a6 souphttpsrc: do not do http requests in READY
HEAD requests to discover if the server is seekable shouldn't be done in
READY as it might lock the main thread that is doing the state change.

https://bugzilla.gnome.org/show_bug.cgi?id=705371
2013-09-18 18:36:38 +02:00
Tim-Philipp Müller 604bfa586e soup: don't use deprecated soup_message_headers_get() API 2013-08-14 11:54:19 +01:00
Andoni Morales Alastruey 24b4ea3418 souphttpsrc: fix critical setting a NULL uri redirection 2013-08-13 12:02:29 +02:00
Andoni Morales Alastruey b9faeab236 souphttpsrc: add redirection to the URI query 2013-08-12 16:40:26 +02:00
Arnaud Vrac e67655608c souphttpsrc: always ignore HEAD errors
https://bugzilla.gnome.org/show_bug.cgi?id=704241
2013-07-25 18:01:30 +02:00
Thiago Santos 9a7321872f souphttpsrc: ignore errors from HEAD request
HEAD requests are used to check the server headers to see if it
seekable. Ignore errors from those requests as they shouldn't be
critical.

https://bugzilla.gnome.org/show_bug.cgi?id=704053
2013-07-12 10:01:26 +02:00
Andoni Morales Alastruey 66dbe3151a souphttpsrc: also consider stop positions in seeks
Use seek stop position as range end for requests

https://bugzilla.gnome.org/show_bug.cgi?id=702206
2013-07-01 13:55:13 -03:00
Thiago Santos 5bc5f4a0f6 souphttpsrc: allow seeks in ready
On is_seekable, check if the server's headers have already been
received. If not, do a HEAD request to get them before responding
to basesrc.

https://bugzilla.gnome.org/show_bug.cgi?id=702206
2013-07-01 13:55:13 -03:00
Sebastian Dröge c43e7001ab souphttpsrc: Don't consider the content size from the HTTP headers as absolutely correct
The HTTP server could give wrong information, e.g. if the HTTP stream is
chunk-encoded or compressed, or if the server does not know the complete size
at the time when the file is requested by the client.

Also see
https://bugs.webkit.org/show_bug.cgi?id=115354
2013-05-04 13:22:04 +02:00
Philippe Normand d975a70f12 souphttpsrc: fix SCHEDULING query support
Chain the query up to parent before adding _BANDWIDTH_LIMITED flag,
so that all the other flags get set, and push mode gets added as
supported activation mode.

https://bugzilla.gnome.org/show_bug.cgi?id=693484
https://bugzilla.gnome.org/show_bug.cgi?id=698156
2013-04-16 19:53:18 +01:00
Philippe Normand b857cb38dd souphttpsrc: basic scheduling query support
Answer to scheduling queries with default parameters and the new
_BANDWIDTH_LIMITED_FLAG so that downstream is advised to minimize seek
operations and perform on-disk buffering if possible.

Bug 693484
2013-04-16 16:46:20 +02:00
Sebastian Dröge b0b0557c48 gst: Add better support for static plugins 2013-04-15 15:54:11 +02:00