1
0
mirror of https://github.com/danog/MadelineProto.git synced 2025-01-23 00:51:12 +01:00

Make sure web runner is started

This commit is contained in:
Daniil Gentili 2023-01-20 15:38:55 +01:00
parent 12e6efa9ce
commit 61e4d677ca
4 changed files with 8 additions and 6 deletions

View File

@ -7765,11 +7765,10 @@ class InternalDoc extends APIFactory
/**
* Unset event handler.
*
* @param bool $disableUpdateHandling Whether to also disable internal update handling (will cause errors, otherwise will simply use the NOOP handler)
*/
public function unsetEventHandler(bool $disableUpdateHandling = false): void
public function unsetEventHandler(): void
{
$this->__call(__FUNCTION__, [$disableUpdateHandling]);
$this->__call(__FUNCTION__, []);
}
/**
* Update the 2FA password.

View File

@ -106,6 +106,8 @@ final class WebRunner extends RunnerAbstract
$payload = "GET $uri HTTP/1.1\r\nHost: {$_SERVER['SERVER_NAME']}\r\n\r\n";
Logger::log("Sending payload: $payload");
// We don't care for results or timeouts here, PHP doesn't count IOwait time as execution time anyway
// Technically should use amphp/socket, but I guess it's OK to not introduce another dependency just for a socket that will be used once.
\fwrite($res, $payload);

View File

@ -112,7 +112,9 @@ class Server extends SignalLoop
}
try {
Logger::log("Starting IPC server $session (web)");
$started = $started || WebRunner::start((string) $session, $id);
if (WebRunner::start((string) $session, $id)) {
$started = true;
}
} catch (Throwable $e) {
Logger::log($e);
}

View File

@ -101,9 +101,8 @@ trait Events
/**
* Unset event handler.
*
* @param bool $disableUpdateHandling Whether to also disable internal update handling (will cause errors, otherwise will simply use the NOOP handler)
*/
public function unsetEventHandler(bool $disableUpdateHandling = false): void
public function unsetEventHandler(): void
{
$this->event_handler = null;
$this->event_handler_instance = null;