From 09f0b037629a3e59d9e63c7083f59df9d9fd9db5 Mon Sep 17 00:00:00 2001 From: "L. Sorin" Date: Thu, 12 Jun 2014 16:59:46 +0200 Subject: [PATCH] curlsshsink: use the locally defined types 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 | 8 ++++---- ext/curl/gstcurlsshsink.h | 12 +++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ext/curl/gstcurlsshsink.c b/ext/curl/gstcurlsshsink.c index 0959413..d2dac8d 100644 --- a/ext/curl/gstcurlsshsink.c +++ b/ext/curl/gstcurlsshsink.c @@ -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) { diff --git a/ext/curl/gstcurlsshsink.h b/ext/curl/gstcurlsshsink.h index 1b56c4d..376f1b1 100644 --- a/ext/curl/gstcurlsshsink.h +++ b/ext/curl/gstcurlsshsink.h @@ -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 */ - typedef enum + +typedef enum { + /* Keep these in sync with the libcurl definitions. See */ 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 */ -- 2.7.4