Permalink
Browse files

* allow uri to be nil ('http://nil-uri-given/' is used instead for t…

…esting purpose). closes #192.
  • Loading branch information...
1 parent 01da931 commit 562402a598af99a7cfccdeb8fc51ad85b748f0d8 nahi committed Dec 16, 2008
Showing with 6 additions and 2 deletions.
  1. +2 −1 lib/httpclient/http.rb
  2. +3 −0 test/sslsvr.rb
  3. +1 −1 test/test_ssl.rb
View
@@ -159,10 +159,11 @@ def init_connect_request(uri, hostport)
@http_version = 1.0
end
+ NIL_URI = URI.parse('http://nil-uri-given/')
def init_request(method, uri, query = nil)
@is_request = true
@request_method = method
- @request_uri = uri
+ @request_uri = uri || NIL_URI
@request_query = create_query_uri(@request_uri, query)
@request_via_proxy = false
end
View
@@ -39,6 +39,9 @@ def do_hello(req, res)
:SSLClientCA => cert('ca.cert'),
:SSLCertName => nil
)
+trap(:INT) do
+ server.shutdown
+end
[:hello].each do |sym|
server.mount(
"/#{sym}",
View
@@ -182,7 +182,7 @@ def setup_client
def teardown_server
if @serverpid
- Process.kill('KILL', @serverpid) rescue nil
+ Process.kill('INT', @serverpid)
Process.waitpid(@serverpid) rescue nil
end
end

0 comments on commit 562402a

Please sign in to comment.