Re: HTTP Download complete detect using TCP sniffer
- From: "Alexander Nickolov" <agnickolov@xxxxxxxx>
- Date: Tue, 28 Nov 2006 13:05:22 -0800
Well, each HTTP response has a Content-length header
so you know how much data to expect back. Parsing the
original HTML page will tell you which resources will
the client request so you can start ticking them off as they
arrive. The page is complete when all resources from
its HTML have been received. You have to parse the
Content-type as well, since the original request may
return something other than HTML, and the subsequent
requests may also return nested HTML (for example
a frameset and individual frames).
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"fdryan" <fdryan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:77058A3F-57F9-4EC5-8A4F-45D29428A396@xxxxxxxxxxxxxxxx
A timeout would have the advantage of simplicity and certainly would
overcome
the SSL HTTPS challenge. However the disadvantage would be that a timer
would be too slow when connection speeds are fast indicating a "Done"
later
than need be. When connection speeds are slow a timer could be too fast
indicating a premature "Done". Ignoring HTTPS for now, what in the "HTML
+
HTTP parsing" would tell me the HTTP download is complete please?
"Alexander Nickolov" wrote:
Well, the best you can do is with a little timeout. Since HTTP
is half-duplex, you always know when the client is requesting
by the fact it's sending data. When the request is sent you start
receiving data until the server is finished before the next request
is placed. Using a timeout after the last packet processed you
will know that either the download is finished, or the server
is hosed and won't send any more data. Alas, distinguishing
between the two is impossible without HTML + HTTP parsing...
BTW, you can't parse HTTPS since it's encrypted.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"fdryan" <fdryan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:451D9CB6-EB0F-4DE0-B9B2-CB1CF98DE4E0@xxxxxxxxxxxxxxxx
Thank you both for the suggestions. Reading the status codes, while it
shows
download progress, does not give me a "download done". A HTTP page
could
have multiple 200's as images and other content is downloaded. I want
to
avoid HTML parsing if possible as then I get into the whole decoding
the
GZIP
content thing and anyway I don't see how that would help me anyway. I
want
to determine the "download complete" at the packet level if at all
possible.
"Vladimir Scherbina" wrote:
Arkady,
I guess, implementing HTML parser/analyzer is not what OP wants ;)
To OP: In HTTP protocol there are status codes that actually maps to
some
well-known states, for example, 200 is "OK", 404 is "Not Found", etc.
So
you
can anaylize the HTTP protocol in sniffer in order to track the
requests
and
their status codes.
--
Vladimir (Windows SDK MVP)
"Arkady Frenkel" <arkadyf@xxxxxxxxxxxxxxxx> wrote in message
news:OHZ4cosEHHA.4024@xxxxxxxxxxxxxxxxxxxxxxx
You need to read HTML tags for that
Arkady
"fdryan" <fdryan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:37BF2735-FBB0-4456-8138-C3C64E738A66@xxxxxxxxxxxxxxxx
I have a functioning TCP/IP sniffer operating in promiscous mode and
I
can
see the traffic between my machine (client) and the server. I can
see
the
packet traffic, the 3 way SYN handshake, and the sequence and
acknowledge
numbers as the download proceeds no problem. There is no "FIN"
here
as
the
connection is "kept alive". How do I determine, as soon as
possible,
that a
typical web page HTTP(S) Download is complete?
.
- Follow-Ups:
- Re: HTTP Download complete detect using TCP sniffer
- From: fdryan
- Re: HTTP Download complete detect using TCP sniffer
- References:
- Re: HTTP Download complete detect using TCP sniffer
- From: Vladimir Scherbina
- Re: HTTP Download complete detect using TCP sniffer
- From: Alexander Nickolov
- Re: HTTP Download complete detect using TCP sniffer
- From: fdryan
- Re: HTTP Download complete detect using TCP sniffer
- Prev by Date: Re: HTTP Download complete detect using TCP sniffer
- Next by Date: Re: TCP or UDP?
- Previous by thread: Re: HTTP Download complete detect using TCP sniffer
- Next by thread: Re: HTTP Download complete detect using TCP sniffer
- Index(es):
Relevant Pages
|