<p>Joshua Colp has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8912">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_ari: Remove requirement that body exists when debug is on.<br><br>The "ari set debug" code for incoming requests incorrectly assumed<br>that all requests would contain a body. If one did not exist the<br>request would be incorrectly rejected. The response that was sent<br>was also incomplete as an incorrect function was used to construct<br>the response.<br><br>The code has now been changed to no longer require a request to have<br>a body and the response updated to use the correct function.<br><br>ASTERISK-27801<br><br>Change-Id: I4eef036ad54550a4368118cc348765ecac25e0f8<br>---<br>M res/res_ari.c<br>1 file changed, 3 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/12/8912/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_ari.c b/res/res_ari.c<br>index 006e25d..75af26b 100644<br>--- a/res/res_ari.c<br>+++ b/res/res_ari.c<br>@@ -984,9 +984,9 @@<br> struct ast_str *buf = ast_str_create(512);<br> char *str = ast_json_dump_string_format(body, ast_ari_json_format());<br> <br>- if (!buf || !str) {<br>+ if (!buf || (body && !str)) {<br> ast_http_request_close_on_completion(ser);<br>- ast_http_error(ser, 500, "Server Error", "Out of memory");<br>+ ast_ari_response_error(&response, 500, "Server Error", "Out of memory");<br> ast_json_free(str);<br> ast_free(buf);<br> goto request_failed;<br>@@ -1000,7 +1000,7 @@<br> for (var = get_params; var; var = var->next) {<br> ast_str_append(&buf, 0, "%s: %s\n", var->name, var->value);<br> }<br>- ast_verbose("%sbody:\n%s\n\n", ast_str_buffer(buf), str);<br>+ ast_verbose("%sbody:\n%s\n\n", ast_str_buffer(buf), S_OR(str, ""));<br> ast_json_free(str);<br> ast_free(buf);<br> }<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8912">change 8912</a>. To unsubscribe, 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/8912"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I4eef036ad54550a4368118cc348765ecac25e0f8 </div>
<div style="display:none"> Gerrit-Change-Number: 8912 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@digium.com> </div>