Skip to content

Commit c66d491

Browse files
appkit-frameworkWyriHaximus
authored andcommitted
Global handling of channel and connection close
1 parent 9784298 commit c66d491

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

spec/generate.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ function amqpTypeToLength(string $type, string $e): array
226226
$connectionContent .= "use Bunny\\Protocol\\ContentBodyFrame;\n";
227227
$connectionContent .= "use Bunny\\Protocol\\ContentHeaderFrame;\n";
228228
$connectionContent .= "use Bunny\\Protocol\\HeartbeatFrame;\n";
229+
$connectionContent .= "use Bunny\\Protocol\\MethodChannelCloseFrame;\n";
229230
$connectionContent .= "use Bunny\\Protocol\\MethodConnectionCloseFrame;\n";
230231
$connectionContent .= "use Bunny\\Protocol\\MethodFrame;\n";
231232
$connectionContent .= "use Bunny\\Protocol\\ProtocolReader;\n";
@@ -309,7 +310,7 @@ function amqpTypeToLength(string $type, string $e): array
309310
$connectionContent .= " }\n";
310311
$connectionContent .= " }\n";
311312
$connectionContent .= "\n";
312-
$connectionContent .= " if (\$frameInAwaitList) {\n";
313+
$connectionContent .= " if (\$frameInAwaitList && !\$frame instanceof MethodConnectionCloseFrame && !\$frame instanceof MethodChannelCloseFrame) {\n";
313314
$connectionContent .= " continue;\n";
314315
$connectionContent .= " }\n";
315316
$connectionContent .= "\n";

src/Connection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Bunny\Protocol\ContentBodyFrame;
1111
use Bunny\Protocol\ContentHeaderFrame;
1212
use Bunny\Protocol\HeartbeatFrame;
13+
use Bunny\Protocol\MethodChannelCloseFrame;
1314
use Bunny\Protocol\MethodConnectionCloseFrame;
1415
use Bunny\Protocol\MethodFrame;
1516
use Bunny\Protocol\ProtocolReader;
@@ -93,7 +94,7 @@ public function __construct(
9394
}
9495
}
9596

96-
if ($frameInAwaitList) {
97+
if ($frameInAwaitList && !$frame instanceof MethodConnectionCloseFrame && !$frame instanceof MethodChannelCloseFrame) {
9798
continue;
9899
}
99100

0 commit comments

Comments
 (0)