| 38 GaimConnection *gc, guint16 cmd, gboolean is_auto_seq, guint16 *seq) |
38 GaimConnection *gc, guint16 cmd, gboolean is_auto_seq, guint16 *seq) |
| 39 { |
39 { |
| 40 qq_data *qd; |
40 qq_data *qd; |
| 41 gint bytes_expected, bytes_written; |
41 gint bytes_expected, bytes_written; |
| 42 |
42 |
| 43 g_return_val_if_fail(gc != NULL && |
43 g_return_val_if_fail(buf != NULL && cursor != NULL && *cursor != NULL, -1); |
| 44 gc->proto_data != NULL && buf != NULL && cursor != NULL && *cursor != NULL, -1); |
|
| 45 |
44 |
| 46 qd = (qq_data *) gc->proto_data; |
45 qd = (qq_data *) gc->proto_data; |
| 47 if (is_auto_seq) |
46 if (is_auto_seq) |
| 48 *seq = ++(qd->send_seq); |
47 *seq = ++(qd->send_seq); |
| 49 |
48 |
| 122 qq_data *qd; |
119 qq_data *qd; |
| 123 guint8 *buf, *cursor, *encrypted_data; |
120 guint8 *buf, *cursor, *encrypted_data; |
| 124 guint16 seq_ret; |
121 guint16 seq_ret; |
| 125 gint encrypted_len, bytes_written, bytes_expected, bytes_sent; |
122 gint encrypted_len, bytes_written, bytes_expected, bytes_sent; |
| 126 |
123 |
| 127 g_return_val_if_fail(gc != NULL && gc->proto_data != NULL, -1); |
|
| 128 |
|
| 129 qd = (qq_data *) gc->proto_data; |
124 qd = (qq_data *) gc->proto_data; |
| 130 g_return_val_if_fail(qd->session_key != NULL, -1); |
125 g_return_val_if_fail(qd->session_key != NULL, -1); |
| 131 |
126 |
| 132 buf = g_newa(guint8, MAX_PACKET_SIZE); |
127 buf = g_newa(guint8, MAX_PACKET_SIZE); |
| 133 encrypted_len = len + 16; /* at most 16 bytes more */ |
128 encrypted_len = len + 16; /* at most 16 bytes more */ |