GNOME Bugzilla – Bug 709795
curlsftpsink - new libcurl-based sink element for SFTP
Last modified: 2013-11-01 16:22:23 UTC
Created attachment 256880 [details] [review] Implements a sink element which uploads data to a SFTP server I extended the collection of curl-based sink elements with a new one supporting SFTP (SSH File Transfer Protocol). The sink acts as a client and uploads data to a SFTP server.
Review of attachment 256880 [details] [review]: ::: ext/curl/Makefile.am @@ +1,3 @@ plugin_LTLIBRARIES = libgstcurl.la +if USE_SSH2 You should probably add the SSH2 CFLAGS and LIBS to the CFLAGS and LIBADD variables too ::: ext/curl/gstcurlsftpsink.c @@ +31,3 @@ + * gst-launch filesrc location=/home/jdoe/some.file ! curlsftpsink \ + * file-name=some.file.backup \ + * user=john location=sftp://192.168.0.1/~/sftp_tests/ \ Why not combine location and filename? ::: ext/curl/gstcurlsshsink.c @@ +141,3 @@ + + g_object_class_install_property (gobject_class, PROP_SSH_PVT_KEYFILE, + g_param_spec_string ("ssh-pvt-keyfile", pvt -> priv? @@ +201,3 @@ + + gst_element_get_state (GST_ELEMENT (sink), &cur_state, NULL, 0); + if (cur_state != GST_STATE_PLAYING && cur_state != GST_STATE_PAUSED) { maybe inverse this and return, instead of indenting the complete block below @@ +371,3 @@ + * is also set! */ + if ((curl_err = curl_easy_setopt (bcsink->curl, CURLOPT_SSH_KEYFUNCTION, + klass->curl_sshkey_cb)) != CURLE_OK) { Why is the callback stored in the class?
Review of attachment 256880 [details] [review]: I will upload a new patch updated according to your remarks. Hope I didn't missed anything. Thanks for the quick feedback, btw. ::: ext/curl/gstcurlsftpsink.c @@ +31,3 @@ + * gst-launch filesrc location=/home/jdoe/some.file ! curlsftpsink \ + * file-name=some.file.backup \ + * user=john location=sftp://192.168.0.1/~/sftp_tests/ \ That was a design decision made earlier (see gstcurlbasesink.c) and, as I understand it, it gives us more flexibility having it this way. The file name can change dynamically while the pipeline is PLAYING (for example it can get a timestamp appended as suffix) while the destination location remains the same. The effective upload is handled in a separate thread which gets notified of file name changes.
Created attachment 257002 [details] [review] ...updates according to the first review...
commit 15717842e426187635d934c16b1f2ddd6b96eb2a Author: L. Sorin <sorin@axis.com> Date: Fri Oct 4 12:48:10 2013 +0200 curl: curlsftpsink - new libcurl-based sink element for SFTP Note: SFTP = SSH File Transfer Protocol The sink acts as a client and uploads data to the SFTP server. https://bugzilla.gnome.org/show_bug.cgi?id=709795