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:
Dylan K. Taylor 2020-05-06 13:32:18 +01:00
parent ff53ddd3ad
commit e392a6a807

View File

@ -45,11 +45,6 @@ class PrepareEncryptionTask extends AsyncTask{
private $handshakeJwt = null;
/** @var PublicKeyInterface */
private $clientPub;
/**
* @var \Closure
* @phpstan-var \Closure(string $encryptionKey, string $handshakeJwt) : void
*/
private $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->clientPub = $clientPub;
$this->storeLocal(self::TLS_KEY_ON_COMPLETION, $onCompletion);
$this->onCompletion = $onCompletion;
}
public function onRun() : void{