-
-
Save rphillips/bc3c536d72f147f41c27 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/luvit/tls.lua b/lib/luvit/tls.lua | |
index fd2c2d5..8ae112d 100644 | |
--- a/lib/luvit/tls.lua | |
+++ b/lib/luvit/tls.lua | |
@@ -32,7 +32,7 @@ local string = require('string') | |
local fmt = string.format | |
local END_OF_FILE = 42 | |
-local DEBUG = false | |
+local DEBUG = true | |
local function dbg(format, ...) | |
if DEBUG == true then | |
@@ -133,8 +133,9 @@ end | |
function CryptoStream:write(data, ...) | |
dbg('CryptoStream:write') | |
+ local len = data.length or #data | |
- if #data == 0 then | |
+ if len == 0 then | |
return | |
end | |
@@ -154,7 +155,7 @@ function CryptoStream:write(data, ...) | |
callback = args[1] | |
end | |
- table.insert(self._pending, data) | |
+ table.insert(self._pending, tostring(data)) | |
table.insert(self._pendingCallbacks, callback) | |
self._pendingBytes = self._pendingBytes + #data | |
self.pair._writeCalled = true | |
@@ -835,7 +836,7 @@ function connect(...) | |
end | |
local socket = options.socket or Socket:new() | |
- | |
+ | |
if options.context then | |
sslcontext = createCredentials(options, options.context) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment