Re: Bugs in http



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.
.



Relevant Pages

  • Re: reflected channel
    ... However I didn't find any hint on this 4k buffer ... Artifact: This Artifact Has Been Made Private. ... Have you implemented the 'watch' method in your channel type? ... This methods notifies the Tcl level that the specified channel ...
    (comp.lang.tcl)
  • Re: Bugs in http
    ... I'm an admitted non-expert on the http code. ... I thought it was the channel buffer size. ... I'm wondering if somehow [fcopy] suffers from the same very strange ...
    (comp.lang.tcl)
  • [PATCH] Documentation update for relay interface
    ... Here's updated documentation for the relay interface, ... +efficiently log and transfer large quantities of data from the kernel ... +A 'relay channel' is a kernel->user data relay mechanism implemented ... +buffer data. ...
    (Linux-Kernel)
  • [RFC] Staging: IIO: New ABI V2
    ... scan_elements is moved into the ring buffer device directory. ... for all the channel types. ... Contains trigger type specific elements. ... Not present if the offset is always 0 or unknown. ...
    (Linux-Kernel)
  • Re: [RFC] Staging: IIO: New ABI V2
    ... scan_elements is moved into the ring buffer device directory. ... for all the channel types. ... Contains trigger type specific elements. ... Not present if the offset is always 0 or unknown. ...
    (Linux-Kernel)