Skip to content

SENDSPIN_SERVER_URL can export a stale dialled URL for an inbound connection on an -s run #34

Closed

Description

@chrisuthe

SENDSPIN_SERVER_URL is documented as the URL this run dialled, on an -s run only. It can be a URL that has nothing to do with the connection the stream arrived on.

-s leaves the inbound listener up. OutboundConnection::dialed_url_ is set when a dial is attempted and never cleared, so once any dial has been attempted — succeeded and later dropped, or failed outright — a server that dials in afterwards produces a stream whose start hook exports the stale URL of that earlier attempt. src/main.cpp cannot tell the two apart: the library reports that a connection is up without saying where it came from.

The docs already hedge this (README, docs/wiki/Controlling-the-Player.md and src/hooks.h all point a hook that must be certain at SENDSPIN_SERVER_ID), but a variable documented as "the URL this run dialled" that sometimes describes a different connection is still wrong, and the hedge is a workaround rather than a fix.

Closing it properly needs sendspin-cpp to name the live connection's origin — there is no connect callback and nothing exposing a connection's URL or direction. Short of that, clearing dialed_url_ when the outbound attempt is no longer what holds the connection would at least turn a wrong answer into no answer, which is what the "left unset rather than exported empty" rule elsewhere in the hook environment already promises.

Raised by Copilot on #29 against src/main.cpp:912; the code is #28's, so it belongs here rather than on that PR.

Activity

  1. added
    bug
    on Aug 28, 2026
  2. chrisuthe commented on Aug 30, 2026

    @chrisuthe
    MemberAuthor

    Fixed by #42 (commit 19558e0, "Stop exporting a stale dialled URL to the stream hooks"), which shipped in v0.1.5 — the issue was just never closed at the time.

    Closing it now against the current release, 0.1.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions