[Asterisk-code-review] streams: Ensure that stream is closed in ast_stream_and_wait on error (asterisk[master])

Peter Fern asteriskteam at digium.com
Tue Nov 22 08:06:50 CST 2022


Attention is currently required from: N A.

Peter Fern has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/19574 )

Change subject: streams:  Ensure that stream is closed in ast_stream_and_wait on error
......................................................................


Patch Set 2:

(1 comment)

Patchset:

PS2: 
> It may also be worth adding a \note in file.h that if failure is encountered, the stream will automatically be closed.

I can add the note tomorrow - it's super-late in this part of the world.

> Is there any problem if callers do? Are there any instances of checking the returning code and calling stopstream that could now be removed?

I'll have to review again, but in almost all cases where the return code is checked, it's only to get any entered digits. In cases where the stream is closed, it's generally done unconditionally, by calling stopstream without considering the return code. Calling stopstream is safe in any case, since it checks that a stream exists before calling closestream on it.



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19574
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ie46b67314590ad75154595a3d34d461060b2e803
Gerrit-Change-Number: 19574
Gerrit-PatchSet: 2
Gerrit-Owner: Peter Fern <asterisk at obfusc8.org>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: N A <asterisk at phreaknet.org>
Gerrit-Attention: N A <asterisk at phreaknet.org>
Gerrit-Comment-Date: Tue, 22 Nov 2022 14:06:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: N A <asterisk at phreaknet.org>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20221122/b64da770/attachment.html>


More information about the asterisk-code-review mailing list