<!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">YUKI Hiroshi &lt;shimo****@clear*****&gt;</dd>
      <dt style="clear: both; float: left; font-weight: bold; width: 8em">Date</dt>
      <dd style="margin-left: 8.5em">2015-04-08 20:07:07 +0900 (Wed, 08 Apr 2015)</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/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794">80f13b560a27a5c6860b81fb2944a6a54611f794</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">Return 503 error when connection to an engine node is closed</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/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#diff-0">lib/droonga-protocol/connection.js</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: lib/droonga-protocol/connection.js (+14 -1)</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/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0L28">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0L29">29</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0L30">30</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0L31">31</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/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0L32">32</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0L33">33</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0L34">34</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0L245">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0L246">246</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0L247">247</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0L248">248</a></span>
<span class="diff-line-number-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0L249">249</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/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0L250">250</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0L251">251</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0L252">252</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0L275">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0L276">276</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0L277">277</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0L278">278</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-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/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0L279">279</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0L280">280</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0L281">281</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/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R28">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R29">29</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R30">30</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R31">31</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R32">32</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R33">33</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R34">34</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R35">35</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R36">36</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R37">37</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R38">38</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R249">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R250">250</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R251">251</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R252">252</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/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R253">253</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R254">254</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R255">255</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R256">256</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R257">257</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R280">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R281">281</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R282">282</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R283">283</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R284">284</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R285">285</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R286">286</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R287">287</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R288">288</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R289">289</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R290">290</a></span>
<span class="diff-line-number-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R291">291</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R292">292</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R293">293</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/80f13b560a27a5c6860b81fb2944a6a54611f794#L0R294">294</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">@@ -29,6 +29,10 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">var DEFAULT_RECEIVE_HOST_NAME =</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre">       Connection.DEFAULT_RECEIVE_HOST_NAME =</span>
<span class="diff-not-changed" style="display: block; white-space: pre">         '127.0.0.1';</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+var ERROR_SERVICE_UNAVAILABLE =</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+      Connection.ERROR_SERVICE_UNAVAILABLE =</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+        503;</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> var ERROR_GATEWAY_TIMEOUT =</span>
<span class="diff-not-changed" style="display: block; white-space: pre">       Connection.ERROR_GATEWAY_TIMEOUT =</span>
<span class="diff-not-changed" style="display: block; white-space: pre">         504;</span>
<span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -246,7 +250,8 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">Connection.prototype.emitMessage = function(type, body, callback, options) {</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre">     }).bind(this), options.timeout);</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   }</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   this._sendingMessages[id] = {</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">-    type: type</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+    type: type,</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+    callback: callback</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   };</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   this._sender.emit('message', envelope, options.emittedCallback);</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   return envelope;</span>
<span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -276,6 +281,14 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">Connection.prototype._sendPendingMessages = function() {</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre"> Connection.prototype.close = function() {</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   this.removeAllListeners();</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> </span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+  Object.keys(this._sendingMessages).forEach(function(id) {</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+    var message = this._sendingMessages[id];</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+    var callback = message.callback;</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+    if (typeof callback == 'function')</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+      callback(ERROR_SERVICE_UNAVAILABLE, null);</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+  }, this);</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+  this._sendingMessages = {};</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+</span>
<span class="diff-not-changed" style="display: block; white-space: pre">   if (this._sender &amp;&amp; typeof this._sender.end == 'function') {</span>
<span class="diff-not-changed" style="display: block; white-space: pre">     try {</span>
<span class="diff-not-changed" style="display: block; white-space: pre">       this._sender.end();</span>
</pre>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>