annotate src/protocols/msn/httpmethod.h @ 9600:b7d851a6a098

[gaim-migrate @ 10443] removed gaimrc.c committer: Tailor Script <tailor@pidgin.im>
author Herman Bloggs <hermanator12002@yahoo.com>
date Mon, 26 Jul 2004 21:43:33 +0000
parents ab6636c5a136
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7288
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
1 /**
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 * @file httpmethod.h HTTP connection method
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
3 *
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
4 * gaim
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
5 *
9198
ab6636c5a136 [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
6 * Gaim is the legal property of its developers, whose names are too numerous
ab6636c5a136 [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
7 * to list here. Please refer to the COPYRIGHT file distributed with this
ab6636c5a136 [gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents: 9158
diff changeset
8 * source distribution.
7288
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
9 *
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * (at your option) any later version.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 *
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 * This program is distributed in the hope that it will be useful,
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * GNU General Public License for more details.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
19 *
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
21 * along with this program; if not, write to the Free Software
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
23 */
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
24 #ifndef _MSN_HTTP_METHOD_H_
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
25 #define _MSN_HTTP_METHOD_H_
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
26
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
27 typedef struct _MsnHttpMethodData MsnHttpMethodData;
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
28
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
29 #include "servconn.h"
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
30
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
31 struct _MsnHttpMethodData
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
32 {
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
33 char *session_id;
9158
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8475
diff changeset
34 char *old_gateway_host;
c30d81b4dd22 [gaim-migrate @ 9942]
Christian Hammond <chipx86@chipx86.com>
parents: 8475
diff changeset
35 char *gateway_host;
7288
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
36 const char *server_type;
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
37
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
38 int timer;
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
39
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
40 gboolean virgin;
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
41 gboolean waiting_response;
8298
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
42 gboolean dirty;
7288
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
43
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
44 GList *queue;
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
45 };
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
46
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
47 /**
8298
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
48 * Initializes the HTTP data for a session.
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
49 *
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
50 * @param session The session.
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
51 */
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
52 void msn_http_session_init(MsnSession *session);
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
53
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
54 /**
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
55 * Uninitializes the HTTP data for a session.
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
56 *
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
57 * @param session The session.
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
58 */
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
59 void msn_http_session_uninit(MsnSession *session);
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
60
c719f9a181d4 [gaim-migrate @ 9022]
Christian Hammond <chipx86@chipx86.com>
parents: 7288
diff changeset
61 /**
7288
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
62 * Writes data to the server using the HTTP connection method.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
63 *
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
64 * @param servconn The server connection.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
65 * @param buf The data to write.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
66 * @param size The size of the data to write.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
67 * @param server_type The optional server type.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
68 *
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
69 * @return The number of bytes written.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
70 */
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
71 size_t msn_http_servconn_write(MsnServConn *servconn, const char *buf,
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
72 size_t size, const char *server_type);
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
73
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
74 /**
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
75 * Polls the server for data.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
76 *
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
77 * @param servconn The server connection.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
78 */
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
79 void msn_http_servconn_poll(MsnServConn *servconn);
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
80
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
81 /**
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
82 * Processes an incoming message and returns a string the rest of MSN
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
83 * can deal with.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
84 *
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
85 * @param servconn The server connection.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
86 * @param buf The incoming buffer.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
87 * @param size The incoming size.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
88 * @param ret_buf The returned buffer.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
89 * @param ret_len The returned length.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
90 * @param error TRUE if there was an HTTP error.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
91 *
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
92 * @return TRUE if the returned buffer is ready to be processed.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
93 * FALSE otherwise.
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
94 */
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
95 gboolean msn_http_servconn_parse_data(MsnServConn *servconn,
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
96 const char *buf, size_t size,
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
97 char **ret_buf, size_t *ret_size,
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
98 gboolean *error);
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
99
ff9127038a5a [gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
100 #endif /* _MSN_HTTP_METHOD_H_ */