Skip to content

Commit 0f6afbb

Browse files
committed
some adjustments for open handles
1 parent 1dff12d commit 0f6afbb

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

php/.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"phpunit.phpunit": "/workspaces/vaas/php/tests/vaas/vendor/bin/phpunit",
33
"phpunit.php": "/usr/local/bin/php",
44
"php.debug.ideKey": "vsc",
5-
"php.debug.executablePath": "/usr/local/bin/php"
5+
"php.debug.executablePath": "/usr/local/bin/php",
6+
"php.suggest.basic": false
67
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
files/*

php/src/vaas/Vaas.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,18 @@ public function ForFile(string $path, $upload = true, string $uuid = null): Vaas
196196
$fileStream = \Amp\File\openFile($path, 'r');
197197
$fileSize = \filesize($path);
198198

199-
return new VaasVerdict(
199+
$verdict = new VaasVerdict(
200200
$this->UploadStream(
201201
$fileStream,
202202
$verdictResponse->url,
203203
$verdictResponse->upload_token,
204204
$fileSize,
205205
$verdictResponse->guid)
206206
);
207+
208+
$fileStream->close();
209+
210+
return $verdict;
207211
}
208212

209213
return new VaasVerdict($verdictResponse);

php/src/vaas/VaasConnection.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ public function GetResponse($requestId): DeferredFuture {
147147
return $future;
148148
}
149149

150+
public function RemoveResponse($requestId): void {
151+
$this->responses->delete($requestId);
152+
}
153+
150154
public function GetConnectedWebsocket(): WebsocketConnection
151155
{
152156
if (!isset($this->WebSocketClient)) {

0 commit comments

Comments
 (0)