changeset 30015:bcb5e6c2e5a3

Re-indent directconn.h, and fix a typo.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Thu, 18 Mar 2010 03:29:28 +0000
parents b1cda3f8fdc9
children 0ea33256f462
files libpurple/protocols/msn/directconn.c libpurple/protocols/msn/directconn.h libpurple/protocols/msn/slplink.c
diffstat 3 files changed, 48 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/directconn.c	Thu Mar 18 03:15:01 2010 +0000
+++ b/libpurple/protocols/msn/directconn.c	Thu Mar 18 03:29:28 2010 +0000
@@ -794,7 +794,7 @@
 
 		/* TODO: Check! */
 		msn_dc_send_handshake_reply(dc);
-		dc->state = DC_STATE_ESTABILISHED;
+		dc->state = DC_STATE_ESTABLISHED;
 
 		msn_slpcall_session_init(dc->slpcall);
 		dc->slpcall = NULL;
@@ -803,13 +803,13 @@
 
 	case DC_STATE_HANDSHAKE_REPLY:
 		/* TODO: Check! */
-		dc->state = DC_STATE_ESTABILISHED;
+		dc->state = DC_STATE_ESTABLISHED;
 
 		msn_slpcall_session_init(dc->slpcall);
 		dc->slpcall = NULL;
 		break;
 
-	case DC_STATE_ESTABILISHED:
+	case DC_STATE_ESTABLISHED:
 		msn_slplink_process_msg(
 			dc->slplink,
 			&dc->header,
@@ -952,7 +952,7 @@
 
 		purple_debug_warning("msn", "msn_dc_recv_cb: recv error\n");
 
-		if(dc->state != DC_STATE_ESTABILISHED)
+		if(dc->state != DC_STATE_ESTABLISHED)
 			msn_dc_fallback_to_p2p(dc);
 		else
 			msn_dc_destroy(dc);
@@ -962,7 +962,7 @@
 		/* EOF. Remote side closed connection. */
 		purple_debug_info("msn", "msn_dc_recv_cb: recv EOF\n");
 
-		if(dc->state != DC_STATE_ESTABILISHED)
+		if(dc->state != DC_STATE_ESTABLISHED)
 			msn_dc_fallback_to_p2p(dc);
 		else
 			msn_dc_destroy(dc);
--- a/libpurple/protocols/msn/directconn.h	Thu Mar 18 03:15:01 2010 +0000
+++ b/libpurple/protocols/msn/directconn.h	Thu Mar 18 03:29:28 2010 +0000
@@ -37,11 +37,11 @@
 
 typedef enum
 {
-	DC_STATE_CLOSED,		/*< No socket opened yet */
-	DC_STATE_FOO,			/*< Waiting for FOO message */
-	DC_STATE_HANDSHAKE,		/*< Waiting for handshake message */
-	DC_STATE_HANDSHAKE_REPLY,	/*< Waiting for handshake reply message */
-	DC_STATE_ESTABILISHED		/*< Handshake complete */
+	DC_STATE_CLOSED,            /*< No socket opened yet */
+	DC_STATE_FOO,               /*< Waiting for FOO message */
+	DC_STATE_HANDSHAKE,         /*< Waiting for handshake message */
+	DC_STATE_HANDSHAKE_REPLY,   /*< Waiting for handshake reply message */
+	DC_STATE_ESTABLISHED        /*< Handshake complete */
 } MsnDirectConnState;
 
 typedef enum
@@ -56,52 +56,52 @@
 typedef struct _MsnDirectConnPacket MsnDirectConnPacket;
 
 struct _MsnDirectConnPacket {
-	guint32		length;
-	guchar		*data;
+	guint32     length;
+	guchar      *data;
 
-	void		(*sent_cb)(struct _MsnDirectConnPacket*);
-	MsnMessage	*msg;
+	void        (*sent_cb)(struct _MsnDirectConnPacket*);
+	MsnMessage  *msg;
 };
 
 struct _MsnDirectConn
 {
-	MsnDirectConnState	state;			/**< Direct connection status */
-	MsnSlpLink 		*slplink;		/**< The slplink using this direct connection */
-	MsnSlpCall		*slpcall;		/**< The slpcall which initiated the direct connection */
-	char			*msg_body;		/**< The body of message sent by send_connection_info_msg_cb */
-	MsnSlpMessage		*prev_ack;		/**< The saved SLP ACK message */
+	MsnDirectConnState  state;      /**< Direct connection status */
+	MsnSlpLink          *slplink;   /**< The slplink using this direct connection */
+	MsnSlpCall          *slpcall;   /**< The slpcall which initiated the direct connection */
+	char                *msg_body;  /**< The body of message sent by send_connection_info_msg_cb */
+	MsnSlpMessage       *prev_ack;  /**< The saved SLP ACK message */
 
-	guchar			nonce[16];		/**< The nonce used for direct connection handshake */
-	gchar			nonce_hash[37];		/**< The hash of nonce */
+	guchar  nonce[16];      /**< The nonce used for direct connection handshake */
+	gchar   nonce_hash[37]; /**< The hash of nonce */
 
-	PurpleNetworkListenData	*listen_data;		/**< The pending socket creation request */
-	PurpleProxyConnectData	*connect_data;		/**< The pending connection attempt */
-	int			listenfd;		/**< The socket we're listening for incoming connections */
-	guint			listenfd_handle;	/**< The timeout handle for incoming connection */
-	guint			connect_timeout_handle;	/**< The timeout handle for outgoing connection */
+	PurpleNetworkListenData *listen_data;           /**< The pending socket creation request */
+	PurpleProxyConnectData  *connect_data;          /**< The pending connection attempt */
+	int                     listenfd;               /**< The socket we're listening for incoming connections */
+	guint                   listenfd_handle;        /**< The timeout handle for incoming connection */
+	guint                   connect_timeout_handle; /**< The timeout handle for outgoing connection */
 
-	int			fd;			/**< The direct connection socket */
-	guint			recv_handle;		/**< The incoming data callback handle */
-	guint			send_handle;		/**< The outgoing data callback handle */
+	int     fd;             /**< The direct connection socket */
+	guint   recv_handle;    /**< The incoming data callback handle */
+	guint   send_handle;    /**< The outgoing data callback handle */
 
-	gchar			*in_buffer;		/**< The receive buffer */
-	int			in_size;		/**< The receive buffer size */
-	int			in_pos;			/**< The first free position in receive buffer */
-	GQueue			*out_queue;		/**< The outgoing packet queue */
-	int			msg_pos;		/**< The position of next byte to be sent in the actual packet */
+	gchar   *in_buffer; /**< The receive buffer */
+	int     in_size;    /**< The receive buffer size */
+	int     in_pos;     /**< The first free position in receive buffer */
+	GQueue  *out_queue; /**< The outgoing packet queue */
+	int     msg_pos;    /**< The position of next byte to be sent in the actual packet */
 
-	MsnSlpHeader		header;			/**< SLP header for parsing / serializing */
+	MsnSlpHeader    header; /**< SLP header for parsing / serializing */
 
-							/**< The callback used for sending information to the peer about the opened scoket */
-	void			(*send_connection_info_msg_cb)(struct _MsnDirectConn*);
+	/** The callback used for sending information to the peer about the opened socket */
+	void (*send_connection_info_msg_cb)(MsnDirectConn *);
 
-	gchar			*ext_ip;		/**< Our external IP address */
-	int			ext_port;		/**< Our external port */
+	gchar   *ext_ip;    /**< Our external IP address */
+	int     ext_port;   /**< Our external port */
 
-	guint			timeout_handle;
-	gboolean		progress;
+	guint       timeout_handle;
+	gboolean    progress;
 
-	//int			num_calls;		/**< The number of slpcalls using this direct connection */
+	//int   num_calls;  /**< The number of slpcalls using this direct connection */
 };
 
 #define DC_CONNECT_TIMEOUT 	5
@@ -114,9 +114,9 @@
 msn_dc_enqueue_msg(MsnDirectConn *dc, MsnMessage *msg);
 
 /*
- * Creates initializes and returns a new MsnDirectConn structure.
+ * Creates, initializes, and returns a new MsnDirectConn structure.
  */
-MsnDirectConn*
+MsnDirectConn *
 msn_dc_new(MsnSlpCall *slplink);
 
 /*
@@ -170,7 +170,7 @@
 
 /*
  * This callback will be called when the listening socket is successfully
- * created and it's parameters (IP/port) are available.
+ * created and its parameters (IP/port) are available.
  */
 void
 msn_dc_listen_socket_created_cb(int listenfd, gpointer data);
--- a/libpurple/protocols/msn/slplink.c	Thu Mar 18 03:15:01 2010 +0000
+++ b/libpurple/protocols/msn/slplink.c	Thu Mar 18 03:29:28 2010 +0000
@@ -157,7 +157,7 @@
 	slplink->slp_calls = g_list_append(slplink->slp_calls, slpcall);
 
 	/*
-	if (slplink->dc != NULL && slplink->dc->state == DC_STATE_ESTABILISHED)
+	if (slplink->dc != NULL && slplink->dc->state == DC_STATE_ESTABLISHED)
 		msn_dc_ref(slplink->dc);
 	*/
 }
@@ -166,7 +166,7 @@
 msn_slplink_remove_slpcall(MsnSlpLink *slplink, MsnSlpCall *slpcall)
 {
 	/*
-	if (slplink->dc != NULL && slplink->dc->state == DC_STATE_ESTABILISHED)
+	if (slplink->dc != NULL && slplink->dc->state == DC_STATE_ESTABLISHED)
 		msn_dc_unref(slplink->dc);
 	*/
 
@@ -219,7 +219,7 @@
 static void
 msn_slplink_send_msg(MsnSlpLink *slplink, MsnMessage *msg)
 {
-	if (slplink->dc != NULL && slplink->dc->state == DC_STATE_ESTABILISHED)
+	if (slplink->dc != NULL && slplink->dc->state == DC_STATE_ESTABLISHED)
 	{
 		msn_dc_enqueue_msg(slplink->dc, msg);
 	}