summaryrefslogtreecommitdiff
path: root/daemon/gvfsafpserver.c
diff options
context:
space:
mode:
authorCarl-Anton Ingmarsson <ca.ingmarsson@gmail.com>2011-08-25 18:03:23 +0200
committerChristian Kellner <gicmo@gnome.org>2011-08-25 21:19:57 +0200
commitecc1730d3bfdc11fa07f15893267a7ea054328f1 (patch)
tree6ffe2f0444507294a035c6332b0fed38b6b4bf22 /daemon/gvfsafpserver.c
parent87bc9f649e82d29ac27d4a3a55c994f375a0703c (diff)
downloadgvfs-ecc1730d3bfdc11fa07f15893267a7ea054328f1.tar.gz
afp: reuse g_vfs_afp_connection_send_command in the sync version
Diffstat (limited to 'daemon/gvfsafpserver.c')
-rw-r--r--daemon/gvfsafpserver.c50
1 files changed, 12 insertions, 38 deletions
diff --git a/daemon/gvfsafpserver.c b/daemon/gvfsafpserver.c
index ca1ff202..c2ec489f 100644
--- a/daemon/gvfsafpserver.c
+++ b/daemon/gvfsafpserver.c
@@ -208,13 +208,9 @@ dhx2_login (GVfsAfpServer *afp_serv,
g_vfs_afp_command_put_pascal (comm, username);
g_vfs_afp_command_pad_to_even (comm);
- res = g_vfs_afp_connection_send_command_sync (afp_serv->conn, comm,
- cancellable, error);
+ reply = g_vfs_afp_connection_send_command_sync (afp_serv->conn, comm,
+ cancellable, error);
g_object_unref (comm);
- if (!res)
- goto error;
-
- reply = g_vfs_afp_connection_read_reply_sync (afp_serv->conn, cancellable, error);
if (!reply)
goto error;
@@ -316,14 +312,9 @@ dhx2_login (GVfsAfpServer *afp_serv,
/* clientNonce */
g_output_stream_write_all (G_OUTPUT_STREAM (comm), clientNonce_buf, 16, NULL, NULL, NULL);
- res = g_vfs_afp_connection_send_command_sync (afp_serv->conn, comm,
- cancellable, error);
+ reply = g_vfs_afp_connection_send_command_sync (afp_serv->conn, comm,
+ cancellable, error);
g_object_unref (comm);
- if (!res)
- goto error;
-
-
- reply = g_vfs_afp_connection_read_reply_sync (afp_serv->conn, cancellable, error);
if (!reply)
goto error;
@@ -387,13 +378,9 @@ dhx2_login (GVfsAfpServer *afp_serv,
G_N_ELEMENTS (answer_buf), NULL, NULL, NULL);
- res = g_vfs_afp_connection_send_command_sync (afp_serv->conn, comm,
- cancellable, error);
+ reply = g_vfs_afp_connection_send_command_sync (afp_serv->conn, comm,
+ cancellable, error);
g_object_unref (comm);
- if (!res)
- goto error;
-
- reply = g_vfs_afp_connection_read_reply_sync (afp_serv->conn, cancellable, error);
if (!reply)
goto error;
@@ -522,13 +509,9 @@ dhx_login (GVfsAfpServer *afp_serv,
g_output_stream_write_all (G_OUTPUT_STREAM(comm), ma_buf, G_N_ELEMENTS (ma_buf),
NULL, NULL, NULL);
- res = g_vfs_afp_connection_send_command_sync (afp_serv->conn, comm,
- cancellable, error);
+ reply = g_vfs_afp_connection_send_command_sync (afp_serv->conn, comm,
+ cancellable, error);
g_object_unref (comm);
- if (!res)
- goto done;
-
- reply = g_vfs_afp_connection_read_reply_sync (afp_serv->conn, cancellable, error);
if (!reply)
goto error;
@@ -616,13 +599,9 @@ dhx_login (GVfsAfpServer *afp_serv,
G_N_ELEMENTS (answer_buf), NULL, NULL, NULL);
- res = g_vfs_afp_connection_send_command_sync (afp_serv->conn, comm,
- cancellable, error);
+ reply = g_vfs_afp_connection_send_command_sync (afp_serv->conn, comm,
+ cancellable, error);
g_object_unref (comm);
- if (!res)
- goto done;
-
- reply = g_vfs_afp_connection_read_reply_sync (afp_serv->conn, cancellable, error);
if (!reply)
goto error;
@@ -673,7 +652,6 @@ do_login (GVfsAfpServer *afp_serv,
if (anonymous)
{
GVfsAfpCommand *comm;
- gboolean res;
GVfsAfpReply *reply;
AfpResultCode res_code;
@@ -689,13 +667,9 @@ do_login (GVfsAfpServer *afp_serv,
g_vfs_afp_command_put_pascal (comm, afp_version_to_string (afp_serv->version));
g_vfs_afp_command_put_pascal (comm, AFP_UAM_NO_USER);
- res = g_vfs_afp_connection_send_command_sync (afp_serv->conn, comm,
- cancellable, error);
+ reply = g_vfs_afp_connection_send_command_sync (afp_serv->conn, comm,
+ cancellable, error);
g_object_unref (comm);
- if (!res)
- return FALSE;
-
- reply = g_vfs_afp_connection_read_reply_sync (afp_serv->conn, cancellable, error);
if (!reply)
return FALSE;