[gvfs] afp: remove unused and crashy handling of Attention messages



commit 209bb3308bd31159796cd8a5750a165ba185a4e0
Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
Date:   Mon Aug 29 16:57:53 2011 +0200

    afp: remove unused and crashy handling of Attention messages
    
    this should fix bgo#657383

 daemon/gvfsafpserver.c |   76 ------------------------------------------------
 1 files changed, 0 insertions(+), 76 deletions(-)
---
diff --git a/daemon/gvfsafpserver.c b/daemon/gvfsafpserver.c
index ca1ff20..cfc2a7e 100644
--- a/daemon/gvfsafpserver.c
+++ b/daemon/gvfsafpserver.c
@@ -40,79 +40,6 @@ G_DEFINE_TYPE (GVfsAfpServer, g_vfs_afp_server, G_TYPE_OBJECT);
 #define AFP_UAM_DHX       "DHCAST128"
 #define AFP_UAM_DHX2      "DHX2"
 
-static void
-get_srvr_msg_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
-{
-  GVfsAfpConnection *afp_conn = G_VFS_AFP_CONNECTION (source_object);
-  
-  GVfsAfpReply *reply;
-  AfpResultCode res_code;
-  
-  gint16 message_bitmap;
-
-  reply = g_vfs_afp_connection_send_command_finish (afp_conn, res, NULL);
-  if (!reply)
-    return;
-
-  res_code = g_vfs_afp_reply_get_result_code (reply);
-  if (res_code != AFP_RESULT_NO_ERROR)
-  {
-    g_object_unref (reply);
-    return;
-  }
-  
-  /* MessageType */
-  g_vfs_afp_reply_read_int16 (reply, NULL);
-  /* MessageBitmap */
-  g_vfs_afp_reply_read_int16 (reply, &message_bitmap);
-
-  if (message_bitmap == 0x1)
-  {
-    char *str;
-
-    g_vfs_afp_reply_read_pascal (reply, &str);
-
-    g_debug ("Server message: %s\n", str);
-    g_free (str);
-  }
-  else if (message_bitmap == 0x2)
-  {
-    GVfsAfpName *afp_name;
-    char *str;
-    
-    g_vfs_afp_reply_read_afp_name (reply, TRUE, &afp_name);
-    str = g_vfs_afp_name_get_string (afp_name);
-    g_vfs_afp_name_unref (afp_name);
-
-    g_debug ("Server message: %s\n", str);
-    g_free (str);
-  }
-
-  g_object_unref (reply);
-}
-
-static void
-attention_cb (GVfsAfpConnection *conn, guint attention_code, gpointer user_data)
-{
-  GVfsAfpServer *afp_serv = G_VFS_AFP_SERVER (user_data);
-
-  if (attention_code & AFP_ATTENTION_MASK_SERVER_MESSAGE_BIT)
-  {
-    GVfsAfpCommand *comm;
-
-    comm = g_vfs_afp_command_new (AFP_COMMAND_GET_SRVR_MSG);
-    /* pad byte */
-    g_vfs_afp_command_put_byte (comm, 0);
-    /* MessageType */
-    g_vfs_afp_command_put_int16 (comm, 1);
-    /* MessageBitmap */
-    g_vfs_afp_command_put_int16 (comm, 1);
-
-    g_vfs_afp_connection_send_command (afp_serv->conn, comm, NULL,
-                                       get_srvr_msg_cb, NULL, afp_serv);
-    g_object_unref (comm);
-  }
-}
 
 static const char *
 afp_version_to_string (AfpVersion afp_version)
@@ -1018,9 +945,6 @@ g_vfs_afp_server_new (GNetworkAddress *addr)
 
   afp_serv->addr = addr;
   afp_serv->conn = g_vfs_afp_connection_new (G_SOCKET_CONNECTABLE (addr));
-
-  g_signal_connect (afp_serv->conn, "attention", G_CALLBACK (attention_cb),
-                    afp_serv);
   
   return afp_serv;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]