lib/knj/http2.rb in knjrbfw-0.0.41 vs lib/knj/http2.rb in knjrbfw-0.0.42
- old
+ new
@@ -124,17 +124,16 @@
end
@sock.write(@nl)
res = @sock.gets
- if res.to_s.downcase != "http/1.0 200 connection established#{@nl}"
- raise res
- end
+ raise res if res.to_s.downcase != "http/1.0 200 connection established#{@nl}"
res_empty = @sock.gets
raise "Empty res wasnt empty." if res_empty != @nl
else
- @sock_plain = TCPSocket.new(@args[:host], @args[:port])
+ print "Http2: Opening socket connection to '#{@args[:host]}:#{@args[:port]}'.\n" if @debug
+ @sock_plain = TCPSocket.new(@args[:host], @args[:port].to_i)
end
if @args[:ssl]
print "Http2: Initializing SSL.\n" if @debug
require "openssl"
\ No newline at end of file