Wed, 01 Dec 2004 02:30:47 +0000
[gaim-migrate @ 11454]
Several MSN memory leaks identified and fixed by Miah Gregory and Felipe
Contreras, plus my own fix for bug 1075347.
As normal, thank them for fixes, blame me for breakages.
Did I mention the new MSN icon? It rocks!
| 5309 | 1 | /** |
| 2 | * @file servconn.h Server connection functions | |
| 3 | * | |
| 4 | * gaim | |
| 5 | * | |
|
9198
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
6 | * Gaim is the legal property of its developers, whose names are too numerous |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
7 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
e8eb6d5eb9eb
[gaim-migrate @ 9993]
Christian Hammond <chipx86@chipx86.com>
parents:
9193
diff
changeset
|
8 | * source distribution. |
|
6701
7e2db9273748
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5962
diff
changeset
|
9 | * |
| 5309 | 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_SERVCONN_H_ | |
| 25 | #define _MSN_SERVCONN_H_ | |
| 26 | ||
|
8808
1cb5ddf6b625
[gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8646
diff
changeset
|
27 | typedef struct _MsnServConn MsnServConn; |
|
6701
7e2db9273748
[gaim-migrate @ 7227]
Christian Hammond <chipx86@chipx86.com>
parents:
5962
diff
changeset
|
28 | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
29 | #include "session.h" |
|
8808
1cb5ddf6b625
[gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8646
diff
changeset
|
30 | #include "cmdproc.h" |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
31 | |
|
8808
1cb5ddf6b625
[gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8646
diff
changeset
|
32 | #include "proxy.h" |
|
7288
486e8b44a14b
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
33 | #include "httpmethod.h" |
| 5309 | 34 | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
35 | /* |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
36 | #include "msg.h" |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
37 | #include "history.h" |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
38 | */ |
| 5309 | 39 | |
|
8808
1cb5ddf6b625
[gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8646
diff
changeset
|
40 | typedef enum |
|
1cb5ddf6b625
[gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8646
diff
changeset
|
41 | { |
|
1cb5ddf6b625
[gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8646
diff
changeset
|
42 | MSN_SERVER_NS, |
|
1cb5ddf6b625
[gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8646
diff
changeset
|
43 | MSN_SERVER_SB, |
|
1cb5ddf6b625
[gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8646
diff
changeset
|
44 | MSN_SERVER_NX, |
|
1cb5ddf6b625
[gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8646
diff
changeset
|
45 | MSN_SERVER_DC, |
|
1cb5ddf6b625
[gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8646
diff
changeset
|
46 | MSN_SERVER_HT |
| 5309 | 47 | |
|
9158
f8dab42adeaf
[gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8808
diff
changeset
|
48 | } MsnServConnType; |
|
5962
d5413616b57b
[gaim-migrate @ 6409]
Christian Hammond <chipx86@chipx86.com>
parents:
5506
diff
changeset
|
49 | |
| 5309 | 50 | struct _MsnServConn |
| 51 | { | |
|
9158
f8dab42adeaf
[gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8808
diff
changeset
|
52 | MsnServConnType type; |
| 5309 | 53 | MsnSession *session; |
|
8808
1cb5ddf6b625
[gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8646
diff
changeset
|
54 | MsnCmdProc *cmdproc; |
| 5309 | 55 | |
| 56 | gboolean connected; | |
|
8808
1cb5ddf6b625
[gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8646
diff
changeset
|
57 | gboolean processing; |
|
8646
74d0e7406e3b
[gaim-migrate @ 9398]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8583
diff
changeset
|
58 | gboolean wasted; |
| 5309 | 59 | |
|
8808
1cb5ddf6b625
[gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8646
diff
changeset
|
60 | int num; |
|
1cb5ddf6b625
[gaim-migrate @ 9570]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8646
diff
changeset
|
61 | |
|
7288
486e8b44a14b
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
62 | MsnHttpMethodData *http_data; |
|
486e8b44a14b
[gaim-migrate @ 7869]
Christian Hammond <chipx86@chipx86.com>
parents:
6701
diff
changeset
|
63 | |
| 5309 | 64 | int fd; |
| 65 | int inpa; | |
| 66 | ||
|
8646
74d0e7406e3b
[gaim-migrate @ 9398]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8583
diff
changeset
|
67 | char *rx_buf; |
|
74d0e7406e3b
[gaim-migrate @ 9398]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8583
diff
changeset
|
68 | int rx_len; |
|
74d0e7406e3b
[gaim-migrate @ 9398]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8583
diff
changeset
|
69 | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
70 | size_t payload_len; |
| 5309 | 71 | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
72 | void (*connect_cb)(MsnServConn *); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
73 | void (*disconnect_cb)(MsnServConn *); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
74 | void (*data_free_cb)(void *data); |
| 5309 | 75 | void *data; |
| 76 | }; | |
| 77 | ||
|
9158
f8dab42adeaf
[gaim-migrate @ 9942]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8808
diff
changeset
|
78 | MsnServConn *msn_servconn_new(MsnSession *session, MsnServConnType type); |
| 5309 | 79 | void msn_servconn_destroy(MsnServConn *servconn); |
| 80 | ||
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
81 | gboolean msn_servconn_connect(MsnServConn *servconn, const char *host, int port); |
| 5309 | 82 | void msn_servconn_disconnect(MsnServConn *servconn); |
| 83 | ||
| 84 | void msn_servconn_set_connect_cb(MsnServConn *servconn, | |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
85 | void (*connect_cb)(MsnServConn *)); |
|
8583
56f69df8f12f
[gaim-migrate @ 9333]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
8475
diff
changeset
|
86 | void msn_servconn_set_disconnect_cb(MsnServConn *servconn, |
|
9193
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
87 | void (*disconnect_cb)(MsnServConn *)); |
|
6e76f1367896
[gaim-migrate @ 9988]
Felipe Contreras <felipe.contreras@gmail.com>
parents:
9158
diff
changeset
|
88 | size_t msn_servconn_write(MsnServConn *servconn, const char *buf, size_t size); |
| 5309 | 89 | |
| 90 | #endif /* _MSN_SERVCONN_H_ */ |