<!DOCTYPE html>
<html>
  <head>
  </head>
  <body>
    <dl style="line-height: 1.5; margin-left: 2em">
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Author</dt>
      <dd style="margin-left: 8.5em">Kouhei Sutou &lt;kou****@clear*****&gt;</dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Date</dt>
      <dd style="margin-left: 8.5em">2014-06-07 14:44:11 +0900 (Sat, 07 Jun 2014)</dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">New Revision</dt>
      <dd style="margin-left: 8.5em"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746">71fefeff95b7ca841eb91256728263d1d4463746</a></dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Message</dt>
      <dd style="margin-left: 8.5em"><pre style="border: 1px solid #aaa; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; padding: 0.5em; width: auto">http: use recv() instead of read()

Because com.c uses recv() not read().</pre></dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Modified files</dt>
      <dd style="margin-left: 8.5em">
        <ul>
          <li><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#diff-0">src/groonga.c</a></li>
        </ul>
      </dd>
    </dl>

    <div class="diff-section" style="clear: both">
      <table style="border-collapse: collapse; border: 1px solid #aaa">
        <thead>
          <tr class="diff-header" style="border: 1px solid #aaa">
            <td colspan="3">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">  Modified: src/groonga.c (+7 -6)</span>
<span class="diff-header-mark" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">===================================================================</span>
</pre>
            </td>
          </tr>
        </thead>
        <tbody>
          <tr>
            <th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L973">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L974">974</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L975">975</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L976">976</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L977">977</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L978">978</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L979">979</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L980">980</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L983">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L984">984</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L985">985</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L986">986</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L987">987</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L988">988</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L989">989</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L990">990</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L991">991</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L992">992</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L993">993</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L994">994</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L995">995</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L996">996</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L997">997</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L998">998</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0L999">999</a></span>
</pre>
            </th>
            <th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R973">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R974">974</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R975">975</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R976">976</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R977">977</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R978">978</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R979">979</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R982">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R983">983</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R984">984</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R985">985</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R986">986</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R987">987</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R988">988</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R989">989</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R990">990</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R991">991</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R992">992</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R993">993</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R994">994</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R995">995</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R996">996</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre">&nbsp;</span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R997">997</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R998">998</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R999">999</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/groonga/groonga/commit/71fefeff95b7ca841eb91256728263d1d4463746#L0R1000">1000</a></span>
</pre>
            </th>
            <td class="diff-content" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, &quot;Liberation Mono&quot;, Courier, monospace; line-height: 1.2; margin: 0; padding: 0.5em; white-space: normal; width: auto"><span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -974,7 +974,6 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">do_htreq_post(grn_ctx *ctx, grn_msg *msg)</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre">     GRN_TEXT_INIT(&amp;line_buffer, 0);</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     while (read_content_length &lt; header.content_length) {</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> #define POST_BUFFER_SIZE 8192</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-      ssize_t read_length;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">       grn_rc rc;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">       char buffer[POST_BUFFER_SIZE];</span>
<span class="diff-not-changed" style="display: block; white-space: pre">       const char *buffer_start, *buffer_current, *buffer_end;</span>
<span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -984,16 +983,18 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">do_htreq_post(grn_ctx *ctx, grn_msg *msg)</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre">         buffer_end = end;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">         header.body_start = NULL;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">       } else {</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-        read_length = read(fd, buffer, POST_BUFFER_SIZE);</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-        if (read_length == 0) {</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+        ssize_t recv_length;</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+        int recv_flags = 0;</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+        recv_length = recv(fd, buffer, POST_BUFFER_SIZE, recv_flags);</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+        if (recv_length == 0) {</span>
<span class="diff-not-changed" style="display: block; white-space: pre">           break;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">         }</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-        if (read_length == -1) {</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-          SERR(&quot;read&quot;);</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+        if (recv_length == -1) {</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+          SERR(&quot;recv&quot;);</span>
<span class="diff-not-changed" style="display: block; white-space: pre">           break;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">         }</span>
<span class="diff-not-changed" style="display: block; white-space: pre">         buffer_start = buffer;</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-        buffer_end = buffer_start + read_length;</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+        buffer_end = buffer_start + recv_length;</span>
<span class="diff-not-changed" style="display: block; white-space: pre">       }</span>
<span class="diff-not-changed" style="display: block; white-space: pre">       read_content_length += buffer_end - buffer_start;</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
</pre>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>