Bug in http sending and http1.1 support
Original [issue 7](https://code.google.com/p/factplusplus/issues/detail?id=7) created by dtsarkov on 2007-09-19T14:07:06.000Z:
<b>What steps will reproduce the problem?</b> 1. Send a request that requires a large response e.g. multiple <ask>s
What is the expected output? A well formed xml reposonse
What do you see instead? A badly formed response with the begining of the xml repeated part way though the response instead of the end
What version of the product are you using? 1.1.8
On what operating system? Various
<b>Please provide any additional information below.</b> The loop sending chunks back was not including the offset of what had been sent.
I've also included http1.1 support which by default doesn't close the connection. Error for http1.1 from java client is: "java.net.SocketException: Connection reset" as it tries to reuse the connection. This also gives me a significant speed up on our heavily firewalled network.
See attached which fixes both. I personally would pull out the main loop but I went for the minimal change.
Comments (5)
-
reporter -
reporter Comment [
#2](https://code.google.com/p/factplusplus/issues/detail?id=7#c2) originally posted by dtsarkov on 2007-10-09T08:50:19.000Z:I've not seen any more badly formed xml in my tests so far but...
Sadly part of the problem still exists in 1.1.9 The problem is the closing of connections for each http post.
We are sending quite a lot of data to the server and it's dropping of the connection causes both a slow down and in the newer jdk 1.5 and up causes the entire communication to break down. We are unable to send a complete set of data with the current implementation.
The key is not having a "singleTransaction" but supporting multiple messages on the connection without dropping it.
i.e.
loop forever accept connection loop until remote client drops connection read reqest send response end loop end loop
What's missing is the inner loop.
Existing code causes intermittent exceptions of the form: java.net.SocketException: Connection reset
Thanks, M
-
reporter Comment [
#3](https://code.google.com/p/factplusplus/issues/detail?id=7#c3) originally posted by dtsarkov on 2007-10-09T09:30:04.000Z:I see the problem now, thanks for the explanation.
Does the following patch help?
Best, Dmitry
-
reporter Comment [
#4](https://code.google.com/p/factplusplus/issues/detail?id=7#c4) originally posted by dtsarkov on 2007-10-09T09:34:47.000Z:Wow that was quick! It's almost identical to the changes I made to the current code. I'm testing it now and it looks good.
-
reporter Comment [
#5](https://code.google.com/p/factplusplus/issues/detail?id=7#c5) originally posted by dtsarkov on 2007-10-09T14:20:22.000Z:Well, I manage to have all the infrastructure ready and now I just use it properly. Thanks for enlighten me.
- Log in to comment
Comment [
#1](https://code.google.com/p/factplusplus/issues/detail?id=7#c1) originally posted by dtsarkov on 2007-10-04T17:34:45.000Z:Hi,
thanks for the fix. I did some refactoring of the code and incorporate it to the latest version. Can you please confirm that the problem is fixed in 1.1.9.