Mercurial > pidgin.yaz
comparison libpurple/protocols/msn/directconn.h @ 31292:47b6eda87723
propagate from branch 'im.pidgin.pidgin' (head 07d0765c444a097af45c2650f54323afb900a07b)
to branch 'im.pidgin.soc.2010.msn-tlc' (head f3998422a4724ab424e4e2328f58fc0504856557)
author | masca@cpw.pidgin.im |
---|---|
date | Mon, 19 Jul 2010 21:11:32 +0000 |
parents | b7a814c4c4e9 |
children | 23be655cc688 |
comparison
equal
deleted
inserted
replaced
30698:e874875a74a7 | 31292:47b6eda87723 |
---|---|
28 | 28 |
29 #include "network.h" | 29 #include "network.h" |
30 #include "proxy.h" | 30 #include "proxy.h" |
31 #include "circbuffer.h" | 31 #include "circbuffer.h" |
32 | 32 |
33 #include "msg.h" | |
34 #include "slp.h" | 33 #include "slp.h" |
35 #include "slplink.h" | 34 #include "slplink.h" |
36 #include "slpmsg.h" | 35 #include "slpmsg.h" |
36 #include "slpmsg_part.h" | |
37 #include "p2p.h" | |
38 | |
39 #define MSN_DCCONN_MAX_SIZE 1352 | |
37 | 40 |
38 typedef enum | 41 typedef enum |
39 { | 42 { |
40 DC_STATE_CLOSED, /*< No socket opened yet */ | 43 DC_STATE_CLOSED, /*< No socket opened yet */ |
41 DC_STATE_FOO, /*< Waiting for FOO message */ | 44 DC_STATE_FOO, /*< Waiting for FOO message */ |
66 struct _MsnDirectConnPacket { | 69 struct _MsnDirectConnPacket { |
67 guint32 length; | 70 guint32 length; |
68 guchar *data; | 71 guchar *data; |
69 | 72 |
70 void (*sent_cb)(struct _MsnDirectConnPacket*); | 73 void (*sent_cb)(struct _MsnDirectConnPacket*); |
71 MsnMessage *msg; | 74 MsnSlpMessagePart *part; |
72 }; | 75 }; |
73 | 76 |
74 struct _MsnDirectConn | 77 struct _MsnDirectConn |
75 { | 78 { |
76 MsnDirectConnState state; /**< Direct connection status */ | 79 MsnDirectConnState state; /**< Direct connection status */ |
98 int in_size; /**< The receive buffer size */ | 101 int in_size; /**< The receive buffer size */ |
99 int in_pos; /**< The first free position in receive buffer */ | 102 int in_pos; /**< The first free position in receive buffer */ |
100 GQueue *out_queue; /**< The outgoing packet queue */ | 103 GQueue *out_queue; /**< The outgoing packet queue */ |
101 int msg_pos; /**< The position of next byte to be sent in the actual packet */ | 104 int msg_pos; /**< The position of next byte to be sent in the actual packet */ |
102 | 105 |
103 MsnSlpHeader header; /**< SLP header for parsing / serializing */ | 106 MsnP2PHeader header; /**< SLP header for parsing / serializing */ |
104 | 107 |
105 /** The callback used for sending information to the peer about the opened socket */ | 108 /** The callback used for sending information to the peer about the opened socket */ |
106 void (*send_connection_info_msg_cb)(MsnDirectConn *); | 109 void (*send_connection_info_msg_cb)(MsnDirectConn *); |
107 | 110 |
108 gchar *ext_ip; /**< Our external IP address */ | 111 gchar *ext_ip; /**< Our external IP address */ |
122 #define DC_TIMEOUT (60) | 125 #define DC_TIMEOUT (60) |
123 | 126 |
124 /* | 127 /* |
125 * Queues an MSN message to be sent via direct connection. | 128 * Queues an MSN message to be sent via direct connection. |
126 */ | 129 */ |
130 #if 0 | |
127 void | 131 void |
128 msn_dc_enqueue_msg(MsnDirectConn *dc, MsnMessage *msg); | 132 msn_dc_enqueue_msg(MsnDirectConn *dc, MsnMessage *msg); |
133 #endif | |
134 void | |
135 msn_dc_enqueue_part(MsnDirectConn *dc, MsnSlpMessagePart *part); | |
129 | 136 |
130 /* | 137 /* |
131 * Creates, initializes, and returns a new MsnDirectConn structure. | 138 * Creates, initializes, and returns a new MsnDirectConn structure. |
132 */ | 139 */ |
133 MsnDirectConn * | 140 MsnDirectConn * |