Skip to content

Commit

Permalink
prepare release
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwittig committed Aug 10, 2021
1 parent fe9dc20 commit 680a42d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ function connect(params, cb) {
var con = new Connection(socket, params.nanos2date, params.flipTables, params.emptyChar2null, params.long2number);
con.once("error", function(err) {
socket.removeListener("close", closecb);
cb(err)
})
cb(err);
});
con.auth(auth, function() {
socket.removeListener("close", closecb);
if (close === false) {
Expand All @@ -246,9 +246,9 @@ function connect(params, cb) {
});

if (params.useTLS) {
socket = tls.connect.apply(null, socketArgs)
socket = tls.connect.apply(null, socketArgs);
} else {
socket = net.connect.apply(null, socketArgs)
socket = net.connect.apply(null, socketArgs);
}

if (params.socketTimeout !== undefined) {
Expand Down
22 changes: 12 additions & 10 deletions itest/tls.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
var nodeq = require("../index.js"),
assert = require("assert")
assert = require("assert");

describe("tls", function() {
"use strict"
"use strict";
it("should fail if endpoint expects tls and we don't set useTLS to true", function(done) {
nodeq.connect({host: "localhost", port: 6000}, function(err) {
assert.ok(err)
done()
assert.ok(err);
done();
});
});

it("should connect successfully if useTLS is true", function(done) {
nodeq.connect({host: "localhost", port: 6000, useTLS: true}, function(err) {
if (err) { throw err }
done()
if (err) {
throw err;
}
done();
});
})
});

it("should fail if useTLS is true and endpoint doesn't expect it", function(done) {
nodeq.connect({host: "localhost", port: 5000, useTLS: true}, function(err) {
assert.ok(err)
done()
assert.ok(err);
done();
});
})
});
});
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-q",
"version": "2.5.0",
"version": "2.6.0",
"description": "Q interfacing with Node.js",
"keywords": [
"q",
Expand Down

0 comments on commit 680a42d

Please sign in to comment.