You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def handle_client(io)
io.sync = false
if tls = @tls
io = OpenSSL::SSL::Socket::Server.new(io, tls, sync_close: true)
end
@processor.process(io, io)
end
However this doesn't:
def handle_client(io)
io.sync = false
if tls = @tls
begin
io = OpenSSL::SSL::Socket::Server.new(io, tls, sync_close: true)
rescue ex
end
end
@processor.process(io, io)
end
crystal/src/http/server.cr:163: undefined method 'sync=' for Nil (compile-time type is (TCPSocket | Nil))
io.sync = false
So I guess the parser is assigning the type "global to the method" in the latter case, which surprised me at the time, and may not be expected.
Thanks!
The text was updated successfully, but these errors were encountered:
The following works (extracted from server.cr):
However this doesn't:
So I guess the parser is assigning the type "global to the method" in the latter case, which surprised me at the time, and may not be expected.
Thanks!
The text was updated successfully, but these errors were encountered: