#495 closed defect (fixed)
tcp-abandon-port polarity reversed, I think
Reported by: | Jim Ursetto | Owned by: | Jim Ursetto |
---|---|---|---|
Priority: | minor | Milestone: | 4.9.0 |
Component: | core libraries | Version: | 4.6.x |
Keywords: | Cc: | ||
Estimated difficulty: |
Description
To my understanding, (tcp-abandon-port x) is supposed to signal that port X should not be shutdown() when we close the Scheme port. If so, I think tcp-abandon-port is abandoning the wrong port, because it does:
if input port: set slot 2 to #t
if output port: set slot 1 to #t
but the close procedure does
if input port and slot 1 #t: ignore shutdown
if output port and slot 2 #t: ignore shutdown
tcp-abandon-port checks input/output port using (##sys#slot p 1) and I think that is where the bug is -- when #t, it sets slot 2, but #t means input-port.
To reproduce, do something like
(define-values (i o) (tcp-connect "3e8.org" 80)) (tcp-abandon-port o) (close-output-port o)
and note that the connection is closed even though the input port is still open.
If this analysis is incorrect, I would appreciate an explanation of what the heck tcp-abandon-port is supposed to do!
Change History (4)
comment:1 Changed 14 years ago by
Owner: | changed from felix winkelmann to Jim Ursetto |
---|---|
Status: | new → assigned |
comment:2 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Thanks Felix. I've already tested this fix previously, so I know it behaves properly (for my definition of properly!)
Yes, this seems to be the case. I changed this in
tcp-abandon-port
(experimental). I would be positively delighted if you could find the time to put it once again under your stern scrutiny.Therefore I remain,
your most obedient servant,
Felix Winkelmann