XMLHttpRequest POST sometimes fails when server is using keep-aliv

Back in 2004 there was a bug in Internet Explorer 6 which caused the body 
from POST requests to go missing if the server reset the connection 
(http://support.microsoft.com/kb/831167/en-us). The same bug is apparently 
present in XMLHttpRequest in (at least) Internet Explorer 6, 7 and 8. 

The problem can be simply reproduced by doing a POST with an XMLHttpRequest 
to a server which is using a small keep-alive timeout, say 10s. If the POST 
request is made right before the keep-alive timeout expires and there is a 
slight network latency the web server will reset the connection and force IE 
to resend the request. This time IE will "forget" to send the body but will 
still send the old Content-Length header, resulting in the server waiting for 
the body to arrive until a read timeout occurs. 

The "right before" and "slight network latency" make it sound like this bug 
is hard to reproduce but experiences have shown that this bug is not hard at 
all to run in to while using a modern web application through e.g. a mobile 
connection.

I have put a demo of this problem at 
http://artur.virtuallypreinstalled.com/apache2-default/ie-xhr.php
The keep-alive timeout is 15s so wait 14-15s and click the button. An alert 
should popup when the response arrives and the button is re-enabled. At least 
for me using a mobile connection it does not take more than 2-3 attempts in 
IE8 to reproduce the problem. 

The only solution seems to be to turn off keep-alive on the server (or maybe 
set it to more than 60s). Has anyone else run into this and are there any 
other ways to solve this problem? Has this been reported/discussed here 
before? 



----------------
This post is a suggestion for Microsoft, and Microsoft responds to the 
suggestions with the most votes. To vote for this suggestion, click the "I 
Agree" button in the message pane. If you do not see the button, follow this 
link to open the suggestion in the Microsoft Web-based Newsreader and then 
click "I Agree" in the message pane.

http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?mid=9430c5e6-977e-41e8-9654-13584958f24a&dg=microsoft.public.internetexplorer.general
0
Utf
3/9/2010 1:41:01 PM
internetexplorer.general 1684 articles. 0 followers. Follow

3 Replies
5514 Views

Similar Articles

[PageSpeed] 20

I was very happy to finally come across this post. I have been banging my head against a problem with our web site that manifests itself only on high-latency connections (read: mobile) and only on a couple of pages that do lots of Ajax POSTs. I think I have come to the same conclusion as you.

Other suggestions than turning off Keep-Alive on the server-side would be greatly appreciated.

Thanks
Daniel




Artur S wrote:

XMLHttpRequest POST sometimes fails when server is using keep-aliv
09-Mar-10

Back in 2004 there was a bug in Internet Explorer 6 which caused the body
from POST requests to go missing if the server reset the connection
(http://support.microsoft.com/kb/831167/en-us). The same bug is apparently
present in XMLHttpRequest in (at least) Internet Explorer 6, 7 and 8.

The problem can be simply reproduced by doing a POST with an XMLHttpRequest
to a server which is using a small keep-alive timeout, say 10s. If the POST
request is made right before the keep-alive timeout expires and there is a
slight network latency the web server will reset the connection and force IE
to resend the request. This time IE will "forget" to send the body but will
still send the old Content-Length header, resulting in the server waiting for
the body to arrive until a read timeout occurs.

The "right before" and "slight network latency" make it sound like this bug
is hard to reproduce but experiences have shown that this bug is not hard at
all to run in to while using a modern web application through e.g. a mobile
connection.

I have put a demo of this problem at
http://artur.virtuallypreinstalled.com/apache2-default/ie-xhr.php
The keep-alive timeout is 15s so wait 14-15s and click the button. An alert
should popup when the response arrives and the button is re-enabled. At least
for me using a mobile connection it does not take more than 2-3 attempts in
IE8 to reproduce the problem.

The only solution seems to be to turn off keep-alive on the server (or maybe
set it to more than 60s). Has anyone else run into this and are there any
other ways to solve this problem? Has this been reported/discussed here
before?



----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?mid=9430c5e6-977e-41e8-9654-13584958f24a&dg=microsoft.public.internetexplorer.general

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice 
SharePoint Video Library Template Available For Download
http://www.eggheadcafe.com/tutorials/aspnet/223c6e57-f81f-44b3-ab05-5995f2b0ab63/sharepoint-video-library.aspx
0
Daniel
3/16/2010 1:47:11 PM
"Daniel H" wrote in message news:201031694711danielherlitz@gmail.com...
> I was very happy to finally come across this post.

Please note:
This is NOT a chat room and You are NOT posting to a forum run by 
Eggheadcafe - you are actually posting to a global Usenet Newsgroup. You 
will get a far better experience if you use a newsreader and subscribe to 
these groups directly, rather than through Eggheadcafe.

Setting up Outlook Express/Windows Mail to access Microsoft newsgroups
http://www.michaelstevenstech.com/outlookexpressnewreader.htm

Accessing the MS newsgroups in Outlook Express/Windows Mail Newsreader
http://www.microsoft.com/windowsxp/expertzone/newsgroupsetup.mspx

If you must stay with Egghheadcafe then please follow Usenet custom by NOT 
changing the subject line.

Thank you.

http://66.39.69.143/goodpost.htm 

0
Gordon
3/16/2010 1:50:58 PM
I just came across this, as well.  Very difficult to track down until I found 
this post.  Note that with an HTTP proxy sniffer application such as Charles 
Proxy, you can simulate increased latency via connection throttling (doesn't 
resolve anything, just makes it easier to hit the test case).

Is there an official Microsoft bug related to this specific behavior in 
XmlHttpRequest?  I can't find one.  There should be.
0
Utf
3/18/2010 11:08:01 PM
Reply:

Similar Artilces:

Failed to create empty document.
Hi, I am getting "Failed to create empty document." when in release mode of my mfc sdi app(feature pack). and when in debug mode it points to ENSURE(strTitle.LoadString(IDS_AFXBARRES_MENU_BAR_TITLE)); Line:716 of File: afxmenubar.cpp stuck from a long time now ! any workaround ? Thanks The problem seems to be that it is not able to find the feature pack resources like: IDS_AFXBARRES_MENU_BAR_TITLE and if i comment the menu.Create(this). then it can't load the resource AFX_RT_STYLE_XML in BOOL __stdcall CMFCVisualManagerOffice2007::SetStyle(Style styl...

posting purchase order terms and orders to Quickbooks 2004
Does anyone know how to run a utility to get the received PO over to quick books? Thanks in advance for your help! Well, This is supposedly part of the Quickbooks integration... once a PO is closed ( Meaning that you've recieved it completely ), if you use SO Manager/Journal/Post Closed Batches, the closed POs should be automatically transferred to QB as Accounts payable On Wed, 30 Jun 2004 16:27:57 -0400, JT <JackT@earthlink.net> wrote: > Does anyone know how to run a utility to get the received PO over to > quick > books? Thanks in advance for your help! >...

Updates KB981433 and KB981715 Fail
I am running Windows 7 and find the two recent updates at the subject will not load. I have tried loading the updates both in 'normal' and 'safe' mode and have run the MS Update 'Fix It' (re registers the various dlls required) all without success. Has anyone else had the same problem and has a solution? Incidentally, when loading the updates they fail with a message to the effect the updates are not working, no error code. I have looked at the Windows error code log but there is no code there either. Tip: Insert your Office 2007 CD into the appro...

How to do "cross posting"?
Hi How to do "cross posting"? Thanks & Regards Pradeep M V Cross Posting is mentioned in below post and i'm not sure how to do it. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/default.mspx?&query=pradeep&lang=en&cr=US&guid=&sloc=en-us&dg=microsoft.public.greatplains&p=1&tid=c3c5de83-4a26-4da1-80fb-9b0096863bd0&mid=efdc2d21-8c87-4845-8619-7b90b6deb8f0 "Pradeep M V" wrote: > Hi > > How to do "cross posting"? > > Thanks & Regards > > Pradeep M V > I...

CInternetSession->OpenURL sometimes throws CInternetException
Hi In my application I make a http call via the MFC classes. This works just fine but for some users the OpenURL call returns an exception. I was under the impression that this exception should never be thrown if there was an internet connection available, still the users claim to have an active internet connection. Can this be related to any firewall or proxy settings? Would a proxy cause the OpenURL call to fail? The code basically looks like this: iSession = new CInternetSession(NULL); try { httpFile = (CHttpFile*)iSession->OpenURL(httpRequestString); } catch(CInternetException* e...

KB933146 Hotfix patch fails
I have a Windows XP SP2 client that I'm configuring to run the Exchange Calendar Update Tool. I downloaded the Outlook Calendar Tool (tzmove) from this KB article: http://support.microsoft.com/kb/931667 and installed it along with Version 2 of the Exchange tool. When I tried to install the patch from KB933146 (the one from this past weekend that adds useful command line switches), it fails with a vague error message of "The installation of this patch failed". I was able to successfully install this patch on the virtual machine that Microsoft provides, but that virtual machine ...

Post a payment to a Posted Invoice
The Invoice is closed but a credit card payment note needs to be attached to the invoice. When attempting to do this, the 'cash receipt entry' will not allow a credit card info in the fileds. The fields are blanked out along with the checkbook ID. Any suggestions? By the invoice being closed do you mean it's fully applied? Are you trying to apply more cash receipts to it ? "turtle994" wrote: > The Invoice is closed but a credit card payment note needs to be attached to > the invoice. When attempting to do this, the 'cash receipt entry' will not >...

Annual Category Reports failing
When selecting to see the Current Year Category report, I see a huge list for Expense Categories but I am missing A LOT of my Income Categories. I checked the Customize menu and everything is selected for Categories and Payees. Any ideas why I would be missing most of my Income in this report? Check to see whether the 'details' tab says 'payments' for type. If it does, change it to 'all types'. -- Glyn Simpson, Microsoft MVP - Money http://money.mvps.org Check http://money.mvps.org/faq/default.aspx for tips and fixes for MS Money. To send Microsoft your pr...

xmlhttprequest
Can some body write a simple example for xmlhttprequest ?? I am only able to find the client side coding ,but not the server side coding.... it would be nice to have a complete code ( both client side and server side .) thanks Vimal vimalathithan@gmail.com wrote: > Can some body write a simple example for xmlhttprequest ?? > I am only able to find the client side coding ,but not the server side > coding.... Well it depends on what you want to do, with ASP.NET there are various possibilities, if someone does a HTTP POST request with an XML document in the request body then on...

Use Rule to Fire Off Net Send Type Messages
Outlook 2003 I would like to know if there is a way to use an Outlook rule to send something like a Net Send message to another computer. One possible stumbling block is that we have the Messenger service disabled on our machines, so Net Send itself will not work unless we enable that service. For the few machines that the message would need to go to, we may be able to turn on the Messenger service. Nonetheless, I would like to know if there are any ways to accomplish this without needing to enable the Messenger service. You may be wondering why we want to do this. We have a mailbo...

what function should i use
in excel 07 what function should I use to calculate the present value of a loan or investment? On Fri, 3 Oct 2008 16:57:41 -0700 (PDT), "kmack1982@gmail.com" <kmack1982@gmail.com> wrote: >in excel 07 what function should I use to calculate the present value >of a loan or investment? PV function Returns the present value of an investment. The present value is the total amount that a series of future payments is worth now. For example, when you borrow money, the loan amount is the present value to the lender. Syntax PV(rate,nper,pmt,fv,type) Rate is the interest ra...

eConnect Posting Transaction
I'm using eConnect v7 to connect to GP Enterprise. I'm in the process of writing the program to migrate all of our customers from our billing system (customer's info and their transactions historically) using VB6 and connecting using the ExecProcsXML.ExecStoredProcedure7 method on the eConnect Object. The problem I'm having is that when I'm creating the transaction batch to process all the credits and/or payments for a customer I have no way to tell the transaction record (from the XML object exposed to me) to post to the oldest open invoice/debit and work its way up to the...

countif using cell refrences within a string
hi I am trying to use a count if to count the number of times certain tex appears in a data sheet. eg =COUNTIF(atl!J:J,"*Program 'Panic' - triggered by user*") this works fine, however to make this app more user friendly i want t be able to make the text part of look at a a cell instead of th 'Panic' part so i want it to look like this =COUNTIF(atl!J:J,"*Program '("a2")' - triggered by user*") Where a2 is the cell refernece. Thanks in advance -- Message posted from http://www.ExcelForum.com =COUNTIF(atl!J:J,"*Program '&quo...

How do I setup Windows Desktop Search to find Emails on 2003 Exchange server?
Hello, I use Outlook 2003 Exchange Server. I can't get Windows Desktop Search to find emails. I've downloaded an add-in to index .msg files, but I still don't find messages in my inbox. What do I need to do? Seems like it shouldn't be this hard! Maybe its just me. Thank you, Craig S are you using cached mode with exchange? -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://www.slipstick.com/outlook/ol2007/ Outlook Tips by email: dailytips-subscribe-requ...

Inventory Adjustment Post to GL
Do inventory adjustments post to the general ledger as a batch? I don't see a place to set up where this hits under the "Assign GL Accounts" screen in Store Ops. ...

Server Error in '/' Application. 01-24-06
when click on ( Download Report ) in MS CRM 3.0 This error appear ==> Server Error in '/' Application. Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" confi...

Posting Accounts #2
I am using GP 9.0 and have 2 departments in GL and want sales to post to the correct department according to customer class. The setup is using positng accounts from the customer not the item. All items are defaulting to the correct department except one.........we have an item for shipping (Misc Charge Type) and that account is defaulting to the sales account. I am looking for a work around to have the shipping post to the correct GL account not the product sales account. Also, I trying to locate a SOP report that prints all the money received for a particular day. I did see the posti...

Using shared resources between multiple projects
I'm writing a solution formed by some projects (all mfc based). I'm thinking if it is possible using shared resources between projects, in order to make easy multilanguage support. What do you think about this? Is it a possible approach? Is it possible I have a performance issue? Should this solution give me some other problems? Regards, Paolo > I'm writing a solution formed by some projects (all mfc based). I'm > thinking if it is possible using shared resources between projects, in > order to make easy multilanguage support. > What do you think about this? Is it...

NOLOCK on View / Stored Procedure in SQL Server 2005
I have a SQL Server 2005 database that was several stored procedures and several views. Will the stored procedure listed below with the NOLOCK statement not lock the dbo.Team table? The stored procedure has numerous other processing details but I took that part out of the procedure. My goal is to make sure the dbo.Team table is not locked. Please help me resolve this issue. CREATE view v_Team AS SELECT * from dbo.Team CREATE PROCEDURE dbo.MasterTeam AS select * from v_Team (NOLOCK) GO On Tue, 18 May 2010 08:01:01 -0700, Joe K. <JoeK@discuss...

I know that this is a test, but have been unable to post.
I am having a problem posting a problem to microsoft.public.officeupdate, microsoft.public.outlook.general and microsoft.public.windowsupdate. I can post to microsoft.public.publisher. So, maybe with this post it will arrive somehere. My problem is that recently when closing Office Outlook 2007 on my Windows Vista Ultimate system I have noticed that I get a message that Outlook 2007 did not close correctly and that the data file is being checked for errors. I went to Outlook's Help drop down menu and chose Office Diagnostics. After the system completed its process, I learned that O...

xml tags unrecognised by server??
I am new to xml and I am trying to use xml as web.config file. I will use asp.net form to get the web.config settings. Below is my web.config file: <?xml version="1.0" encoding="UTF-8" ?> <configuration> <system.web> <appSettings> <add key="Searcharoo_VirtualRoot" value="http://localhost/" /> <!--website to spider--> <add key="Searcharoo_RequestTimeout" value="5" /> <!--5 second timeout when downloading--> <add key="Searcharoo_RecursionLimit" value="20...

Postings
In the newgroups, every posting has a "Subject", a "From" entry and a "Sent" entry. The "Sent" entry contains a date and a time. Whose "date" and "time" is that; is it the submitter's, Microsoft's or ????'s. That time is PST. Pacific Standard Time. The time that the message is posted by the MS servers on the west coast of the U.S. Biff >-----Original Message----- >In the newgroups, every posting has a "Subject", a "From" >entry and a "Sent" entry. > >The "Sent" e...

Duplicate Transactions, One When Pending, One When Posted
I'm sure this has been addressed, but I couldn't seem to find an answer searching: My problem is, a transaction occurs at my bank, and MM2K7 downloads the data for it. Once that transaction moves from "Pending" to "Posted" at my bank, the transaction data changes, so MM downloads it again. Sometimes I get a possible duplicate message from MM, sometimes I don't. What are people doing to handle this situation? Thank you. This is a problem with your bank, not with Money. Eventually they should fix it. Call them. In the meantime VOID the pending transacti...

ExecuteXmlReader
I'm trying to use an SqlCommand.ExecuteXmlReader() to write data to an XML file. Most of the code is below. The result I'm seeing is that the schema file is written and looks good, but the XML file has no data other than an empty <root> node. Is there something simple I'm missing? BTW, running the same query in query analyzer returns 7 nodes. Thanks -- Steve -------------------- string cmdString = "SELECT * FROM TestTable order by column1 FOR XML AUTO, XMLDATA"; DataSet ds = new DataSet(); using ( SqlConnection sc = new SqlConnection( connectionStr...

Using Conditional Formatting to Pass/Fail
I want to use conditional formatting to return a pass fail number based on a numeric value. However the number has to fall between 2 values. i.e A product will pass if the numeric value it achieves is between 2 and 8 but if the value is less than 2 or greater than 8 it will fail. I can't seem to get the if statement to understand the concept of pass being between 2 and 8. -- mrsatroy Conditonal formats return formats and not numbers. The CF should be farily easy. if Cell value is not Between 2 and 8 then add your pattern. If you want a value returned then in a differnet ce...