Ticket UUID: | 496733 | |||
Title: | Possible fix for obscure fconfigure bug | |||
Type: | Bug | Version: | obsolete: 8.4a4 | |
Submitter: | mdejong | Created on: | 2001-12-26 06:50:10 | |
Subsystem: | 24. Channel Commands | Assigned To: | mdejong | |
Priority: | 3 Low | Severity: | ||
Status: | Closed | Last Modified: | 2002-01-26 07:30:59 | |
Resolution: | Accepted | Closed By: | mdejong | |
Closed on: | 2002-01-26 00:30:58 | |||
Description: |
I ran into this bug while re-implementing fconfigure in Jacl. It seems the Tcl_GetChannelOption function does not quite know what to do about a channel that is neither readable nor writable. Here is what it currently returns: % set sock [socket -server accept 0] sock3 % fconfigure $sock -blocking 1 -buffering full -buffersize 4096 -encoding iso8859-1 -eofchar -translation -sockname {0.0.0.0 0.0.0.0 2001} The -eofchar and -translation properties should at least have some value in the list. What exactly these properties would be used for on a server socket is not clear. For example, why would you want to set the -blocking property on a server socket? Also note that the Tcl_SetChannelOption method does not know how to set these values since it is not clear if the input out the output value would be changed for a server socket. The quick solution I came up with was to just pretend these values are read only. It was easy to implement and test and I can't imagine this would actually matter to anyone, so it seemed like the right thing to do. The attached patch implements these changes and add some test cases that check the behavior. | |||
User Comments: |
mdejong added on 2002-01-26 07:30:59:
File Deleted - 15124: File Added - 16786: noread_write_channel.patch2 mdejong added on 2002-01-26 07:30:58: Logged In: YES user_id=90858 I added the attached patch to both the HEAD and the 8.3 branch. The socket-7.3 test has been fixed. hobbs added on 2002-01-25 01:30:04: Logged In: YES user_id=72656 I would also like to see this applied to the 8-3-1-branch. andreas_kupries added on 2002-01-25 01:20:49: Logged In: YES user_id=75003 The patch applied with offsets to the current head, but the result was ok. The patched core configured and compiled flawless (Linux). The test "socket-7.3" failed, because the length of the result returned by fconfigure changed now that eofchar and translation have values. I accept the patch, but also ask you to additionally update the failed test before committing everything. mdejong added on 2001-12-26 13:50:11: File Added - 15124: noread_write_channel.patch |
Attachments:
- noread_write_channel.patch2 [download] added by mdejong on 2002-01-26 07:30:58. [details]