Skip to content

Commit bd88278

Browse files
committed
We don't want to fail when sending a GoAway frame.
Ignore if the socket is already closed. Possible fix for GitHub issue #370
1 parent 76515bf commit bd88278

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/core/aws-server-protocol_handler.adb

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,17 @@ begin
290290
or else (CNF.HTTP2_Activated (LA.Server.Properties)
291291
and then not CNF.Security (LA.Server.Properties))
292292
then
293-
HTTP2.Frame.GoAway.Create
294-
(Stream_Id => 0,
295-
Error => HTTP2.C_Protocol_Error).Send (Sock_Ptr.all);
293+
-- We don't want to fail, if the socket is closed already
294+
-- we ignore the socket error.
295+
296+
begin
297+
HTTP2.Frame.GoAway.Create
298+
(Stream_Id => 0,
299+
Error => HTTP2.C_Protocol_Error).Send (Sock_Ptr.all);
300+
exception
301+
when Net.Socket_Error =>
302+
null;
303+
end;
296304

297305
exit For_Every_Request;
298306

0 commit comments

Comments
 (0)