Mercurial > pidgin
comparison src/protocols/msn/slp.c @ 11127:719779387f96
[gaim-migrate @ 13183]
Change the base16 and base64 functions to use better data types,
and make appropriate changes to other parts of the Gaim code
to get rid of a few warnings and hopefully make things more
correct.
In other news, why is CVS HEAD crashing for me on exit?
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Tue, 19 Jul 2005 05:15:45 +0000 |
parents | 407e47f580e4 |
children | 096020ae09a9 |
comparison
equal
deleted
inserted
replaced
11126:2a3568cbd8a6 | 11127:719779387f96 |
---|---|
251 MsnObject *obj; | 251 MsnObject *obj; |
252 char *msnobj_data; | 252 char *msnobj_data; |
253 const char *sha1c; | 253 const char *sha1c; |
254 const char *file_name; | 254 const char *file_name; |
255 char *content; | 255 char *content; |
256 int len; | 256 gsize len; |
257 int type; | 257 int type; |
258 | 258 |
259 /* Send Ok */ | 259 /* Send Ok */ |
260 content = g_strdup_printf("SessionID: %lu\r\n\r\n", | 260 content = g_strdup_printf("SessionID: %lu\r\n\r\n", |
261 slpcall->session_id); | 261 slpcall->session_id); |
265 | 265 |
266 g_free(content); | 266 g_free(content); |
267 | 267 |
268 slplink = slpcall->slplink; | 268 slplink = slpcall->slplink; |
269 | 269 |
270 gaim_base64_decode(context, &msnobj_data, &len); | 270 msnobj_data = (char *)gaim_base64_decode(context, &len); |
271 obj = msn_object_new_from_string(msnobj_data); | 271 obj = msn_object_new_from_string(msnobj_data); |
272 type = msn_object_get_type(obj); | 272 type = msn_object_get_type(obj); |
273 sha1c = msn_object_get_sha1c(obj); | 273 sha1c = msn_object_get_sha1c(obj); |
274 g_free(msnobj_data); | 274 g_free(msnobj_data); |
275 | 275 |
320 { | 320 { |
321 /* File Transfer */ | 321 /* File Transfer */ |
322 GaimAccount *account; | 322 GaimAccount *account; |
323 GaimXfer *xfer; | 323 GaimXfer *xfer; |
324 char *bin; | 324 char *bin; |
325 int bin_len; | 325 gsize bin_len; |
326 guint32 file_size; | 326 guint32 file_size; |
327 char *file_name; | 327 char *file_name; |
328 gunichar2 *uni_name; | 328 gunichar2 *uni_name; |
329 | 329 |
330 account = slpcall->slplink->session->account; | 330 account = slpcall->slplink->session->account; |
337 slpcall->pending = TRUE; | 337 slpcall->pending = TRUE; |
338 | 338 |
339 xfer = gaim_xfer_new(account, GAIM_XFER_RECEIVE, | 339 xfer = gaim_xfer_new(account, GAIM_XFER_RECEIVE, |
340 slpcall->slplink->remote_user); | 340 slpcall->slplink->remote_user); |
341 | 341 |
342 gaim_base64_decode(context, &bin, &bin_len); | 342 bin = (char *)gaim_base64_decode(context, &bin_len); |
343 file_size = GUINT32_FROM_LE(*((gsize *)bin + 2)); | 343 file_size = GUINT32_FROM_LE(*((gsize *)bin + 2)); |
344 | 344 |
345 uni_name = (gunichar2 *)(bin + 20); | 345 uni_name = (gunichar2 *)(bin + 20); |
346 while(*uni_name != 0 && ((char *)uni_name - (bin + 20)) < MAX_FILE_NAME_LEN) { | 346 while(*uni_name != 0 && ((char *)uni_name - (bin + 20)) < MAX_FILE_NAME_LEN) { |
347 *uni_name = GUINT16_FROM_LE(*uni_name); | 347 *uni_name = GUINT16_FROM_LE(*uni_name); |