<p>Patch set 2:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4; color: #000000;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15848">View Change</a></p><p>3 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15848/2/include/asterisk/utils.h">File include/asterisk/utils.h:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/15848/2/include/asterisk/utils.h@291">Patch Set #2, Line 291:</a> <code style="font-family:monospace,monospace">int ast_base64url_encode_full(char *dst, const unsigned char *src, int srclen, int max, int linebreaks);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Docs for this and how is it different from _encode?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/15848/2/include/asterisk/utils.h@314">Patch Set #2, Line 314:</a> <code style="font-family:monospace,monospace">char *ast_base64url_decode_string(const char *src);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">So the _decode and _encode variants are for binary data and the _string variants are for when you have or expect a string, yes?  Might want to state that.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15848/2/main/utils.c">File main/utils.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/15848/2/main/utils.c@73">Patch Set #2, Line 73:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">static char base64[64];<br>static char base64url[64];<br>static char b2a[256];<br>static char b2a_url[256];<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Shouldn't these be in thread local storage?  Otherwise 2 threads could be trying to access it at the same time.  Even with TLS, you should document the concurrency restrictions in the header file.  <br>How are the initialized?  If there's data in these left over from a previous encode/decode, what will happen?  Do you need a base64_init function?  Maybe it's be better to have the caller pass in a work buffer.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Actually looking below...  Do these even need to be here at all?  They're small enough that they could be declared in the functions themselves.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15848">change 15848</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/15848"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: Icf094a2a54e87db91d6b12244c9f5ba4fc2e0b8c </div>
<div style="display:none"> Gerrit-Change-Number: 15848 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 03 May 2021 12:36:57 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>