Skip to content

Commit

Permalink
make sure the CTParser objc class is pre-loaded before even using it
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.macosforge.org/repository/ruby/ControlTower/trunk@4297 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information
lrz committed Jun 27, 2010
1 parent 9f56637 commit bdc3a44
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/control_tower/rack_socket.rb
Expand Up @@ -5,6 +5,8 @@
require 'CTParser'
require 'stringio'

CTParser # Making sure the Objective-C class is pre-loaded

module ControlTower
class RackSocket
VERSION = [1,0].freeze
Expand Down Expand Up @@ -112,10 +114,10 @@ def close
private

def parse!(connection, env)
parser = Thread.current[:http_parser] ||= ::CTParser.new
parser = Thread.current[:http_parser] ||= CTParser.new
parser.reset
data = NSMutableData.alloc.init
data.increaseLengthBy(1)
data.increaseLengthBy(1) # add sentinel
parsing_headers = true # Parse headers first
nread = 0
content_length = 0
Expand Down

0 comments on commit bdc3a44

Please sign in to comment.