Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2002-01-26
07:30 • Ticket [496733ffff] Possible fix for obscure fconfigure bug status still Clo... artifact: 309f7a73c6 user: mdejong
07:30 • Closed ticket [496733ffff]. artifact: 7e3c8fbf9d user: mdejong
07:30 • Add attachment noread_write_channel.patch2 to ticket [496733ffffffffff|... artifact: 7415e07a1a user: mdejong
2002-01-25
01:30 • Ticket [496733ffff] Possible fix for obscure fconfigure bug status still Ope... artifact: 30581b3ee8 user: hobbs
01:20 • Ticket [496733ffff]: 6 changes artifact: a4f8d872fa user: andreas_kupries
2001-12-26
13:50 • Ticket [496733ffff]: 4 changes artifact: 6d8684dea8 user: mdejong
06:50 • New ticket [496733ffff]. artifact: 8bb01f3870 user: mdejong

Possible fix for obscure fconfigure bug

Closed / Accepted496733ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2001-12-26 06:50:10
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.
mdejongplain2001-12-26 13:50:11
File Added - 15124: noread_write_channel.patch
andreas_kupriesplain2002-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.
hobbsplain2002-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.
mdejongplain2002-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.
mdejongplain2002-01-26 07:30:59
File Deleted - 15124: 



File Added - 16786: noread_write_channel.patch2
Log in (anonymous is fine) to add a comment.

Attachments: