comparison libpurple/protocols/jabber/bosh.c @ 25996:349e411da2ce

Rearrange the structs and fix the indentation. No functional changes.
author Paul Aurich <paul@darkrain42.org>
date Mon, 16 Mar 2009 06:38:24 +0000
parents e995540378f0
children c605e5f2fc99
comparison
equal deleted inserted replaced
25995:e995540378f0 25996:349e411da2ce
42 PACKET_STREAM_RESTART, 42 PACKET_STREAM_RESTART,
43 PACKET_NORMAL, 43 PACKET_NORMAL,
44 } PurpleBOSHPacketType; 44 } PurpleBOSHPacketType;
45 45
46 struct _PurpleBOSHConnection { 46 struct _PurpleBOSHConnection {
47 /* decoded URL */ 47 JabberStream *js;
48 char *host; 48 gboolean pipelining;
49 int port;
50 char *path;
51
52 /* Must be big enough to hold 2^53 - 1 */
53 guint64 rid;
54 char *sid;
55 int wait;
56
57 JabberStream *js;
58 gboolean pipelining;
59 PurpleHTTPConnection *connections[MAX_HTTP_CONNECTIONS]; 49 PurpleHTTPConnection *connections[MAX_HTTP_CONNECTIONS];
60 50
51 gboolean ready;
52
53 /* decoded URL */
54 char *host;
55 int port;
56 char *path;
57
58 /* Must be big enough to hold 2^53 - 1 */
59 guint64 rid;
60 char *sid;
61
61 unsigned int inactivity_timer; 62 unsigned int inactivity_timer;
62
63 int max_inactivity; 63 int max_inactivity;
64 int wait;
65
66 GString *pending;
64 int max_requests; 67 int max_requests;
65 int requests; 68 int requests;
66 GString *pending; 69
67 70 PurpleBOSHConnectionConnectFunction connect_cb;
68 gboolean ready; 71 PurpleBOSHConnectionReceiveFunction receive_cb;
69 PurpleBOSHConnectionConnectFunction connect_cb;
70 PurpleBOSHConnectionReceiveFunction receive_cb;
71 }; 72 };
72 73
73 struct _PurpleHTTPConnection { 74 struct _PurpleHTTPConnection {
74 int fd; 75 PurpleBOSHConnection *bosh;
76 int fd;
77 int ie_handle;
78
75 gboolean ready; 79 gboolean ready;
76 int ie_handle;
77 int requests; /* number of outstanding HTTP requests */ 80 int requests; /* number of outstanding HTTP requests */
78 81
79 GString *buf; 82 GString *buf;
80 gboolean headers_done; 83 gboolean headers_done;
81 gsize handled_len; 84 gsize handled_len;
82 gsize body_len; 85 gsize body_len;
83 86
84 PurpleBOSHConnection *bosh;
85 }; 87 };
86 88
87 static void jabber_bosh_connection_stream_restart(PurpleBOSHConnection *conn); 89 static void jabber_bosh_connection_stream_restart(PurpleBOSHConnection *conn);
88 static gboolean jabber_bosh_connection_error_check(PurpleBOSHConnection *conn, xmlnode *node); 90 static gboolean jabber_bosh_connection_error_check(PurpleBOSHConnection *conn, xmlnode *node);
89 static void jabber_bosh_connection_received(PurpleBOSHConnection *conn, xmlnode *node); 91 static void jabber_bosh_connection_received(PurpleBOSHConnection *conn, xmlnode *node);