-
-
Notifications
You must be signed in to change notification settings - Fork 497
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #1713 SP pipe_send leaks message if aio is canceled
- Loading branch information
Showing
6 changed files
with
29 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// | ||
// Copyright 2020 Staysail Systems, Inc. <[email protected]> | ||
// Copyright 2023 Staysail Systems, Inc. <[email protected]> | ||
// Copyright 2018 Capitar IT Group BV <[email protected]> | ||
// Copyright 2018 Devolutions <[email protected]> | ||
// | ||
|
@@ -207,6 +207,10 @@ inproc_pipe_send(void *arg, nni_aio *aio) | |
int rv; | ||
|
||
if (nni_aio_begin(aio) != 0) { | ||
// No way to give the message back to the protocol, so | ||
// we just discard it silently to prevent it from leaking. | ||
nni_msg_free(nni_aio_get_msg(aio)); | ||
nni_aio_set_msg(aio, NULL); | ||
return; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// | ||
// Copyright 2021 Staysail Systems, Inc. <[email protected]> | ||
// Copyright 2023 Staysail Systems, Inc. <[email protected]> | ||
// Copyright 2018 Capitar IT Group BV <[email protected]> | ||
// Copyright 2019 Devolutions <[email protected]> | ||
// | ||
|
@@ -512,6 +512,10 @@ tcptran_pipe_send(void *arg, nni_aio *aio) | |
int rv; | ||
|
||
if (nni_aio_begin(aio) != 0) { | ||
// No way to give the message back to the protocol, so | ||
// we just discard it silently to prevent it from leaking. | ||
nni_msg_free(nni_aio_get_msg(aio)); | ||
nni_aio_set_msg(aio, NULL); | ||
return; | ||
} | ||
nni_mtx_lock(&p->mtx); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// | ||
// Copyright 2021 Staysail Systems, Inc. <[email protected]> | ||
// Copyright 2023 Staysail Systems, Inc. <[email protected]> | ||
// Copyright 2018 Capitar IT Group BV <[email protected]> | ||
// Copyright 2019 Devolutions <[email protected]> | ||
// | ||
|
@@ -498,6 +498,10 @@ tlstran_pipe_send(void *arg, nni_aio *aio) | |
int rv; | ||
|
||
if (nni_aio_begin(aio) != 0) { | ||
// No way to give the message back to the protocol, so | ||
// we just discard it silently to prevent it from leaking. | ||
nni_msg_free(nni_aio_get_msg(aio)); | ||
nni_aio_set_msg(aio, NULL); | ||
return; | ||
} | ||
nni_mtx_lock(&p->mtx); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// | ||
// Copyright 2020 Staysail Systems, Inc. <[email protected]> | ||
// Copyright 2023 Staysail Systems, Inc. <[email protected]> | ||
// Copyright 2018 Capitar IT Group BV <[email protected]> | ||
// Copyright 2019 Devolutions <[email protected]> | ||
// | ||
|
@@ -158,6 +158,10 @@ wstran_pipe_send(void *arg, nni_aio *aio) | |
int rv; | ||
|
||
if (nni_aio_begin(aio) != 0) { | ||
// No way to give the message back to the protocol, so | ||
// we just discard it silently to prevent it from leaking. | ||
nni_msg_free(nni_aio_get_msg(aio)); | ||
nni_aio_set_msg(aio, NULL); | ||
return; | ||
} | ||
nni_mtx_lock(&p->mtx); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// | ||
// Copyright 2023 Staysail Systems, Inc. <[email protected]> | ||
// Copyright 2021 Capitar IT Group BV <[email protected]> | ||
// Copyright 2020 Staysail Systems, Inc. <[email protected]> | ||
// | ||
// This software is supplied under the terms of the MIT License, a | ||
// copy of which should be located in the distribution where this | ||
|
@@ -1821,6 +1821,10 @@ zt_pipe_send(void *arg, nni_aio *aio) | |
nni_msg *m; | ||
|
||
if (nni_aio_begin(aio) != 0) { | ||
// No way to give the message back to the protocol, so | ||
// we just discard it silently to prevent it from leaking. | ||
nni_msg_free(nni_aio_get_msg(aio)); | ||
nni_aio_set_msg(aio, NULL); | ||
return; | ||
} | ||
if ((m = nni_aio_get_msg(aio)) == NULL) { | ||
|