<p>Pau Espin Pedrol has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/10657">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">ipa: Simplify code in ipa_server_conn_read<br><br>By doing this change we remove a duplicated error code path and thus<br>avoid having to maintain an extra code path with function pointers.<br><br>Change-Id: I5bce9f92209cc2fb37b78792e34f7898c71d2327<br>---<br>M src/input/ipa.c<br>1 file changed, 4 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/57/10657/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/input/ipa.c b/src/input/ipa.c</span><br><span>index 26bf170..554644c 100644</span><br><span>--- a/src/input/ipa.c</span><br><span>+++ b/src/input/ipa.c</span><br><span>@@ -336,15 +336,13 @@</span><br><span>         LOGIPA(conn, LOGL_DEBUG, "message received\n");</span><br><span> </span><br><span>        ret = ipa_msg_recv_buffered(ofd->fd, &msg, &conn->pending_msg);</span><br><span style="color: hsl(0, 100%, 40%);">-   if (ret < 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+     if (ret <= 0) {</span><br><span>           if (ret == -EAGAIN)</span><br><span>                  return;</span><br><span style="color: hsl(0, 100%, 40%);">-         if (ret == -EPIPE || ret == -ECONNRESET)</span><br><span style="color: hsl(120, 100%, 40%);">+              else if (ret == -EPIPE || ret == -ECONNRESET)</span><br><span>                        LOGIPA(conn, LOGL_ERROR, "lost connection with server\n");</span><br><span style="color: hsl(0, 100%, 40%);">-            ipa_server_conn_destroy(conn);</span><br><span style="color: hsl(0, 100%, 40%);">-          return;</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (ret == 0) {</span><br><span style="color: hsl(0, 100%, 40%);">-          LOGIPA(conn, LOGL_ERROR, "connection closed with server\n");</span><br><span style="color: hsl(120, 100%, 40%);">+                else if (ret == 0)</span><br><span style="color: hsl(120, 100%, 40%);">+                    LOGIPA(conn, LOGL_ERROR, "connection closed with server\n");</span><br><span>               ipa_server_conn_destroy(conn);</span><br><span>               return;</span><br><span>      }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/10657">change 10657</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.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.osmocom.org/10657"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmo-abis </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I5bce9f92209cc2fb37b78792e34f7898c71d2327 </div>
<div style="display:none"> Gerrit-Change-Number: 10657 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Pau Espin Pedrol <pespin@sysmocom.de> </div>