Skip to content

Commit

Permalink
Revert "Ruby 1.8.5 compatibility, closes macournoyer#49 [Wincent Cola…
Browse files Browse the repository at this point in the history
…iuta]"

This reverts commit fdf469d.
  • Loading branch information
macournoyer committed Mar 2, 2008
1 parent fdf469d commit 7d364de
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 27 deletions.
1 change: 0 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
== 0.7.1 Fancy Pants release
* Ruby 1.8.5 compatibility, closes #49 [Wincent Colaiuta]
* Move all EventMachine stuff out of Server, you can now create a Thin Backend that
does not depend on EventMachine.
* Rename Connector to Backend. Extend Thin::Backends::Base to implement your own.
Expand Down
9 changes: 0 additions & 9 deletions ext/thin_parser/thin.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,6 @@ static VALUE global_path_info;
/** Defines global strings in the init method. */
#define DEF_GLOBAL(N, val) global_##N = rb_obj_freeze(rb_str_new2(val)); rb_global_variable(&global_##N)

/* for compatibility with Ruby 1.8.5, which doesn't declare RSTRING_PTR */
#ifndef RSTRING_PTR
#define RSTRING_PTR(s) (RSTRING(s)->ptr)
#endif

/* for compatibility with Ruby 1.8.5, which doesn't declare RSTRING_LEN */
#ifndef RSTRING_LEN
#define RSTRING_LEN(s) (RSTRING(s)->len)
#endif

/* Defines the maximum allowed lengths for various input elements.*/
DEF_MAX_LENGTH(FIELD_NAME, 256);
Expand Down
18 changes: 1 addition & 17 deletions lib/thin/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ def initialize(host_or_socket_or_backend, port=DEFAULT_PORT, app=nil, &block)
else
Backends::TcpServer.new(host_or_socket_or_backend, port.to_i)
end

load_cgi_multipart_eof_fix

@app = app
@backend.server = self
Expand Down Expand Up @@ -188,20 +186,6 @@ def setup_signals
trap('QUIT') { stop } unless Thin.win?
trap('INT') { stop! }
trap('TERM') { stop! }
end

# Taken from Mongrel cgi_multipart_eof_fix
def load_cgi_multipart_eof_fix
version = RUBY_VERSION.split('.').map { |i| i.to_i }

if version[0] <= 1 && version[1] <= 8 && version[2] <= 5 && RUBY_PLATFORM !~ /java/
begin
require 'cgi_multipart_eof_fix'
rescue LoadError
log "!! Ruby 1.8.5 is not secure please install cgi_multipart_eof_fix:"
log " gem install cgi_multipart_eof_fix"
end
end
end
end
end
end

0 comments on commit 7d364de

Please sign in to comment.