Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeZ99 committed Nov 29, 2011
1 parent 0878376 commit 428fd05
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions limestone.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ exports.SphinxClient = function() {
errmsg = 'Server issued RETRY: '+server_message;
}
if(errmsg){
callback(errmsg);
callback(new Error(errmsg));
}
}

Expand Down Expand Up @@ -360,8 +360,8 @@ exports.SphinxClient = function() {
req_length.toBuffer().copy(request_buf, 4, 0);

console.log('Sending search request of ' + request_buf.length + ' bytes ');

_enqueue(request_buf, callback, Sphinx.clientCommand.SEARCH);
_enqueue(request_buf, callback, Sphinx.clientCommand.SEARCH);

};

self.build_excerpts = function(docs, index, words, passage_opts_raw, callback){
Expand Down Expand Up @@ -457,8 +457,7 @@ exports.SphinxClient = function() {

function _enqueue(req_buf , cb, sc) {
if(!server_conn || !server_conn.writable){

throw new Error('Trying to enqueue. Not connected');
cb(new Error("Trying to enqueue. Not connected"));
}
_queue.push({request_buffer: req_buf, callback: cb, search_command: sc});
if(_queue.length === 1)
Expand Down

0 comments on commit 428fd05

Please sign in to comment.