Re: May I miss something with the http package - problems with data loss via http::geturl?



MartinLemburg@Siemens-PLM wrote:
Hello Uwe and Ralf,

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


I' ve been a bit of an a*hole and tried the following:
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

.



Relevant Pages

  • Re: May I miss something with the http package - problems with data loss via http::geturl?
    ... Since in tcl/tk 8.6b1.1 basekit the http package does not allow to see ... Expires Vary Cache-Control Set-Cookie X-AppServerHostname Server ... I saw, that images have gray areas, where colors should have been. ...
    (comp.lang.tcl)
  • RE: Outlook RPC over HTTp deosnt work
    ... try to use RPC over HTTP to connect the Exchange Server. ... What SBS is running on the problematic Server? ...
    (microsoft.public.windows.server.sbs)
  • Re: RPC over HTTP
    ... I will help you with the PRC over Http issue in this thread. ... and go through the Internet option. ... On the Web Server Certificate page shows. ... Microsoft CSS Online Newsgroup Support ...
    (microsoft.public.windows.server.sbs)
  • Re: RPC over HTTP
    ... Are there any other ways of configuring the RPC over HTTP? ... Outlook Web Access, Business Website and so on. ... On the Web Server Certificate page shows. ...
    (microsoft.public.windows.server.sbs)
  • Re: MSAS Licensing Part II
    ... wish to use http access then you must have Enterprise Edition. ... PTS looks at the server name. ... You will note that all of this is totally transparent to the client. ...
    (microsoft.public.sqlserver.olap)