Skip to content

conn_sock.c audit #576

@mtrmac

Description

@mtrmac

If someone were very bored… conn_sock.c could use an overhaul.

  • There are basically 5 distinct kinds of file descriptors (console/notify source, stream/notify destination, listener), modeled as 2 structs + enums.
  • The code assumes, but does not structurally promise — or even document — that console/stream goes together (look at the opt_stdin special case)
  • AFAICS remote_sock_shutdown can close a file descriptor while a remote_sock_cb is still pending
  • if (num_read < 0) return G_SOURCE_CONTINUE; looks suspicious

I’m not at all saying any of these things matter in production.

I also rather strongly suspect that refactoring this with confidence requires tooling support. I.e. it is… both dependent on, and a prerequisite of :), moving to something like Rust.

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