Re: Bugs in http
- From: "tom.rmadilo" <tom.rmadilo@xxxxxxxxx>
- Date: Tue, 10 Nov 2009 13:52:30 -0800 (PST)
On Nov 10, 1:29 pm, drscr...@xxxxxxxxx wrote:
tom.rmadilo wrote:
I just tried this on Windows Vista, with ActiveTcl and http version
2.7.3.
I get exactly the same buggy behavior as described by DrS. I get 4165
bytes of the file, also the same.
But I tried upping the buffer to 10k and it works fine.
With the 4k buffer it consumes almost 100% of 1 cpu.
Thanks for confirming this. It is interesting that it would work with
10k as buffer size. By the way, I tried this with Activetcl version
8.4.19 and still get the same buggy behavior. Unless they happen to
share the same http code, I suspect the bug may be in the core.
I'm an admitted non-expert on the http code. But it looks very simple.
My guess is that the two procedure loop (httpCopyStart <-->
httpCopyDone) is not working correctly. The -blocksize sets the value
of the [fcopy -size] option. I thought it was the channel buffer size.
But setting the -blocksize larger than the file size is guaranteed to
prevent the two procedure loop.
I'm not sure what the need is for the two procedure loop, it is
probably so you can report progress during the copy.
I'm wondering if somehow [fcopy] suffers from the same very strange
issue I discovered with [chan pending]. What happens is that all
buffer bytes are copied out of the buffer. Then the channel becomes or
stays readable, but [chan pending] would return zero bytes. Any code,
even on the C level which relies on this will fail if it does not read
one byte. The buffer remains empty and readable.
[chan pending (input/output)] just reflects the C APIs:
Tcl_InputBuffered and Tcl_OutputBuffered. However, zero is supposed to
indicate that the channel isn't opened for the requested operation.
This obviously isn't true on the Tcl level. So something is screwy
here.
.
- Follow-Ups:
- Re: Bugs in http
- From: tom.rmadilo
- Re: Bugs in http
- References:
- Bugs in http
- From: drscrypt
- Re: Bugs in http
- From: tom.rmadilo
- Re: Bugs in http
- From: drscrypt
- Re: Bugs in http
- From: Gerald W. Lester
- Re: Bugs in http
- From: drscrypt
- Re: Bugs in http
- From: Gerald W. Lester
- Re: Bugs in http
- From: tom.rmadilo
- Re: Bugs in http
- From: drscrypt
- Bugs in http
- Prev by Date: Re: Bugs in http
- Next by Date: Re: socket limitations question
- Previous by thread: Re: Bugs in http
- Next by thread: Re: Bugs in http
- Index(es):
Relevant Pages
|