After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 641496 - New plugin: curlsink
New plugin: curlsink
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
unspecified
Other Linux
: Normal enhancement
: 0.10.22
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-02-04 14:42 UTC by Patricia Muscalu
Modified: 2011-03-01 11:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
CurlSink plugin (38.98 KB, text/x-csrc)
2011-02-04 14:42 UTC, Patricia Muscalu
Details
Header file for CurlSink plugin (1.84 KB, text/x-chdr)
2011-02-04 14:43 UTC, Patricia Muscalu
Details
CurSink plugin (39.79 KB, text/x-csrc)
2011-02-14 09:55 UTC, Patricia Muscalu
Details
Header file for CurlSink plugin (2.65 KB, text/x-chdr)
2011-02-14 09:55 UTC, Patricia Muscalu
Details

Description Patricia Muscalu 2011-02-04 14:42:13 UTC
Created attachment 180082 [details]
CurlSink plugin

This is a curl sink plugin for transferring data to a server using (currently) HTTP/HTTPS protocols.
Comment 1 Patricia Muscalu 2011-02-04 14:43:34 UTC
Created attachment 180084 [details]
Header file for CurlSink plugin
Comment 2 Tim-Philipp Müller 2011-02-06 10:23:02 UTC
Please could you add a license header with copyright to the top of both source files? (ideally LGPL v2.1 and later)
Comment 3 Tim-Philipp Müller 2011-02-10 12:59:28 UTC
Patricia: ping?
Comment 4 Patricia Muscalu 2011-02-14 09:55:00 UTC
Created attachment 180810 [details]
CurSink plugin

Added license header with copyright.
Comment 5 Patricia Muscalu 2011-02-14 09:55:49 UTC
Created attachment 180811 [details]
Header file for CurlSink plugin

Added license header with copyright.
Comment 6 Tim-Philipp Müller 2011-02-26 20:25:14 UTC
Thanks, license headers are fine now.

Now, how is one supposed to use this exactly?

I tried this, but it errors out before I even had a chance to point the browser towards it:

 $ gst-launch-0.10 v4l2src ! jpegenc ! multipartmux ! curlsink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstCurlSink:curlsink0: 100 continue response missing
Additional debug info:
gstcurlsink.c(994): gst_curl_sink_handle_transfer (): /GstPipeline:pipeline0/GstCurlSink:curlsink0
Execution ended after 628189737 ns.
Comment 7 Patricia Muscalu 2011-02-28 07:24:53 UTC
When doing POST requests, libcurl sets by defualt the "Expect: 100-Continue" HTTP header. This means that it will not post any data before an "OK" message is received. 

Example: Upload a JPEG file to an HTTP server:

gst-launch-0.10 filesrc blocksize=16384 location=image.jpg ! curlsink file-name=image.jpg location=http://192.168.0.1:8080/cgi-bin/patupload.cgi/ user=test passwd=test content-type=image/jpeg use-content-length=false
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 433697294 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
Comment 8 Tim-Philipp Müller 2011-02-28 09:54:00 UTC
Ah, I see. For some reason I was under the impression the sink would implement a simple http *server*, not just a client that posts stuff to a server.
Comment 9 Tim-Philipp Müller 2011-03-01 11:22:34 UTC
Thanks, pushed:

commit c6d7071d938d2acb5481f5e8ea9cf0e671a5c2b4
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Tue Mar 1 11:16:56 2011 +0000

    docs: add new curl plugin and curlsink element to docs

commit 1fe9c8c8ae2bf8456b5ac9b411a52de53ba95c3e
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Tue Mar 1 10:49:57 2011 +0000

    configure: also check for platform socket headers needed by curlsink element

commit eb5b3be384fca545273f4eeaeea47d28d9d2e2ab
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Tue Mar 1 10:03:07 2011 +0000

    curlsink: no need for a private instance structure
    
    The entire instance structure is private anyway.

commit 6f01abd85df9edf2a4592d83cb52fe9ef12f8bcf
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Tue Mar 1 09:56:51 2011 +0000

    curlsink: clean up property registration code
    
    Fix some typos, use same style as in all other plugins, avoiding
    unnecessary temporary GParamSpec variables; use G_PARAM_SPEC_STATIC_STRINGS.

commit 56c2cc0f83ce93de97714b119e478960d5dbb02e
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Sat Feb 26 20:21:25 2011 +0000

    curl: add configure check and hook up to build system

commit 16b79f6f2dd28db49fa5693a06da045132cb69d6
Author: Patricia Muscalu <patricia@axis.com>
Date:   Sat Feb 26 20:20:33 2011 +0000

    curl: add libcurl-based sink element
    
    Sink acts as a client and can connect to servers to
    upload media.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=641496