[OSM-dev] High performance server [JOSM issues]

Jon Burgess jburgess777 at googlemail.com
Wed May 28 21:48:05 BST 2008


On Wed, 2008-05-28 at 22:22 +0200, Stefan de Konink wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
> 
> Jon Burgess schreef:
> > On Wed, 2008-05-28 at 18:53 +0200, Stefan de Konink wrote:
> >> I have created a packetcapture in wireshark and it is clear that the 
> >> connection is dropped. Who is responsible, I have no clue yet.
> >>
> >>
> >> http://xen.bot.nu/josm-request.pcap
> > 
> > 
> > Your content length is looking suspect:
> > 
> > Content-Length: 57004
> > 
> > but according to Wireshark, you've sent 133437 bytes of payload by the
> > point the connection is reset.
> 
> I think it is not wrong at all. If I look at the filesize, the
> content-length and the amount of data transfered by wget. It all looks
> ok. But why does JOSM/Java reset the connection?

According to the packet capture the data coming from the web server did
not stop at 57004, it kept sending more data. I'm guessing here, but it
looks like wget is truncating the data at the specified content-length
where as the Java HTTP client seems to keep taking more data until it
decides it has seen too much and aborts (actually it may be aborting
when the XML reader chokes on seeing the second <?xml after the end of
the first 57k lump.)

Try the following out for yourself. This emulates a simplistic HTTP
client using netcat. The request is the same as the one from your packet
capture

$ echo -e -n "GET /about/0.5/map?bbox=4.37,52.0,4.42,52.11 HTTP/1.0\r\n\r\n" | nc thuis.kinkrsoftware.nl 8000 > out2.xml

I stopped this command after about 20 seconds. In this time it had read
2.6MB of data and was still going. According to the content-length at
the top of the returned data it should have only returned 969087 bytes.

Doing a quick grep through the data returned shows it tried to start the
XML document 3 times:

$ grep "<?xml" out2.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>

	Jon






More information about the dev mailing list