pidgin: 6ae0d990: Re-indent directconn.h, and fix a typo.
qulogic at pidgin.im
qulogic at pidgin.im
Fri May 21 18:03:26 EDT 2010
-----------------------------------------------------------------
Revision: 6ae0d990d00274ea8ef11df5609eef0cf9337535
Ancestor: e59acb27458314af13e98facad26c1b2d96e0959
Author: qulogic at pidgin.im
Date: 2010-03-18T03:29:28
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/6ae0d990d00274ea8ef11df5609eef0cf9337535
Modified files:
libpurple/protocols/msn/directconn.c
libpurple/protocols/msn/directconn.h
libpurple/protocols/msn/slplink.c
ChangeLog:
Re-indent directconn.h, and fix a typo.
-------------- next part --------------
============================================================
--- libpurple/protocols/msn/directconn.c b634feba282af9b49fd23fe0c5476bd9d279c2cc
+++ libpurple/protocols/msn/directconn.c dedbcc7fd29348492d9779fcb45091246d36b50c
@@ -794,7 +794,7 @@ msn_dc_process_packet(MsnDirectConn *dc,
/* 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 @@ msn_dc_process_packet(MsnDirectConn *dc,
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 @@ msn_dc_recv_cb(gpointer data, gint fd, P
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 @@ msn_dc_recv_cb(gpointer data, gint fd, P
/* 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);
============================================================
--- libpurple/protocols/msn/directconn.h 4995fe2b451123bc68977d468e006c26511e5cdb
+++ libpurple/protocols/msn/directconn.h 73642d30b7e86a563f3bc59386d0bea88b1a228e
@@ -37,11 +37,11 @@ typedef enum
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 @@ struct _MsnDirectConnPacket {
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, Ms
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 @@ msn_dc_outgoing_connection_timeout_cb(gp
/*
* 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);
============================================================
--- libpurple/protocols/msn/slplink.c a2bda037c93f9437ba0ca6ff8e83122842407af3
+++ libpurple/protocols/msn/slplink.c 80b294680c2edc92d7939fc473cfed0bd5442108
@@ -157,7 +157,7 @@ msn_slplink_add_slpcall(MsnSlpLink *slpl
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 *s
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 @@ msn_slplink_send_msg(MsnSlpLink *slplink
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);
}
More information about the Commits
mailing list