[Asterisk-code-review] cli: Fix CLI blocking forever on terminating backslash (asterisk[master])

Kevin Harwell asteriskteam at digium.com
Tue May 31 16:25:38 CDT 2022


Attention is currently required from: N A.
Kevin Harwell has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/18004 )

Change subject: cli: Fix CLI blocking forever on terminating backslash
......................................................................


Patch Set 3: Code-Review-1

(4 comments)

File main/asterisk.c:

https://gerrit.asterisk.org/c/asterisk/+/18004/comment/86798ef9_49ca33a7 
PS1, Line 2988: 			res = read(ast_consock, mbuf + mlen, 1024);
> Done
Kinda torn on this. Current fix feels a bit "hackish", but given that this is an edge case what a proper fix may entail I think I'm okay with it.

I'm not sure about printing the usage though. If there is an error in the command text then it might make sense to do so.


File main/asterisk.c:

https://gerrit.asterisk.org/c/asterisk/+/18004/comment/348691d8_8744b019 
PS3, Line 2975: 					/* Abort on malformed tab completes */
If this solution is kept then I think a more detailed comment as to why would be helpful.


https://gerrit.asterisk.org/c/asterisk/+/18004/comment/1c02bbf3_13005940 
PS3, Line 2976: 					break;
Should this return vs break?


https://gerrit.asterisk.org/c/asterisk/+/18004/comment/3ea7a8ca_54bf3731 
PS3, Line 2984: 		matches = ast_el_strtoarr(mbuf);
If I understand, and if the edge case is triggered then mbuf now has "Usage: ...." it? Will this parse correctly?



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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I9810ac59304fec162da701653c9c834f0ec8f670
Gerrit-Change-Number: 18004
Gerrit-PatchSet: 3
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Attention: N A <mail at interlinked.x10host.com>
Gerrit-Comment-Date: Tue, 31 May 2022 21:25:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: N A <mail at interlinked.x10host.com>
Comment-In-Reply-To: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220531/3c6e691b/attachment.html>


More information about the asterisk-code-review mailing list