Skip to content

Commit 9389527

Browse files
mblebrianc
authored andcommitted
Add comments to case branches, explaining code meanings
1 parent 3eb7375 commit 9389527

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/connection.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ Connection.prototype.connect = function (port, host) {
8383
this.stream.once('data', function (buffer) {
8484
var responseCode = buffer.toString('utf8')
8585
switch (responseCode) {
86-
case 'N':
86+
case 'N': // Server does not support SSL connections
8787
return self.emit('error', new Error('The server does not support SSL connections'))
88-
case 'S':
88+
case 'S': // Server supports SSL connections, continue with a secure connection
8989
break
90-
default:
90+
default: // Any other response byte, including 'E' (ErrorResponse) indicating a server error
9191
return self.emit('error', new Error('There was an error establishing an SSL connection'))
9292
}
9393
var tls = require('tls')

0 commit comments

Comments
 (0)