<h1>Project "FreeSWITCH Source" received a push.</h1>

<h2>branch: master updated</h2>
<pre>
       via: 2ec2a9b0d335a8d6a30ab5a92448ac3ad63649ff (commit)
      from: 46f6c6e42d2775ccfecb8f445ebbaaf32ab34df7 (commit)


</pre>= COMMIT LOG ===========================================================
<div class="highlight"><pre>committer: Anthony Minessale
comments: 
skip blocking writes on fs_cli to avoid backing up event socket

<span style="color: #000080; font-weight: bold">diff --git a/libs/esl/fs_cli.c b/libs/esl/fs_cli.c</span>
<span style="color: #000080; font-weight: bold">index 19e8d7f..a70d63f 100644</span>
<span style="color: #A00000">--- a/libs/esl/fs_cli.c</span>
<span style="color: #00A000">+++ b/libs/esl/fs_cli.c</span>
<span style="color: #800080; font-weight: bold">@@ -589,22 +589,36 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)</span>
 
         while(thread_running &amp;&amp; handle-&gt;connected) {
                 esl_status_t status = esl_recv_event_timed(handle, 10, 1, NULL);
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                if (WARN_STOP) {</span>
<span style="color: #A00000">-                        printf(&quot;Type control-D or /exit or /quit or /bye to exit.\n\n&quot;);</span>
<span style="color: #A00000">-                        WARN_STOP = 0;</span>
<span style="color: #A00000">-                }</span>
<span style="color: #00A000">+                int aok = 1;                </span>
 
                 if (status == ESL_FAIL) {
<span style="color: #A00000">-                        esl_log(ESL_LOG_WARNING, &quot;Disconnected.\n&quot;);</span>
<span style="color: #00A000">+                        if (aok) esl_log(ESL_LOG_WARNING, &quot;Disconnected.\n&quot;);</span>
                         running = -1; thread_running = 0;
                 } else if (status == ESL_SUCCESS) {
<span style="color: #00A000">+#ifndef WIN32</span>
<span style="color: #00A000">+                        fd_set can_write;</span>
<span style="color: #00A000">+                        int fd;</span>
<span style="color: #00A000">+                        struct timeval to;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                        fd = fileno(stdout);</span>
<span style="color: #00A000">+                        memset(&amp;to, 0, sizeof(to));</span>
<span style="color: #00A000">+                        FD_ZERO(&amp;can_write);</span>
<span style="color: #00A000">+                        FD_SET(fd, &amp;can_write);</span>
<span style="color: #00A000">+                        to.tv_sec = 0;</span>
<span style="color: #00A000">+                        to.tv_usec = 100000;</span>
<span style="color: #00A000">+                        if (select(fd + 1, NULL, &amp;can_write, NULL, &amp;to) &gt; 0) {</span>
<span style="color: #00A000">+                                aok = FD_ISSET(fd, &amp;can_write);</span>
<span style="color: #00A000">+                        } else {</span>
<span style="color: #00A000">+                                aok = 0;</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+#endif</span>
<span style="color: #00A000">+                        </span>
                         if (handle-&gt;last_event) {
                                 const char *type = esl_event_get_header(handle-&gt;last_event, &quot;content-type&quot;);
                                 int known = 0;
 
                                 if (!esl_strlen_zero(type)) {
<span style="color: #A00000">-                                        if (!strcasecmp(type, &quot;log/data&quot;)) {</span>
<span style="color: #00A000">+                                        if (aok &amp;&amp; !strcasecmp(type, &quot;log/data&quot;)) {</span>
                                                 const char *userdata = esl_event_get_header(handle-&gt;last_event, &quot;user-data&quot;);
                                                 
                                                 if (esl_strlen_zero(userdata) || esl_strlen_zero(filter_uuid) || !strcasecmp(filter_uuid, userdata)) {
<span style="color: #800080; font-weight: bold">@@ -631,7 +645,7 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)</span>
                                         } else if (!strcasecmp(type, &quot;text/disconnect-notice&quot;)) {
                                                 running = -1; thread_running = 0;
                                                 known++;
<span style="color: #A00000">-                                        } else if (!strcasecmp(type, &quot;text/event-plain&quot;)) {</span>
<span style="color: #00A000">+                                        } else if (aok &amp;&amp; !strcasecmp(type, &quot;text/event-plain&quot;)) {</span>
                                                 char *foo;
                                                 esl_event_serialize(handle-&gt;last_ievent, &amp;foo, ESL_FALSE);
                                                 printf(&quot;RECV EVENT\n%s\n&quot;, foo);
<span style="color: #800080; font-weight: bold">@@ -641,7 +655,7 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)</span>
                                         }
                                 }
                                 
<span style="color: #A00000">-                                if (!known) {</span>
<span style="color: #00A000">+                                if (aok &amp;&amp; !known) {</span>
                                         char *foo;
                                         printf(&quot;INCOMING DATA [%s]\n%s\n&quot;, type, handle-&gt;last_event-&gt;body ? handle-&gt;last_event-&gt;body : &quot;&quot;);
                                         esl_event_serialize(handle-&gt;last_event, &amp;foo, ESL_FALSE);
<span style="color: #800080; font-weight: bold">@@ -651,6 +665,11 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)</span>
                         }
                 }
 
<span style="color: #00A000">+                if (WARN_STOP) {</span>
<span style="color: #00A000">+                        if (aok) printf(&quot;Type control-D or /exit or /quit or /bye to exit.\n\n&quot;);</span>
<span style="color: #00A000">+                        WARN_STOP = 0;</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+</span>
                 usleep(1000);
         }
 
</pre></div>
========================================================================<pre>

Summary of changes:
 libs/esl/fs_cli.c |   37 ++++++++++++++++++++++++++++---------
 1 files changed, 28 insertions(+), 9 deletions(-)
</pre>
<p>this email was generated because of /git/your-repo.git/hooks/post-receive by the file /git-core/contrib/hooks/post-receive-email<br />
For more info, see <a href="http://blog.chomperstomp.com/?p=630">http://blog.chomperstomp.com/?p=630</a>
-- <br />
FreeSWITCH Source</p>