Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE6 SP1 Freeze on syncronous send

Status
Not open for further replies.

SBGibson

Programmer
Apr 18, 2001
125
IT
Hi everyone,
I'm developing a small ajax functionality and it works well in IE6 sp2, IE7 and Firefox.
It only have to call a webpage in background, nothing special.
With IE6 SP1 (I'm still investigating if it's some particular version) when I call Send the browser freeze, for a couple of minutes, after that timeout it goes on with the request. Investigating I've found that in the request header the "connection: close" item is not written so I think that httprequest wait for a close indefinetly (timeout).
If I configure IE to use HTTP/1.0 instead of HTTP/1.1 it works, probably cause 1.0 does not support multiple connections and auto-add the Connection:close header.
I updated to the last version of IE (SP1) and installed XMLHTTO 6 without any improvement. Some hint? I add some piece of code:

The ajax engine (I already tried forcing version 6 without success)
Code:
function getAjax() {
	var XHR = null;
	browser = navigator.userAgent.toUpperCase();
	if(typeof(XMLHttpRequest) === "function" || typeof(XMLHttpRequest) === "object") {
		XHR = new XMLHttpRequest();
	} else if(window.ActiveXObject && browser.indexOf("MSIE 4") < 0) {
		if(browser.indexOf("MSIE 5") < 0) {
			XHR = new ActiveXObject("Msxml2.XMLHTTP");
		} else {
			XHR = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return XHR;
}

The request function (I tried monitoring onreadystatechange and it never goes after 2)
Code:
	var ajax = getAjax();
	if(ajax) {
		ajax.open('get', '/test/background.aspx', false);
		ajax.setRequestHeader('connection', 'close');
		ajax.send();
}

request (in working browser appears also the line "connection:close")
Code:
GET /test/background.aspx HTTP/1.1
Accept: */*
Accept-Language: it
Referer: [URL unfurl="true"]http://testforge/test/test.htm[/URL]
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Host: testforge
Cookie: ASP.NET_SessionId=hbmlltnz0tqb1wiymbq0ez55

Response
Code:
HTTP/1.1 200 OK
Date: Thu, 25 Oct 2007 10:34:40 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Connection: close
Pragma: no-cache
Cache-Control: no-cache
Pragma: no-cache
Expires: -1
Content-Length: 10

Stevie B. Gibson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top