<!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 <shimo****@clear*****></dd>
<dt style="clear: both; float: left; font-weight: bold; width: 8em">Date</dt>
<dd style="margin-left: 8.5em">2015-04-17 23:14:16 +0900 (Fri, 17 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/d10a86ea311296608187aaa39ecfc2c5d311026f">d10a86ea311296608187aaa39ecfc2c5d311026f</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, "Liberation Mono", Courier, monospace; line-height: 1.2; padding: 0.5em; width: auto">Suppress errors when callback functions is called twice or more</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/d10a86ea311296608187aaa39ecfc2c5d311026f#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, "Liberation Mono", 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 (+19 -2)</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, "Liberation Mono", 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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0L244">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0L245">245</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0L247">247</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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0L248">248</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0L249">249</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0L251">251</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0L252">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0L253">253</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0L254">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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0L255">255</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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0L256">256</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0L257">257</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0L258">258</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0L259">259</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0L290">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0L291">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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0L292">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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0L293">293</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0L294">294</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0L295">295</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0L296">296</a></span>
</pre>
</th>
<th class="diff-line-number" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", 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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R244">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R245">245</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R246">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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R247">247</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R248">248</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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R249">249</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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R250">250</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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R251">251</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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R252">252</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/d10a86ea311296608187aaa39ecfc2c5d311026f#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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R254">254</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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R255">255</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/d10a86ea311296608187aaa39ecfc2c5d311026f#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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R257">257</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R258">258</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R259">259</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R260">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R261">261</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R262">262</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R263">263</a></span>
<span class="diff-line-number-nothing" style="display: block; white-space: pre"> </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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R264">264</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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R265">265</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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R266">266</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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R267">267</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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R268">268</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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R269">269</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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R270">270</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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R271">271</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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R272">272</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R273">273</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R274">274</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R275">275</a></span>
<span class="diff-line-number-hunk-header" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R306">...</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R307">307</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R308">308</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R309">309</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/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R310">310</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R311">311</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R312">312</a></span>
<span class="diff-line-number-not-changed" style="display: block; white-space: pre"><a href="https://github.com/droonga/express-droonga/commit/d10a86ea311296608187aaa39ecfc2c5d311026f#L0R313">313</a></span>
</pre>
</th>
<td class="diff-content" style="border: 1px solid #aaa">
<pre style="border: 0; font-family: Consolas, Menlo, "Liberation Mono", 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">@@ -245,7 +245,15 @@ <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"> clearTimeout(timeoutId);</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> if (sendingMessages)</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> sendingMessages.callback = null;</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">- callback(errorCode, response);</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ if (!callback)</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ return;</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ try {</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ callback(errorCode, response);</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ callback = null;</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ }</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ catch(error) {</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ this._logger.error(error);</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"> }).bind(this));</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> options.timeout = toPositiveInteger(options.timeout) ||</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> DEFAULT_RESPONSE_TIMEOUT;</span>
<span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -253,7 +261,15 @@ <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"> this.removeAllListeners(event);</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> if (sendingMessages)</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> sendingMessages.callback = null;</span>
<span class="diff-deleted" style="background-color: #ffaaaa; color: #000000; display: block; white-space: pre">- callback(ERROR_GATEWAY_TIMEOUT, null);</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ if (!callback)</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ return;</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ try {</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ callback(ERROR_GATEWAY_TIMEOUT, null);</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ callback = null;</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ }</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ catch(error) {</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ this._logger.error(error);</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"> }).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] = sendingMessages;</span>
<span class="diff-hunk-header" style="background-color: #eaf2f5; color: #999999; display: block; white-space: pre">@@ -291,6 +307,7 @@ <span class="diff-context" style="background-color: #ffffaa; color: #000000">Connection.prototype.close = function() {</span></span>
<span class="diff-not-changed" style="display: block; white-space: pre"> if (typeof callback == '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"> callback(ERROR_SERVICE_UNAVAILABLE, null);</span>
<span class="diff-added" style="background-color: #aaffaa; color: #000000; display: block; white-space: pre">+ message.callback = callback = null;</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> }</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> catch(error) {</span>
<span class="diff-not-changed" style="display: block; white-space: pre"> this._logger.error(error)</span>
</pre>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>