Overview
| Artifact ID: | bc9989396414269386c18c02c638260bf4418b771c21b50386fb53b018c2b834 |
|---|---|
| Ticket: | 2b6b0a57296aecf267d19554a6a0c6f2ac83efbc
writes accepted after non-blocking chan close write |
| User & Date: | jan.nijtmans on 2026-11-20 16:41:51 |
Changes
- assignee changed to: "aku"
- closer changed to: "nobody"
- comment changed to:
After <nowiki>[chan close $chan write]</nowiki> on a non-blocking channel with output still queued, the channel stays writable until the background flush finishes: <nowiki>[puts]</nowiki> is accepted and the data is sent after the half-close. <verbatim> set p [open |[list [info nameofexecutable] child.tcl] r+] ;# child reads stdin later fconfigure $p -blocking 0 puts -nonewline $p [string repeat a 1000000] chan close $p write ;# returns at once, output still pending puts $p AFTER ;# no error; the child receives "AFTER" </verbatim> A blocking channel gives "channel wasn't opened for writing". CloseWrite() sets CHANNEL_CLOSEDWRITE, but TCL_WRITABLE is reset only when the flush completes (CloseChannelPart), and neither Tcl_GetChannelMode() nor CheckChannelErrors() looks at CHANNEL_CLOSEDWRITE. Seen with pipes and sockets.
- icomment: "Merged to [a98d8d4e44|trunk]."
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Pending"