1. 17 Nov, 2019 1 commit
    • Alex Ashley's avatar
      curlhttpsrc: add support for range GET · e9c68347
      Alex Ashley authored
      To allow curlhttpsrc to support DASH streams that use the on-demand
      profile, it needs to support HTTP Range GETs. In GStreamer, the RANGE
      is specified by issuing a GST_FORMAT_BYTES seek to set the start and
      end of the range. curlhttpsrc needs to implement seek and set the
      appropriate curl options to make it add the Range header to the
  2. 05 Nov, 2019 1 commit
  3. 04 Nov, 2019 1 commit
  4. 14 Oct, 2019 1 commit
  5. 29 May, 2019 1 commit
  6. 13 May, 2019 3 commits
  7. 19 Feb, 2019 3 commits
    • Alex Ashley's avatar
      curlhttpsrc: set BUFFER_OFFSET when creating GstBuffer · dbe0a8cb
      Alex Ashley authored
      To make curlhttpsrc behave more like souphttpsrc, set the
      BUFFER_OFFSET in its output buffers to match the segment
      start. This means that in a HTTP RANGE request, the BUFFER_OFFSET
      will match the value in the RANGE request.
    • Alex Ashley's avatar
      curlhttpsrc: export same HTTP error status as souphttpsrc · 2d806477
      Alex Ashley authored
      To make it closer to a drop-in replacement for souphttpsrc,
      expose the same gst_error_message_with_details as souphttpsrc,
      so that applications can received the HTTP status code and reason
      when an error occurs.
    • Alex Ashley's avatar
      curlhttpsrc: fix various leaks and thread safety issues · c2fe4e58
      Alex Ashley authored
      curlhttpsrc uses a single thread running the
      gst_curl_http_src_curl_multi_loop() function to handle receiving
      data and messages from libcurl. Each instance of curlhttpsrc adds
      an entry into a queue in GstCurlHttpSrcMultiTaskContext and waits
      for the multi_loop to perform the HTTP request.
      Valgrind has shown up race conditions and memory leaks:
      1. gst_curl_http_src_change_state() does not wait for the multi_loop
         to complete before going to the NULL state, which means that
         an instance of GstCurlHttpSrc can be released while
         gst_curl_http_src_curl_multi_loop() still has a reference to it.
      2. if multiple elements try to be removed from the queue at once,
         only the last one is deleted.
      3. source->caps is leaked
      4. curl multi_handle is leaked
      5. leak of curl_handle if URI not set
      6. leak of http_headers when reusing element
      7. null pointer dereference in negotiate caps
      8. double-free of the default user-agent string
      9. leak of multi_task_context.task
      This commit changes the logic so that each element has a connection
      status, which is used by the multi_loop to decide when to remove an
      element from its queue. An instance of curlhttpsrc will not enter
      the NULL state until its reference has been removed from the queue.
      When shutting down the curl multi loop, the memory allocated from the
      call to curl_multi_init() is now released.
      When gstadaptivedemux uses a URI source element, it will re-use
      it for multiple requests, moving it between READY and PLAYING
      between each request. curlhttpsrc was leaking the http_headers
      structure in this use case.
      The gst_curl_http_src_negotiate_caps() function extracts the
      "response-headers" field from the http_headers, but did not check
      that this field might be NULL.
      If the user-agent property is set, the global user-agent string
      was freed. This caused a double-free error if the user-agent is
      ever set a second time during the execution of the process.
      There are situations within curlhttpsrc where the code needs
      both the global multi_task_context mutex and the per-element
      buffer_mutex. To avoid deadlocks, it is vital that the order in
      which these are requested is always the same. This commit modifies
      the locking order to always be in the order:
       1. multi_task_context.task_rec_mutex
       2. buffer_mutex
      Fixes #876
  8. 17 Dec, 2018 2 commits
  9. 06 Dec, 2018 2 commits
  10. 28 Oct, 2018 2 commits
  11. 16 Aug, 2018 1 commit
    • Wim Taymans's avatar
      curlhhtpsrc: avoid invalid memory references · cb16d0b2
      Wim Taymans authored
      gst_curl_http_src_remove_queue_item() can free qelement and then
      we get an invalid memory reference when we do qelement->next a
      couple of lines below. Take the next pointer earlier so that we can
      safely free.
  12. 17 Jul, 2018 1 commit
  13. 25 Apr, 2018 1 commit
  14. 24 Apr, 2018 1 commit
  15. 22 Jan, 2018 1 commit
  16. 22 Nov, 2017 1 commit
  17. 21 Nov, 2017 5 commits
  18. 09 Aug, 2017 1 commit
  19. 08 Aug, 2017 2 commits
  20. 27 Jul, 2017 1 commit
  21. 26 Jul, 2017 5 commits
  22. 16 May, 2017 1 commit
  23. 12 Apr, 2017 1 commit
  24. 16 Nov, 2016 1 commit