8000 TOCTOU race between Quit() and reconnection · Issue #100 · ergochat/irc-go · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
TOCTOU race between Quit() and reconnection #100
Open
@slingamn

Description

@slingamn
  1. We check irc.quit at the start of Connect():

    irc-go/ircevent/irc.go

    Lines 615 to 617 in 5474a63

    if irc.quit {
    return ClientHasQuit // check this again in case of Quit() while we were asleep
    }
  2. This check can succeed and then Quit() can be called concurrently with the actual dial call
  3. The client will reconnect to the server and renegotiate, but will eventually be disconnected by the serverDidNotQuit check (we will think that we sent QUIT, so we'll wait for the server to disconnect us, but we won't wait forever)

We should probably just check irc.quit again after the dial succeeds, and if so, hang up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0