curlsshsink: use the locally defined types
authorL. Sorin <sorin@axis.com>
Thu, 12 Jun 2014 14:59:46 +0000 (16:59 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Sun, 26 Oct 2014 21:04:02 +0000 (21:04 +0000)
Just a matter of coding style, makes the code a bit tidier...

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

ext/curl/gstcurlsshsink.c
ext/curl/gstcurlsshsink.h

index 0959413..d2dac8d 100644 (file)
@@ -179,7 +179,7 @@ gst_curl_ssh_sink_class_init (GstCurlSshSinkClass * klass)
 static void
 gst_curl_ssh_sink_init (GstCurlSshSink * sink)
 {
-  sink->ssh_auth_type = CURLSSH_AUTH_NONE;
+  sink->ssh_auth_type = GST_CURLSSH_AUTH_NONE;
   sink->ssh_pub_keyfile = NULL;
   sink->ssh_priv_keyfile = NULL;
   sink->ssh_key_passphrase = NULL;
@@ -373,8 +373,8 @@ gst_curl_ssh_sink_set_options_unlocked (GstCurlBaseSink * bcsink)
 
   /* make sure we only accept PASSWORD or PUBLICKEY auth methods
    * (can be extended later) */
-  if (sink->ssh_auth_type == CURLSSH_AUTH_PASSWORD ||
-      sink->ssh_auth_type == CURLSSH_AUTH_PUBLICKEY) {
+  if (sink->ssh_auth_type == GST_CURLSSH_AUTH_PASSWORD ||
+      sink->ssh_auth_type == GST_CURLSSH_AUTH_PUBLICKEY) {
 
     /* set the SSH_AUTH_TYPE */
     if ((curl_err = curl_easy_setopt (bcsink->curl, CURLOPT_SSH_AUTH_TYPES,
@@ -385,7 +385,7 @@ gst_curl_ssh_sink_set_options_unlocked (GstCurlBaseSink * bcsink)
     }
 
     /* if key authentication -> provide the private key passphrase as well */
-    if (sink->ssh_auth_type == CURLSSH_AUTH_PUBLICKEY) {
+    if (sink->ssh_auth_type == GST_CURLSSH_AUTH_PUBLICKEY) {
       if (sink->ssh_key_passphrase) {
         if ((curl_err = curl_easy_setopt (bcsink->curl, CURLOPT_KEYPASSWD,
                     sink->ssh_key_passphrase)) != CURLE_OK) {
index 1b56c4d..376f1b1 100644 (file)
@@ -38,9 +38,10 @@ G_BEGIN_DECLS
   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CURL_SSH_SINK))
 #define GST_IS_CURL_SSH_SINK_CLASS(klass) \
   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CURL_SSH_SINK))
-/* see <curl/curl.h> */
-    typedef enum
+
+typedef enum
 {
+  /* Keep these in sync with the libcurl definitions. See <curl/curl.h> */
   GST_CURLSSH_AUTH_NONE = CURLSSH_AUTH_NONE,
   GST_CURLSSH_AUTH_PUBLICKEY = CURLSSH_AUTH_PUBLICKEY,
   GST_CURLSSH_AUTH_PASSWORD = CURLSSH_AUTH_PASSWORD
@@ -55,9 +56,10 @@ struct _GstCurlSshSink
   GstCurlBaseSink parent;
 
   /*< private > */
-  guint ssh_auth_type;          /* for now, supporting only:
-                                   CURLSSH_AUTH_PASSWORD  (passwd auth) OR
-                                   CURLSSH_AUTH_PUBLICKEY (pub/pvt key auth) */
+  /* for now, supporting only:
+   * GST_CURLSSH_AUTH_PASSWORD (password authentication) and
+   * GST_CURLSSH_AUTH_PUBLICKEY (public key authentication) */
+  GstCurlSshAuthType ssh_auth_type;
 
   gchar *ssh_pub_keyfile;       /* filename for the public key:
                                    CURLOPT_SSH_PUBLIC_KEYFILE */