I have been getting a few strange responses from the http server for the tile date. I guestimate this issue to be present about 2% of the time. When I request a tile I get a valid response on the socket like this:
Note that the Content-Length is announced to be 8966 bytes. In the next read on the socket I receive more data that was announced from the server. If I examine the extra data after the end of the border as announced in Content-Length I get another (valid?) response for the same map tile appended at the end of the data. Headers are slightly different but since the second Content-Length is identical I assume something has gone wrong with caching and that perhaps the cache has appended its response to the original server response:
The second chunk of data seems to indicate that this was a Cache HIT vs. the initial response that announced a MISS. I will stress again that this data was received in sequence, on the same socket, for one single request. So request for: http://a.tile.openstreetmap.org/18/135565/89323.png, resolved a.tile.openstreetmap.org to 31.3.110.20. Then I wait for a response, get headers as seen in the first header block above, receive a valid PNG image but then the TCP stream simply contains more data beyond the expected end of the PNG data - a new headers and another (I assume valid) PNG data block. If I am not mistaken this is highly unusual and violates the HTTP protocol. So my question is: Is this "normal" and I simply don't understand a part of the HTTP protocol specification or is this a bad response from the OSM servers? If it is indeed a bad response it would probably make sense to look why this behaviour occurs. asked 27 Feb, 09:45 AlesO |
I'd remove your final paragraph - best stick to one thing at a time!