Public Access
Stop IRC by hand; remove mDNS
IrcService::disconnect() stops the session from any state: QUIT if connected, then no more retries. /quit goes through it (before, it only stopped a connected session; while waiting for Wi-Fi or retrying it did nothing), and so does the new `irc stop` command. Stopped by hand, opening the IRC App no longer reconnects; typing a line does. mDNS is gone: it never crossed the dev box's routed network, and it cost about 7.5 KB of RAM. Pushes go to the IP shown in Settings -> Firmware, which drops its Name row. OTA Q54 records the change. On the device, Debug Build: 105.6 KB free with Wi-Fi (was 98); with IRC on TLS 54 KB free (was 46); after `irc stop`, back to 99 KB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
@@ -31,9 +31,12 @@ class IrcService : public Service {
|
||||
const char* name() const override { return "irc"; }
|
||||
void start() override;
|
||||
|
||||
// Starts the session (the IRC App does this when opened); /quit stops it.
|
||||
// Starts the session (the IRC App does this when opened, unless you stopped it).
|
||||
void connect();
|
||||
// Stops it, from any state: says QUIT if connected, and stops retrying. /quit, `irc stop`.
|
||||
void disconnect();
|
||||
bool running() const { return wanted_; }
|
||||
bool stoppedByUser() const { return stoppedByUser_; }
|
||||
Status status() const { return status_; }
|
||||
|
||||
// Read or act on the session while holding its lock: withSession([](IrcSession& s) { ... }).
|
||||
@@ -78,6 +81,9 @@ class IrcService : public Service {
|
||||
ReconnectPolicy backoff_;
|
||||
std::string partial_;
|
||||
volatile bool wanted_ = false;
|
||||
volatile bool stoppedByUser_ = false; // a manual stop: opening the App doesn't reconnect
|
||||
volatile bool stopRequested_ = false;
|
||||
bool quitSent_ = false; // /quit already queued its QUIT
|
||||
volatile bool restart_ = false;
|
||||
volatile Status status_ = Status::Stopped;
|
||||
bool open_ = false;
|
||||
|
||||
Reference in New Issue
Block a user