19784
|
1 /**
|
|
2 * @file soap.h
|
|
3 * header file for SOAP connection related process
|
|
4 * Author
|
|
5 * MaYuan<mayuan2006@gmail.com>
|
|
6 * gaim
|
|
7 *
|
|
8 * Gaim is the legal property of its developers, whose names are too numerous
|
|
9 * to list here. Please refer to the COPYRIGHT file distributed with this
|
|
10 * source distribution.
|
|
11 *
|
|
12 * This program is free software; you can redistribute it and/or modify
|
|
13 * it under the terms of the GNU General Public License as published by
|
|
14 * the Free Software Foundation; either version 2 of the License, or
|
|
15 * (at your option) any later version.
|
|
16 *
|
|
17 * This program is distributed in the hope that it will be useful,
|
|
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
20 * GNU General Public License for more details.
|
|
21 *
|
|
22 * You should have received a copy of the GNU General Public License
|
|
23 * along with this program; if not, write to the Free Software
|
|
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
25 */
|
|
26 #ifndef _MSN_SOAP_H_
|
|
27 #define _MSN_SOAP_H_
|
|
28
|
|
29 /*MSN Https connection structure*/
|
|
30 typedef struct _MsnSoapConn MsnSoapConn;
|
|
31
|
|
32 struct _MsnSoapConn{
|
|
33 MsnSession *session;
|
|
34 gpointer parent;
|
|
35
|
|
36 char *login_host;
|
|
37 char *login_path;
|
|
38
|
|
39 /*ssl connection?*/
|
|
40 guint ssl_conn;
|
|
41 /*normal connection*/
|
|
42 guint fd;
|
|
43 /*SSL connection*/
|
|
44 GaimSslConnection *gsc;
|
|
45 /*ssl connection callback*/
|
|
46 GaimSslInputFunction connect_cb;
|
|
47 /*ssl error callback*/
|
|
48 GaimSslErrorFunction error_cb;
|
|
49
|
|
50 /*read handler*/
|
|
51 guint input_handler;
|
|
52 /*write handler*/
|
|
53 guint output_handler;
|
|
54
|
|
55 /*write buffer*/
|
|
56 char *write_buf;
|
|
57 gsize written_len;
|
|
58 GaimInputFunction written_cb;
|
|
59
|
|
60 /*read buffer*/
|
|
61 char *read_buf;
|
|
62 gsize read_len;
|
|
63 GaimInputFunction read_cb;
|
|
64
|
|
65 /*HTTP reply body part*/
|
|
66 char *body;
|
|
67 int body_len;
|
|
68 };
|
|
69
|
|
70 /*Function Prototype*/
|
|
71 /*new a soap conneciton */
|
|
72 MsnSoapConn *msn_soap_new(MsnSession *session);
|
|
73 /*destroy */
|
|
74 void msn_soap_destroy(MsnSoapConn *soapconn);
|
|
75
|
|
76 /*init a soap conneciton */
|
|
77 void msn_soap_init(MsnSoapConn *soapconn,char * host,int ssl,GaimSslInputFunction connect_cb,GaimSslErrorFunction error_cb);
|
|
78
|
|
79 /*write to soap*/
|
|
80 void msn_soap_write(MsnSoapConn * soapconn, char *write_buf, GaimInputFunction written_cb);
|
|
81 void msn_soap_free_read_buf(MsnSoapConn *soapconn);
|
|
82 void msn_soap_free_write_buf(MsnSoapConn *soapconn);
|
|
83 void msn_soap_connect_cb(gpointer data, GaimSslConnection *gsc, GaimInputCondition cond);
|
|
84 void msn_soap_read_cb(gpointer data, gint source, GaimInputCondition cond);
|
|
85
|
|
86 #endif/*_MSN_SOAP_H_*/
|
|
87
|