comparison src/protocols/msn/servconn.h @ 8646:1e211dde3cae

[gaim-migrate @ 9398] Added a patch by shx to clean up the message-handling code and split the command stuff from it, among a few other things. Also, I fixed a crash in message parsing, which I think may close a couple bug reports. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Tue, 13 Apr 2004 04:08:22 +0000
parents fc27237783ee
children bbd8cdaf0ad5
comparison
equal deleted inserted replaced
8645:47f647dd2ac3 8646:1e211dde3cae
33 const char *cmd, const char **params, 33 const char *cmd, const char **params,
34 size_t param_count); 34 size_t param_count);
35 35
36 typedef gboolean (*MsnServConnMsgCb)(MsnServConn *servconn, MsnMessage *msg); 36 typedef gboolean (*MsnServConnMsgCb)(MsnServConn *servconn, MsnMessage *msg);
37 37
38 typedef void (*MsnPayloadCb)(MsnServConn *servconn, char *payload,
39 size_t len);
40
38 #include "session.h" 41 #include "session.h"
39
40 typedef enum
41 {
42 MSN_MULTILINE_MSG,
43 MSN_MULTILINE_IPG,
44 MSN_MULTILINE_NOT
45
46 } MsnMultilineType;
47 42
48 struct _MsnServConn 43 struct _MsnServConn
49 { 44 {
50 MsnSession *session; 45 MsnSession *session;
51 46
52 gboolean connected; 47 gboolean connected;
48 gboolean wasted;
53 49
54 MsnHttpMethodData *http_data; 50 MsnHttpMethodData *http_data;
55 51
56 #if 0 52 #if 0
57 /* shx: not used */ 53 /* shx: not used */
60 #endif 56 #endif
61 57
62 int fd; 58 int fd;
63 int inpa; 59 int inpa;
64 60
65 char *rxqueue; 61 char *rx_buf;
66 int rxlen; 62 int rx_len;
63
64 MsnPayloadCb payload_cb;
65 int payload_len;
67 66
68 GSList *msg_queue; 67 GSList *msg_queue;
69 68
70 GSList *txqueue; 69 GSList *txqueue;
71 70
72 gboolean parsing_multiline;
73 MsnMultilineType multiline_type;
74 char *msg_passport; 71 char *msg_passport;
75 char *msg_friendly;
76 int multiline_len;
77 72
78 GHashTable *commands; 73 GHashTable *commands;
79 GHashTable *msg_types; 74 GHashTable *msg_types;
80 75
81 gboolean (*connect_cb)(MsnServConn *servconn); 76 gboolean (*connect_cb)(MsnServConn *servconn);
124 119
125 void msn_servconn_register_msg_type(MsnServConn *servconn, 120 void msn_servconn_register_msg_type(MsnServConn *servconn,
126 const char *content_type, 121 const char *content_type,
127 MsnServConnMsgCb cb); 122 MsnServConnMsgCb cb);
128 123
129 void msn_servconn_parse_data(gpointer data, gint source, 124 gboolean msn_servconn_process_message(MsnServConn *servconn,
130 GaimInputCondition cond); 125 MsnMessage *msg);
131 126
132 #endif /* _MSN_SERVCONN_H_ */ 127 #endif /* _MSN_SERVCONN_H_ */