Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed telnet server

  • Loading branch information...
commit f430b210b6f42e20004a8c416288a403cada24d7 1 parent f26cd0f
@chrisdew authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 telnet.js
View
8 telnet.js
@@ -53,11 +53,11 @@ var server = telnet.createServer(function (client) {
rl.setPrompt('SubSQL> ');
rl.prompt();
-
- session.on('error', function(message) { client.write(message + '\n'); rl.prompt(); });
- session.on('result', function(message) { client.write(message + '\n'); rl.prompt(); });
rl.on('line', function(line) {
- return session.exec(line);
+ return session.exec(line, function(err, res) {
+ if (err) { client.write(err + '\n'); rl.prompt(); }
+ if (res) { client.write(res + '\n'); rl.prompt(); }
+ });
}).on('close', function() {
session.close();
});
Please sign in to comment.
Something went wrong with that request. Please try again.