Mercurial > pidgin
comparison libpurple/protocols/msn/slplink.c @ 30855:6814678f3c63
Remove session_id from SlpMsg and use the one from the header.
author | masca@cpw.pidgin.im |
---|---|
date | Wed, 21 Jul 2010 19:59:38 +0000 |
parents | 47b6eda87723 |
children | 9f41998d4fcc |
comparison
equal
deleted
inserted
replaced
30854:47b6eda87723 | 30855:6814678f3c63 |
---|---|
352 | 352 |
353 static void | 353 static void |
354 msn_slplink_release_slpmsg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg) | 354 msn_slplink_release_slpmsg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg) |
355 { | 355 { |
356 slpmsg = slpmsg; | 356 slpmsg = slpmsg; |
357 slpmsg->header = g_new0(MsnP2PHeader, 1); | |
358 slpmsg->footer = g_new0(MsnP2PFooter, 1); | 357 slpmsg->footer = g_new0(MsnP2PFooter, 1); |
359 | 358 |
360 if (slpmsg->flags == P2P_NO_FLAG) | 359 if (slpmsg->flags == P2P_NO_FLAG) |
361 { | 360 { |
362 slpmsg->header->session_id = slpmsg->session_id; | |
363 slpmsg->header->ack_id = rand() % 0xFFFFFF00; | 361 slpmsg->header->ack_id = rand() % 0xFFFFFF00; |
364 } | 362 } |
365 else if (slpmsg->flags == P2P_ACK) | 363 else if (slpmsg->flags == P2P_ACK) |
366 { | 364 { |
367 slpmsg->header->session_id = slpmsg->session_id; | |
368 slpmsg->header->ack_id = slpmsg->ack_id; | 365 slpmsg->header->ack_id = slpmsg->ack_id; |
369 slpmsg->header->ack_size = slpmsg->ack_size; | 366 slpmsg->header->ack_size = slpmsg->ack_size; |
370 slpmsg->header->ack_sub_id = slpmsg->ack_sub_id; | 367 slpmsg->header->ack_sub_id = slpmsg->ack_sub_id; |
371 } | 368 } |
372 else if (slpmsg->flags == P2P_MSN_OBJ_DATA || | 369 else if (slpmsg->flags == P2P_MSN_OBJ_DATA || |
453 | 450 |
454 for (e = slplink->slp_msgs; e != NULL; e = e->next) | 451 for (e = slplink->slp_msgs; e != NULL; e = e->next) |
455 { | 452 { |
456 MsnSlpMessage *slpmsg = e->data; | 453 MsnSlpMessage *slpmsg = e->data; |
457 | 454 |
458 if ((slpmsg->session_id == session_id) && (slpmsg->id == id)) | 455 if ((slpmsg->header->session_id == session_id) && (slpmsg->id == id)) |
459 return slpmsg; | 456 return slpmsg; |
460 } | 457 } |
461 | 458 |
462 return NULL; | 459 return NULL; |
463 } | 460 } |
481 | 478 |
482 if (offset == 0) | 479 if (offset == 0) |
483 { | 480 { |
484 slpmsg = msn_slpmsg_new(slplink); | 481 slpmsg = msn_slpmsg_new(slplink); |
485 slpmsg->id = header->id; | 482 slpmsg->id = header->id; |
486 slpmsg->session_id = header->session_id; | 483 slpmsg->header->session_id = header->session_id; |
487 slpmsg->size = header->total_size; | 484 slpmsg->size = header->total_size; |
488 slpmsg->flags = header->flags; | 485 slpmsg->flags = header->flags; |
489 | 486 |
490 if (slpmsg->session_id) | 487 if (slpmsg->header->session_id) |
491 { | 488 { |
492 slpmsg->slpcall = msn_slplink_find_slp_call_with_session_id(slplink, slpmsg->session_id); | 489 slpmsg->slpcall = msn_slplink_find_slp_call_with_session_id(slplink, slpmsg->header->session_id); |
493 if (slpmsg->slpcall != NULL) | 490 if (slpmsg->slpcall != NULL) |
494 { | 491 { |
495 if (slpmsg->flags == P2P_MSN_OBJ_DATA || | 492 if (slpmsg->flags == P2P_MSN_OBJ_DATA || |
496 slpmsg->flags == (P2P_WML2009_COMP | P2P_MSN_OBJ_DATA) || | 493 slpmsg->flags == (P2P_WML2009_COMP | P2P_MSN_OBJ_DATA) || |
497 slpmsg->flags == P2P_FILE_DATA) | 494 slpmsg->flags == P2P_FILE_DATA) |