Overview
| Artifact ID: | bb34fcc8b0815a6b77e383f287f5d9e30cdeda2d |
|---|---|
| Ticket: | 2895565fffffffffffffffffffffffffffffffff
Busyloop in vwait in innocent HTTP code |
| User & Date: | andreas_kupries on 2009-11-12 04:00:10 |
Changes
- icomment:
more notes, copied from the chat. [12:33]dgpaku? [12:34]aku? [12:34]dgpFor a channel with ChannelState field "encoding == NULL" [12:34]dgpthat's meant to be interpreted as "-encoding binary" ? [12:34]akuAFAIK yes [12:35]dgpI think the binary transfer rules of CopyData are broken then too. [12:36]dgpIf the out channel is -encoding binary [12:36]dgpand the in channel is not. [12:37]dgpthen the in channel reads with DoReadChars putting the data into the internal Tcl encoding in the process. [12:37]dgpCopyData then just copies these bytes out [12:37]dgpand that's not what -encoding binary is supposed to mean, AIUI [12:38]aku... Looking ... Ok, yes ... The DoWriteChars has this special recoding thing going on, and DoWrite doesn't ... [12:39]dgpI'm making guesses about what DoWrite() does I suppose. [12:39]aku(DoWriteChars line 3357 (8.5-branch)) [12:39]akuNo, I looked into DoWrite, and does EOL translation only, see my notes in the bug report [12:41]akuso, it seems we have to forget in/outBinary, and use only sameEncoding to switch between the Do* functions. [12:41]akuAnd the Do*Chars then internally handle -encoding binary [12:41]akuif needed [12:42]dgpthe other wrinkle is that [fcopy] docs say the -size argument is the number of bytes to copy [12:43]dgpIf that number of bytes leaves us in the middle of a multi-byte character, my interpretation is the partial character does not get copied. [12:44]akuew ... I believe it may be easier to treat this as doc bug, bytes only if -encoding binary on input, otherwise chars in the encoding. [12:44]Out of a cloud of smoke, emiliano appears! [12:45]dgpchars are usually more sensible things to count at the script level. [12:45]kostix is away (Automatically away due to idle) [12:45]dgpand for -encoding binary channels chars are bytes [12:45]akuOh ... I just read this ... If only the output channel is set to encoding "binary" the system will write the internal UTF-8 representation of the incoming characters [12:45]dgpoh [12:46]akuIOW, fcopy seems to have a special interpretation for -encoding binary on the output, which the implementation is not honoring [12:46]dgpno that's what the implementationj is doing. [12:46]dgpJust bizarre that a -encoding binary configuration on a channel means something different to a [puts] than it does to an [fcopy] [12:47]akuSure ? There is this GetByteArrayFromObj going on in DoWriteChars [12:47]akuAnd for the input as well it seems, have you fcopy.n open ? [12:47]dgpwhen outBinary is true, DoWrite() is called [12:47]akuRight! Thay may now explain why that is done [12:48]dgpsome archeology in order [12:48]akuThere is also ... If only the input channel is set to encoding "binary" the system will assume that the incoming bytes are valid UTF-8 characters [12:48]dgpDid the docs come first, or just record the botch rather than fix it. [12:48]akuThat explain the DoRead on input inBinary [12:48]dgpCause this is just too weird [12:48]akudocs vs code - timeline ordering - I do not remember [12:49]akuQuite [12:49]dgpI'll explore a bit more [12:49]akuThanks [12:49]akuShall I copy this discussion and add to the bug rpeort, as additional notes ? [12:49]dgpok [12:50]dgp[fcopy] is now [chan copy] ? [12:50]akuIIRC yes [12:50]dgpand [chan] is 8.5 or 8.6? [12:50]aku8.5 already [12:50]dgpOne option (not sure I like it yet).... [12:51]dgp...is to just leave [fcopy] untouched. [12:51]dgpdeclare it irretrievably confused. [12:51]dgpand start over and get [chan copy] sensibly correct. [12:52]akuI have to admit, I do not like that either. OTOH it may be our best bet going forward, leaving the fcopy compatible, and fixing the bug is to change fcopy for chan copy in newer code - login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"