Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "not initialized" warnings #107

Merged
merged 6 commits into from
Aug 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
puffing-billy (0.5.0)
puffing-billy (0.5.1)
addressable
em-http-request (~> 1.1.0)
em-synchrony
Expand Down
4 changes: 2 additions & 2 deletions lib/billy/proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def initialize
def start(threaded = true)
if threaded
Thread.new { main_loop }
sleep(0.01) while @signature.nil?
sleep(0.01) while (not defined?(@signature)) || @signature.nil?
else
main_loop
end
Expand Down Expand Up @@ -49,7 +49,7 @@ def main_loop

@signature = EM.start_server('127.0.0.1', Billy.config.proxy_port, ProxyConnection) do |p|
p.handler = request_handler
p.cache = @cache
p.cache = @cache if defined?(@cache)
end

Billy.log(:info, "puffing-billy: Proxy listening on #{url}")
Expand Down
2 changes: 1 addition & 1 deletion lib/billy/proxy_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def on_message_complete
if @parser.http_method == 'CONNECT'
restart_with_ssl(@parser.request_url)
else
if @ssl
if defined?(@ssl) && @ssl
uri = Addressable::URI.parse(@parser.request_url)
@url = "https://#{@ssl}#{[uri.path, uri.query].compact.join('?')}"
else
Expand Down