From 938952760974b6b07900e2b28dafa64382f2e3b1 Mon Sep 17 00:00:00 2001 From: Matthew Blewitt Date: Thu, 22 Feb 2018 15:49:44 +0000 Subject: [PATCH] Add comments to case branches, explaining code meanings --- lib/connection.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/connection.js b/lib/connection.js index 208f0574..7acf16e2 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -83,11 +83,11 @@ Connection.prototype.connect = function (port, host) { this.stream.once('data', function (buffer) { var responseCode = buffer.toString('utf8') switch (responseCode) { - case 'N': + case 'N': // Server does not support SSL connections return self.emit('error', new Error('The server does not support SSL connections')) - case 'S': + case 'S': // Server supports SSL connections, continue with a secure connection break - default: + default: // Any other response byte, including 'E' (ErrorResponse) indicating a server error return self.emit('error', new Error('There was an error establishing an SSL connection')) } var tls = require('tls')