Re: May I miss something with the http package - problems with data loss via http::geturl?
- From: Uwe Klein <uwe_klein_habertwedt@xxxxxxxxxxx>
- Date: Tue, 08 Dec 2009 16:01:16 +0100
MartinLemburg@Siemens-PLM wrote:
Hello Uwe and Ralf,I' ve been a bit of an a*hole and tried the following:
an example URL is:
http://www.portal.gmx.net/de/themen/auto/bildergalerie/8966766.html
Since in tcl/tk 8.6b1.1 basekit the http package does not allow to see
the Content-Length for this server:
% array set meta [http::meta $token];
% info exists ${token}(size);
0
% set ${token}(totalsize)
0
Because of this I can not verify if data is missing after downloading
text or binary data.
wget and curl provide the Content-Length HTTP field!
Why does the http package not provide a "state(size)" (or "meta
(Content-Length)") field, while wget and curl show it as header data?
% info patchlevel
8.5.7
% package require http
2.7.3
% set url http://www.portal.gmx.net/de/themen/auto/bildergalerie/8966766.html
http://www.portal.gmx.net/de/themen/auto/bildergalerie/8966766.html
% set t [http::geturl $url]
::http::1
% upvar #0 $t s
% array names s
sock http querylength -queryblocksize state charset type -binary
url -keepalive
-timeout socketinfo queryoffset binary -strict totalsize -validate
-protocol con
nection -queryprogress -headers -blocksize coding status transfer
transfer_final
body currentsize meta -type
% info exists s(size)
0
% set s(totalsize)
0
% array set m $s(meta)
% array names m
Expires Vary Cache-Control Set-Cookie X-AppServerHostname Server
Pragma Connecti
on Transfer-Encoding Content-Type Content-Language Date Content-
Encoding
% info exists m(Content-Length)
0
I saw, that images have gray areas, where colors should have been. So
these images seems to be corrupted.
But I was not able to reproduce this behavior in a web browser.
Thanks for any advise!
Martin Lemburg
On 8 Dez., 13:30, Uwe Klein <uwe_klein_habertw...@xxxxxxxxxxx> wrote:
MartinLemburg@Siemens-PLM wrote:
I'm afraid, that you are (in this case) wrong.
My answer was correct, You assumed a different question answered ;-)
I downloaded via http::geturl binary data and it is incomplete, too!
So images misses data at the end of the files, so in a viewer parts of
the images are simply grey.
The HTTP content length is equal to the size of the files downloaded
from this web server, but missing data.
And related to the incomplete "</html>" tag ... sometimes it is only
"</ht", sometimes "</htm".
is that limited to generated content or do you see it for images too?
I would assume it is an issue with content producing child death
and shaky buffer handling on the server side ( i.e. buffered data
judged complete after SIGCHLD versus EOF in stream.)
> P.S.: But I really would like to know how web browsers manage this?!
After EOF or indicated amount of data received assume that
all (open) tags are closed ( even if they were missing incomplete in
the received data). (handling missing </tab> tag was an issue in Netscape
versus IE afair )
Ignore errors from the image reading/rendering libraries.
( Compare (broken/truncated)images as viewed in
a browser and forex in xv.
uwe
while true ; do
wget -o test.hd -S "http://www.portal.gmx.net/de/themen/auto/bildergalerie/8966766.html"
done
all files have the same ending
</html ( missing >\n(\r?) )
uwe
.
- Follow-Ups:
- References:
- May I miss something with the http package - problems with data loss via http::geturl?
- From: MartinLemburg@Siemens-PLM
- Re: May I miss something with the http package - problems with data loss via http::geturl?
- From: Ralf Fassel
- Re: May I miss something with the http package - problems with data loss via http::geturl?
- From: MartinLemburg@Siemens-PLM
- Re: May I miss something with the http package - problems with data loss via http::geturl?
- From: Uwe Klein
- Re: May I miss something with the http package - problems with data loss via http::geturl?
- From: MartinLemburg@Siemens-PLM
- Re: May I miss something with the http package - problems with data loss via http::geturl?
- From: Uwe Klein
- Re: May I miss something with the http package - problems with data loss via http::geturl?
- From: MartinLemburg@Siemens-PLM
- May I miss something with the http package - problems with data loss via http::geturl?
- Prev by Date: Re: May I miss something with the http package - problems with data loss via http::geturl?
- Next by Date: Re: May I miss something with the http package - problems with data loss via http::geturl?
- Previous by thread: Re: May I miss something with the http package - problems with data loss via http::geturl?
- Next by thread: Re: May I miss something with the http package - problems with data loss via http::geturl?
- Index(es):
Relevant Pages
|