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
This commit is contained in:
L. Sorin 2014-06-12 16:59:46 +02:00 committed by Tim-Philipp Müller
parent 62e28d2287
commit 09f0b03762
2 changed files with 11 additions and 9 deletions

View file

@ -179,7 +179,7 @@ gst_curl_ssh_sink_class_init (GstCurlSshSinkClass * klass)
static void static void
gst_curl_ssh_sink_init (GstCurlSshSink * sink) 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_pub_keyfile = NULL;
sink->ssh_priv_keyfile = NULL; sink->ssh_priv_keyfile = NULL;
sink->ssh_key_passphrase = 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 /* make sure we only accept PASSWORD or PUBLICKEY auth methods
* (can be extended later) */ * (can be extended later) */
if (sink->ssh_auth_type == CURLSSH_AUTH_PASSWORD || if (sink->ssh_auth_type == GST_CURLSSH_AUTH_PASSWORD ||
sink->ssh_auth_type == CURLSSH_AUTH_PUBLICKEY) { sink->ssh_auth_type == GST_CURLSSH_AUTH_PUBLICKEY) {
/* set the SSH_AUTH_TYPE */ /* set the SSH_AUTH_TYPE */
if ((curl_err = curl_easy_setopt (bcsink->curl, CURLOPT_SSH_AUTH_TYPES, 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 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 (sink->ssh_key_passphrase) {
if ((curl_err = curl_easy_setopt (bcsink->curl, CURLOPT_KEYPASSWD, if ((curl_err = curl_easy_setopt (bcsink->curl, CURLOPT_KEYPASSWD,
sink->ssh_key_passphrase)) != CURLE_OK) { sink->ssh_key_passphrase)) != CURLE_OK) {

View file

@ -38,9 +38,10 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CURL_SSH_SINK)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CURL_SSH_SINK))
#define GST_IS_CURL_SSH_SINK_CLASS(klass) \ #define GST_IS_CURL_SSH_SINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CURL_SSH_SINK)) (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_NONE = CURLSSH_AUTH_NONE,
GST_CURLSSH_AUTH_PUBLICKEY = CURLSSH_AUTH_PUBLICKEY, GST_CURLSSH_AUTH_PUBLICKEY = CURLSSH_AUTH_PUBLICKEY,
GST_CURLSSH_AUTH_PASSWORD = CURLSSH_AUTH_PASSWORD GST_CURLSSH_AUTH_PASSWORD = CURLSSH_AUTH_PASSWORD
@ -55,9 +56,10 @@ struct _GstCurlSshSink
GstCurlBaseSink parent; GstCurlBaseSink parent;
/*< private > */ /*< private > */
guint ssh_auth_type; /* for now, supporting only: /* for now, supporting only:
CURLSSH_AUTH_PASSWORD (passwd auth) OR * GST_CURLSSH_AUTH_PASSWORD (password authentication) and
CURLSSH_AUTH_PUBLICKEY (pub/pvt key auth) */ * GST_CURLSSH_AUTH_PUBLICKEY (public key authentication) */
GstCurlSshAuthType ssh_auth_type;
gchar *ssh_pub_keyfile; /* filename for the public key: gchar *ssh_pub_keyfile; /* filename for the public key:
CURLOPT_SSH_PUBLIC_KEYFILE */ CURLOPT_SSH_PUBLIC_KEYFILE */