Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#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 felix winkelmann

Owner: changed from felix winkelmann to Jim Ursetto
Status: newassigned

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

comment:2 Changed 14 years ago by Jim Ursetto

Resolution: fixed
Status: assignedclosed

Thanks Felix. I've already tested this fix previously, so I know it behaves properly (for my definition of properly!)

comment:3 Changed 14 years ago by felix winkelmann

Milestone: 4.7.04.8.0

Milestone 4.7.0 deleted

comment:4 Changed 12 years ago by felix winkelmann

Milestone: 4.8.04.9.0

Milestone 4.8.0 deleted

Note: See TracTickets for help on using tickets.