mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 01:09:44 +00:00
PrepareEncryptionTask: do not store onCompletion as a field
pthreads will screw around with it and make it do things it's not supposed to, which is the exact reason why we have thread-local storage to begin with.
This commit is contained in:
parent
ff53ddd3ad
commit
e392a6a807
@ -45,11 +45,6 @@ class PrepareEncryptionTask extends AsyncTask{
|
|||||||
private $handshakeJwt = null;
|
private $handshakeJwt = null;
|
||||||
/** @var PublicKeyInterface */
|
/** @var PublicKeyInterface */
|
||||||
private $clientPub;
|
private $clientPub;
|
||||||
/**
|
|
||||||
* @var \Closure
|
|
||||||
* @phpstan-var \Closure(string $encryptionKey, string $handshakeJwt) : void
|
|
||||||
*/
|
|
||||||
private $onCompletion;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @phpstan-param \Closure(string $encryptionKey, string $handshakeJwt) : void $onCompletion
|
* @phpstan-param \Closure(string $encryptionKey, string $handshakeJwt) : void $onCompletion
|
||||||
@ -62,7 +57,6 @@ class PrepareEncryptionTask extends AsyncTask{
|
|||||||
$this->serverPrivateKey = self::$SERVER_PRIVATE_KEY;
|
$this->serverPrivateKey = self::$SERVER_PRIVATE_KEY;
|
||||||
$this->clientPub = $clientPub;
|
$this->clientPub = $clientPub;
|
||||||
$this->storeLocal(self::TLS_KEY_ON_COMPLETION, $onCompletion);
|
$this->storeLocal(self::TLS_KEY_ON_COMPLETION, $onCompletion);
|
||||||
$this->onCompletion = $onCompletion;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onRun() : void{
|
public function onRun() : void{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user