# HG changeset patch # User Elliott Sales de Andrade # Date 1304754565 0 # Node ID 50ca9e64186b31406019e70584f9528d66f5110a # Parent 968103d932d6bfb868907f56ec1abe0ecdf4648e Only send acks on p2pv2 when required. diff -r 968103d932d6 -r 50ca9e64186b libpurple/protocols/msn/p2p.c --- a/libpurple/protocols/msn/p2p.c Sat May 07 07:29:47 2011 +0000 +++ b/libpurple/protocols/msn/p2p.c Sat May 07 07:49:25 2011 +0000 @@ -407,6 +407,31 @@ } } +gboolean +msn_p2p_info_require_ack(MsnP2PInfo *info) +{ + gboolean ret = FALSE; + + switch (info->version) { + case MSN_P2P_VERSION_ONE: { + guint32 flags = msn_p2p_info_get_flags(info); + + ret = flags == P2P_NO_FLAG || flags == P2P_WLM2009_COMP || + msn_p2p_msg_is_data(flags); + break; + } + + case MSN_P2P_VERSION_TWO: + ret = (info->header.v2.opcode & P2P_OPCODE_RAK) > 0; + break; + + default: + purple_debug_error("msn", "Invalid P2P Info version: %d\n", info->version); + } + + return ret; +} + guint32 msn_p2p_info_get_session_id(MsnP2PInfo *info) { diff -r 968103d932d6 -r 50ca9e64186b libpurple/protocols/msn/p2p.h --- a/libpurple/protocols/msn/p2p.h Sat May 07 07:29:47 2011 +0000 +++ b/libpurple/protocols/msn/p2p.h Sat May 07 07:49:25 2011 +0000 @@ -194,6 +194,9 @@ void msn_p2p_info_create_ack(MsnP2PInfo *old_info, MsnP2PInfo *new_info); +gboolean +msn_p2p_info_require_ack(MsnP2PInfo *info); + guint32 msn_p2p_info_get_session_id(MsnP2PInfo *info); diff -r 968103d932d6 -r 50ca9e64186b libpurple/protocols/msn/slplink.c --- a/libpurple/protocols/msn/slplink.c Sat May 07 07:29:47 2011 +0000 +++ b/libpurple/protocols/msn/slplink.c Sat May 07 07:49:25 2011 +0000 @@ -502,7 +502,6 @@ process_complete_msg(MsnSlpLink *slplink, MsnSlpMessage *slpmsg, MsnP2PInfo *info) { MsnSlpCall *slpcall; - guint32 flags; slpcall = msn_slp_process_msg(slplink, slpmsg); @@ -513,10 +512,7 @@ purple_debug_info("msn", "msn_slplink_process_msg: slpmsg complete\n"); - flags = msn_p2p_info_get_flags(slpmsg->p2p_info); - - if (flags == P2P_NO_FLAG || flags == P2P_WLM2009_COMP || - msn_p2p_msg_is_data(flags)) + if (msn_p2p_info_require_ack(slpmsg->p2p_info)) { /* Release all the messages and send the ACK */