[Xmpp4js-commit] SF.net SVN: xmpp4js:[761] trunk/src/main/javascript/transport/BOSH.js
Status: Beta
Brought to you by:
h-iverson
From: <h-i...@us...> - 2008-07-28 17:31:10
|
Revision: 761 http://xmpp4js.svn.sourceforge.net/xmpp4js/?rev=761&view=rev Author: h-iverson Date: 2008-07-28 17:31:19 +0000 (Mon, 28 Jul 2008) Log Message: ----------- fixed http error response codes Modified Paths: -------------- trunk/src/main/javascript/transport/BOSH.js Modified: trunk/src/main/javascript/transport/BOSH.js =================================================================== --- trunk/src/main/javascript/transport/BOSH.js 2008-07-28 16:08:54 UTC (rev 760) +++ trunk/src/main/javascript/transport/BOSH.js 2008-07-28 17:31:19 UTC (rev 761) @@ -98,21 +98,16 @@ ;;; Xmpp4Js.Transport.BOSH.logger.debug( "Got write response." ); - var packetNode = null; + // 17.4 XML Stanza Conditions? + // this condition would be true if we closed the connection + // before a response was received + // + // TODO setting xhr.timeout to a higher value than wait would + // eliminate this issue, unless there was a network + // inturruption before the server responded. figure out + // how to handle this. + - if( response.responseText != null ) { - // 17.4 XML Stanza Conditions? - // this condition would be true if we closed the connection - // before a response was received - // - // TODO setting xhr.timeout to a higher value than wait would - // eliminate this issue, unless there was a network - // inturruption before the server responded. figure out - // how to handle this. - - packetNode = new DOMImplementation().loadXML( response.responseText ).documentElement; - } - /* TODO - 17.1 A legacy client (or connection manager) is a client (or @@ -136,9 +131,7 @@ ;;; Xmpp4Js.Transport.BOSH.logger.warn( "Deprecated HTTP code error" ); var condition = null; - if( packetNode != null ) { - condition = packetNode.getAttribute( "condition" ).toString(); - } else if( !response.status ) { + if( !response.status ) { condition = "undefined-condition"; } else if( response.status != 200 ){ condition = "status."+response.status; @@ -160,6 +153,10 @@ } } else { try { + + var packetNode = new DOMImplementation().loadXML( response.responseText ).documentElement; + + // this will throw an exception if there is an error. this.handleErrors( packetNode ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |