Mon, 22 Jul 2013 18:37:34 +0200
HTTP: get rid of one (of two) msn's own http implementations
|
10463
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
1 | /** |
|
34262
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
2 | * @file httpconn.h HTTP-tunnelled connections |
|
10463
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
3 | * |
| 15884 | 4 | * purple |
|
10463
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
5 | * |
| 15884 | 6 | * Purple is the legal property of its developers, whose names are too numerous |
|
10463
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
7 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
8 | * source distribution. |
|
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
9 | * |
|
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
10 | * This program is free software; you can redistribute it and/or modify |
|
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
11 | * it under the terms of the GNU General Public License as published by |
|
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
12 | * the Free Software Foundation; either version 2 of the License, or |
|
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
13 | * (at your option) any later version. |
|
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
14 | * |
|
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
15 | * This program is distributed in the hope that it will be useful, |
|
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
18 | * GNU General Public License for more details. |
|
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
19 | * |
|
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
20 | * You should have received a copy of the GNU General Public License |
|
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
21 | * along with this program; if not, write to the Free Software |
|
34262
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
10463
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
23 | */ |
|
29305
202cb72ed5b0
Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <markdoliner@pidgin.im>
parents:
23078
diff
changeset
|
24 | #ifndef MSN_HTTPCONN_H |
|
202cb72ed5b0
Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <markdoliner@pidgin.im>
parents:
23078
diff
changeset
|
25 | #define MSN_HTTPCONN_H |
|
10463
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
26 | |
|
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
27 | typedef struct _MsnHttpConn MsnHttpConn; |
|
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
28 | |
|
34262
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
29 | #include "internal.h" |
|
10463
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
30 | |
|
34262
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
31 | #include "msn.h" |
|
10463
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
32 | |
|
10481
a5d6b8e1717d
[gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10463
diff
changeset
|
33 | /** |
|
a5d6b8e1717d
[gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10463
diff
changeset
|
34 | * Creates a new HTTP connection object. |
|
a5d6b8e1717d
[gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10463
diff
changeset
|
35 | * |
|
a5d6b8e1717d
[gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10463
diff
changeset
|
36 | * @param servconn The connection object. |
|
a5d6b8e1717d
[gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10463
diff
changeset
|
37 | * |
|
34262
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
38 | * @return The new HTTP connection object. |
|
10481
a5d6b8e1717d
[gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10463
diff
changeset
|
39 | */ |
|
34262
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
40 | MsnHttpConn * |
|
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
41 | msn_httpconn_new(MsnServConn *servconn); |
|
10463
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
42 | |
|
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
43 | /** |
|
10481
a5d6b8e1717d
[gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10463
diff
changeset
|
44 | * Destroys an HTTP connection object. |
|
10463
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
45 | * |
|
10481
a5d6b8e1717d
[gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10463
diff
changeset
|
46 | * @param httpconn The HTTP connection object. |
|
10463
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
47 | */ |
|
34262
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
48 | void |
|
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
49 | msn_httpconn_destroy(MsnHttpConn *httpconn); |
|
10463
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
50 | |
|
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
51 | /** |
|
34262
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
52 | * Virtually estabilishes the HTTP connection with a host. |
|
10463
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
53 | * |
|
10481
a5d6b8e1717d
[gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10463
diff
changeset
|
54 | * @param httpconn The HTTP connection object. |
|
34262
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
55 | * @param host The host to connect to. |
|
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
56 | * @param port The port to connect to (currently ignored). |
|
10481
a5d6b8e1717d
[gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10463
diff
changeset
|
57 | */ |
|
34262
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
58 | void |
|
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
59 | msn_httpconn_connect(MsnHttpConn *httpconn, const gchar *host, int port); |
|
10481
a5d6b8e1717d
[gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10463
diff
changeset
|
60 | |
|
a5d6b8e1717d
[gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10463
diff
changeset
|
61 | /** |
|
a5d6b8e1717d
[gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10463
diff
changeset
|
62 | * Disconnects the HTTP connection object. |
|
10463
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
63 | * |
|
10481
a5d6b8e1717d
[gaim-migrate @ 11769]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
10463
diff
changeset
|
64 | * @param httpconn The HTTP connection object. |
|
10463
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
65 | */ |
|
34262
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
66 | void |
|
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
67 | msn_httpconn_disconnect(MsnHttpConn *httpconn); |
|
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
68 | |
|
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
69 | /** |
|
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
70 | * Writes a chunk of data to the HTTP connection. |
|
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
71 | * |
|
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
72 | * @param servconn The server connection. |
|
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
73 | * @param data The data to write. |
|
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
74 | * @param data_len The size of the data to write. |
|
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
75 | * |
|
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
76 | * @return The number of bytes written. |
|
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
77 | */ |
|
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
78 | ssize_t |
|
3b8ce83bac96
HTTP: get rid of one (of two) msn's own http implementations
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
30956
diff
changeset
|
79 | msn_httpconn_write(MsnHttpConn *httpconn, const gchar *data, size_t data_len); |
|
10463
f2f97738b401
[gaim-migrate @ 11737]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
diff
changeset
|
80 | |
|
29305
202cb72ed5b0
Minor header file cleanup. Mostly I wanted to move some enums above some #includes
Mark Doliner <markdoliner@pidgin.im>
parents:
23078
diff
changeset
|
81 | #endif /* MSN_HTTPCONN_H */ |