 this.disconnect = dojox.cometd.longPollTransport.disconnect; 
dojox.cometd.callbackPollTransport = new function(){	this.connected = false;	this.authToken = null;	this.lastTimestamp = null;	this.lastId = null;	this.backlog = [];	this.check = function(types, version, xdomain){		// we handle x-domain!		return (dojo.indexOf(types, "callback-polling") >= 0);	}	this.tunnelInit = function(){		if(this.connected){ return; }		// FIXME: open up the connection here		this.openTunnelWith({			message: dojo.toJson([				{					channel:	"/meta/connect",					clientId:	dojox.cometd.clientId,					connectionType: "callback-polling"					// FIXME: auth not passed here!					// "authToken": this.authToken				}			])		});		this.connected = true;	}	this.tunnelCollapse = function(){		if(!this.connected){			// try to restart the tunnel			this.connected = false;			this.openTunnelWith({				message: dojo.toJson([					{						channel:	"/meta/reconnect",						connectionType: "long-polling",						clientId:	dojox.cometd.clientId,						timestamp:	this.lastTimestamp,						id:			this.lastId						// FIXME: no authToken provision!					}				])			});		}	}	// the logic appears to be the same	this.deliver = dojox.cometd.longPollTransport.deliver;	this.openTunnelWith = function(content, url){		// create a <script> element to generate the request		dojo.io.script.get({			load: dojo.hitch(this, function(data){				dojox.cometd.deliver(data);				this.connected = false;				this.tunnelCollapse();			}),			error: function(){ 				console.debug("tunnel opening failed"); 			},			url: (url||dojox.cometd.url),			content: content,			handleAs: dojox.cometd.handleAs,			callbackParamName: "jsonp"		});		this.connected = true;	}	this.processBacklog = function(){		while(this.backlog.length > 0){			this.sendMessage(this.backlog.shift(), true);		}	}	this.sendMessage = function(message, bypassBacklog){		// FIXME: what about auth fields?		if((bypassBacklog)||(this.connected)){			message.clientId = dojox.cometd.clientId;			var bindArgs = {				url: dojox.cometd.url||djConfig["cometdRoot"],				handleAs: dojox.cometd.handleAs,				load: dojo.hitch(dojox.cometd, "deliver"),				callbackParamName: "jsonp",				content: { message: dojo.toJson([ message ]) }			};			return dojo.io.script.get(bindArgs);		}else{			this.backlog.push(message);		}	}	this.startup = function(handshakeData){		if(this.connected){ return; }		this.tunnelInit();	}}
5168	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5168/5d75c36c89d7fb7b26381ba75a8f75522b80412f/cometd.js/buggy/_cometd/cometd.js