Mercurial > pidgin
annotate src/protocols/msn/httpconn.h @ 14112:e149556f7569
[gaim-migrate @ 16746]
Alright, SVN gaim_proxy_connect()'s are good
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 14 Aug 2006 07:00:26 +0000 |
parents | 614c56622453 |
children |
rev | line source |
---|---|
10463 | 1 /** |
2 * @file httpconn.h HTTP connection | |
3 * | |
4 * gaim | |
5 * | |
6 * Gaim is the legal property of its developers, whose names are too numerous | |
7 * to list here. Please refer to the COPYRIGHT file distributed with this | |
8 * source distribution. | |
9 * | |
10 * This program is free software; you can redistribute it and/or modify | |
11 * it under the terms of the GNU General Public License as published by | |
12 * the Free Software Foundation; either version 2 of the License, or | |
13 * (at your option) any later version. | |
14 * | |
15 * This program is distributed in the hope that it will be useful, | |
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 * GNU General Public License for more details. | |
19 * | |
20 * You should have received a copy of the GNU General Public License | |
21 * along with this program; if not, write to the Free Software | |
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
23 */ | |
24 #ifndef _MSN_HTTPCONN_H_ | |
25 #define _MSN_HTTPCONN_H_ | |
26 | |
27 typedef struct _MsnHttpConn MsnHttpConn; | |
28 | |
13951 | 29 #include "circbuffer.h" |
10463 | 30 #include "servconn.h" |
31 | |
10481 | 32 /** |
33 * An HTTP Connection. | |
34 */ | |
10463 | 35 struct _MsnHttpConn |
36 { | |
10481 | 37 MsnSession *session; /**< The MSN Session. */ |
38 MsnServConn *servconn; /**< The connection object. */ | |
10463 | 39 |
14112 | 40 GaimProxyConnectInfo *connect_info; |
41 | |
10481 | 42 char *full_session_id; /**< The full session id. */ |
43 char *session_id; /**< The trimmed session id. */ | |
10463 | 44 |
10481 | 45 int timer; /**< The timer for polling. */ |
10463 | 46 |
10481 | 47 gboolean waiting_response; /**< The flag that states if we are waiting |
48 a response from the server. */ | |
49 gboolean connected; /**< The flag that states if the connection is on. */ | |
50 gboolean virgin; /**< The flag that states if this connection | |
51 should specify the host (not gateway) to | |
52 connect to. */ | |
10463 | 53 |
10481 | 54 char *host; /**< The HTTP gateway host. */ |
13914 | 55 GList *queue; /**< The queue of data chunks to write. */ |
10463 | 56 |
10481 | 57 int fd; /**< The connection's file descriptor. */ |
13200
33bef17125c2
[gaim-migrate @ 15563]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10481
diff
changeset
|
58 guint inpa; /**< The connection's input handler. */ |
10463 | 59 |
10481 | 60 char *rx_buf; /**< The receive buffer. */ |
13200
33bef17125c2
[gaim-migrate @ 15563]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10481
diff
changeset
|
61 int rx_len; /**< The receive buffer length. */ |
33bef17125c2
[gaim-migrate @ 15563]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10481
diff
changeset
|
62 |
33bef17125c2
[gaim-migrate @ 15563]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10481
diff
changeset
|
63 GaimCircBuffer *tx_buf; |
33bef17125c2
[gaim-migrate @ 15563]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
10481
diff
changeset
|
64 guint tx_handler; |
10463 | 65 }; |
66 | |
10481 | 67 /** |
68 * Creates a new HTTP connection object. | |
69 * | |
70 * @param servconn The connection object. | |
71 * | |
72 * @return The new object. | |
73 */ | |
10463 | 74 MsnHttpConn *msn_httpconn_new(MsnServConn *servconn); |
75 | |
76 /** | |
10481 | 77 * Destroys an HTTP connection object. |
10463 | 78 * |
10481 | 79 * @param httpconn The HTTP connection object. |
10463 | 80 */ |
10481 | 81 void msn_httpconn_destroy(MsnHttpConn *httpconn); |
10463 | 82 |
83 /** | |
10481 | 84 * Writes a chunk of data to the HTTP connection. |
10463 | 85 * |
86 * @param servconn The server connection. | |
10481 | 87 * @param data The data to write. |
13914 | 88 * @param data_len The size of the data to write. |
10463 | 89 * |
90 * @return The number of bytes written. | |
91 */ | |
13914 | 92 ssize_t msn_httpconn_write(MsnHttpConn *httpconn, const char *data, size_t data_len); |
10463 | 93 |
94 /** | |
10481 | 95 * Connects the HTTP connection object to a host. |
10463 | 96 * |
10481 | 97 * @param httpconn The HTTP connection object. |
98 * @param host The host to connect to. | |
99 * @param port The port to connect to. | |
100 */ | |
101 gboolean msn_httpconn_connect(MsnHttpConn *httpconn, | |
102 const char *host, int port); | |
103 | |
104 /** | |
105 * Disconnects the HTTP connection object. | |
10463 | 106 * |
10481 | 107 * @param httpconn The HTTP connection object. |
10463 | 108 */ |
10481 | 109 void msn_httpconn_disconnect(MsnHttpConn *httpconn); |
10463 | 110 |
111 #endif /* _MSN_HTTPCONN_H_ */ |