| 30 #include "cmdproc.h" |
30 #include "cmdproc.h" |
| 31 |
31 |
| 32 #include "proxy.h" |
32 #include "proxy.h" |
| 33 #include "httpconn.h" |
33 #include "httpconn.h" |
| 34 |
34 |
| 35 /* |
35 /** |
| 36 * Connection types |
36 * Connection error types. |
| 37 */ |
37 */ |
| 38 typedef enum |
38 typedef enum |
| 39 { |
39 { |
| 40 MSN_SERVER_NS, |
40 MSN_SERVCONN_ERROR_NONE, |
| 41 MSN_SERVER_SB, |
41 MSN_SERVCONN_ERROR_CONNECT, |
| 42 MSN_SERVER_NX, |
42 MSN_SERVCONN_ERROR_WRITE, |
| 43 MSN_SERVER_DC, |
43 MSN_SERVCONN_ERROR_READ, |
| 44 MSN_SERVER_HT |
44 |
| |
45 } MsnServConnError; |
| |
46 |
| |
47 /** |
| |
48 * Connection types. |
| |
49 */ |
| |
50 typedef enum |
| |
51 { |
| |
52 MSN_SERVCONN_NS, |
| |
53 MSN_SERVCONN_SB |
| 45 |
54 |
| 46 } MsnServConnType; |
55 } MsnServConnType; |
| 47 |
56 |
| 48 /* |
57 /** |
| 49 * A Connection |
58 * A Connection. |
| 50 */ |
59 */ |
| 51 struct _MsnServConn |
60 struct _MsnServConn |
| 52 { |
61 { |
| 53 MsnServConnType type; /**< The type of this connection. */ |
62 MsnServConnType type; /**< The type of this connection. */ |
| 54 MsnSession *session; /**< The MSN session of this connection. */ |
63 MsnSession *session; /**< The MSN session of this connection. */ |
| 56 |
65 |
| 57 gboolean connected; /**< A flag that states if it's connected. */ |
66 gboolean connected; /**< A flag that states if it's connected. */ |
| 58 gboolean processing; /**< A flag that states if something is working |
67 gboolean processing; /**< A flag that states if something is working |
| 59 with this connection. */ |
68 with this connection. */ |
| 60 gboolean wasted; /**< A flag that states if it should be destroyed. */ |
69 gboolean wasted; /**< A flag that states if it should be destroyed. */ |
| 61 gboolean destroying; /**< A flag that states if the connection is on |
|
| 62 the process of being destroyed. */ |
|
| 63 |
70 |
| 64 char *host; /**< The host this connection is connected or should be |
71 char *host; /**< The host this connection is connected or should be |
| 65 connected to. */ |
72 connected to. */ |
| 66 int num; /**< A number id of this connection. */ |
73 int num; /**< A number id of this connection. */ |
| 67 |
74 |
| 146 * @param size The size of the data. |
153 * @param size The size of the data. |
| 147 */ |
154 */ |
| 148 size_t msn_servconn_write(MsnServConn *servconn, const char *buf, |
155 size_t msn_servconn_write(MsnServConn *servconn, const char *buf, |
| 149 size_t size); |
156 size_t size); |
| 150 |
157 |
| |
158 /** |
| |
159 * Function to call whenever an error related to a switchboard occurs. |
| |
160 * |
| |
161 * @param servconn The servconn. |
| |
162 * @param error The error that happened. |
| |
163 */ |
| |
164 void msn_servconn_got_error(MsnServConn *servconn, MsnServConnError error); |
| |
165 |
| 151 #endif /* _MSN_SERVCONN_H_ */ |
166 #endif /* _MSN_SERVCONN_H_ */ |