From: <may...@us...> - 2006-10-18 16:28:59
|
Revision: 17523 http://svn.sourceforge.net/gaim/?rev=17523&view=rev Author: mayuan2006 Date: 2006-10-18 09:28:51 -0700 (Wed, 18 Oct 2006) Log Message: ----------- accurate with the Offline Message send's Fault Code recognize and resend the OIM Get Message. committed by MaYuan<may...@gm...> Modified Paths: -------------- branches/soc-2006-msnp13/src/protocols/msn/msg.c branches/soc-2006-msnp13/src/protocols/msn/notification.c branches/soc-2006-msnp13/src/protocols/msn/oim.c Modified: branches/soc-2006-msnp13/src/protocols/msn/msg.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/msg.c 2006-10-18 15:53:26 UTC (rev 17522) +++ branches/soc-2006-msnp13/src/protocols/msn/msg.c 2006-10-18 16:28:51 UTC (rev 17523) @@ -215,7 +215,7 @@ char **elems, **cur, **tokens; g_return_if_fail(payload != NULL); - gaim_debug_info("MaYuan","payload:{%s}\n",payload); +// gaim_debug_info("MaYuan","payload:{%s}\n",payload); tmp_base = tmp = g_malloc0(payload_len + 1); memcpy(tmp_base, payload, payload_len); Modified: branches/soc-2006-msnp13/src/protocols/msn/notification.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/notification.c 2006-10-18 15:53:26 UTC (rev 17522) +++ branches/soc-2006-msnp13/src/protocols/msn/notification.c 2006-10-18 16:28:51 UTC (rev 17523) @@ -1409,7 +1409,7 @@ const char *passport, *psm_str; /*get the payload content*/ - gaim_debug_info("MaYuan","UBX {%s} payload{%s}\n",cmd->params[0], cmd->payload); +// gaim_debug_info("MaYuan","UBX {%s} payload{%s}\n",cmd->params[0], cmd->payload); session = cmdproc->session; account = session->account; Modified: branches/soc-2006-msnp13/src/protocols/msn/oim.c =================================================================== --- branches/soc-2006-msnp13/src/protocols/msn/oim.c 2006-10-18 15:53:26 UTC (rev 17522) +++ branches/soc-2006-msnp13/src/protocols/msn/oim.c 2006-10-18 16:28:51 UTC (rev 17523) @@ -157,8 +157,10 @@ void msn_oim_send_process(MsnOim *oim,char *body,int len) { - xmlnode *responseNode,*bodyNode,*faultNode; + xmlnode *responseNode,*bodyNode; + xmlnode *faultNode,*faultCodeNode,*faultstringNode; xmlnode *detailNode,*challengeNode; + char *faultCodeStr,*faultstring; char *challenge; responseNode = xmlnode_from_str(body,len); @@ -178,18 +180,43 @@ return; } /*get the challenge,and repost it*/ + faultCodeNode = xmlnode_get_child(faultNode,"faultcode"); + if(faultCodeNode == NULL){ + gaim_debug_info("MaYuan","faultcode Node is NULL\n"); + goto oim_send_process_fail; + } + faultCodeStr = xmlnode_get_data(faultCodeNode); + gaim_debug_info("MaYuan","fault code:{%s}\n",faultCodeStr); + + if(strcmp(faultCodeStr,"q0:AuthenticationFailed")){ + /*other Fault Reason?*/ + goto oim_send_process_fail; + } + + faultstringNode = xmlnode_get_child(faultNode,"faultstring"); + faultstring = xmlnode_get_data(faultstringNode); + gaim_debug_info("MaYuan","fault string :{%s}\n",faultstring); + + /* lock key fault reason, + * compute the challenge and resend it + */ detailNode = xmlnode_get_child(faultNode, "detail"); + if(detailNode == NULL){ + goto oim_send_process_fail; + } challengeNode = xmlnode_get_child(detailNode,"LockKeyChallenge"); g_free(oim->challenge); oim->challenge = xmlnode_get_data(challengeNode); gaim_debug_info("MaYuan","lockkey:{%s}\n",oim->challenge); - xmlnode_free(responseNode); - /*repost the send*/ gaim_debug_info("MaYuan","prepare to repost the send...\n"); msn_oim_send_msg(oim); + +oim_send_process_fail: + xmlnode_free(responseNode); + return ; } static void This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |