mongrel 1.1 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of mongrel might be problematic. Click here for more details.

data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG CHANGED
@@ -1,6 +1,10 @@
1
1
 
2
+ v1.1.1. Fix mongrel_rails restart bug; fix bug with Rack status codes.
3
+
2
4
  v1.1. Pure Ruby URIClassifier. More modular architecture. JRuby support. Move C URIClassifier into mongrel_experimental project.
3
5
 
6
+ v1.0.4. Backport fixes for versioning inconsistency, mongrel_rails bug, and DirHandler bug.
7
+
4
8
  v1.0.3. Fix user-switching bug; make people upgrade to the latest from the RC.
5
9
 
6
10
  v1.0.2. Signed gem; many minor bugfixes and patches.
@@ -11,6 +11,8 @@ $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"
11
11
  require 'mongrel'
12
12
  require 'mongrel/rails'
13
13
 
14
+ Mongrel::Gems.require 'gem_plugin'
15
+
14
16
  # require 'ruby-debug'
15
17
  # Debugger.start
16
18
 
@@ -384,7 +384,7 @@ void Init_http11()
384
384
  DEF_GLOBAL(server_protocol, "SERVER_PROTOCOL");
385
385
  DEF_GLOBAL(server_protocol_value, "HTTP/1.1");
386
386
  DEF_GLOBAL(http_host, "HTTP_HOST");
387
- DEF_GLOBAL(mongrel_version, "Mongrel 1.1");
387
+ DEF_GLOBAL(mongrel_version, "Mongrel 1.1.1"); /* XXX Why is this defined here? */
388
388
  DEF_GLOBAL(server_software, "SERVER_SOFTWARE");
389
389
  DEF_GLOBAL(port_80, "80");
390
390
 
@@ -65,7 +65,7 @@ module Mongrel
65
65
  REQUEST_URI='REQUEST_URI'.freeze
66
66
  REQUEST_PATH='REQUEST_PATH'.freeze
67
67
 
68
- MONGREL_VERSION="1.1".freeze
68
+ MONGREL_VERSION="1.1.1".freeze
69
69
 
70
70
  MONGREL_TMP_BASE="mongrel".freeze
71
71
 
@@ -122,17 +122,20 @@ module RequestLog
122
122
  begin
123
123
  stats = Hash.new(0)
124
124
  lengths = {}
125
- ObjectSpace.each_object do |o|
126
- begin
127
- if o.respond_to? :length
128
- len = o.length
129
- lengths[o.class] ||= Mongrel::Stats.new(o.class)
130
- lengths[o.class].sample(len)
125
+ begin
126
+ ObjectSpace.each_object do |o|
127
+ begin
128
+ if o.respond_to? :length
129
+ len = o.length
130
+ lengths[o.class] ||= Mongrel::Stats.new(o.class)
131
+ lengths[o.class].sample(len)
132
+ end
133
+ rescue Object
131
134
  end
132
- rescue Object
135
+
136
+ stats[o.class] += 1
133
137
  end
134
-
135
- stats[o.class] += 1
138
+ rescue Object # Ignore since ObjectSpace might not be loaded on JRuby
136
139
  end
137
140
 
138
141
  stats.sort {|(k1,v1),(k2,v2)| v2 <=> v1}.each do |k,v|
@@ -171,21 +174,23 @@ module RequestLog
171
174
 
172
175
  def process(request, response)
173
176
  MongrelDbg::trace(:threads, "#{Time.now} REQUEST #{request.params['PATH_INFO']}")
174
- ObjectSpace.each_object do |obj|
175
- begin
176
- if obj.class == Mongrel::HttpServer
177
- worker_list = obj.workers.list
178
-
179
- if worker_list.length > 0
180
- keys = "-----\n\tKEYS:"
181
- worker_list.each {|t| keys << "\n\t\t-- #{t}: #{t.keys.inspect}" }
177
+ begin
178
+ ObjectSpace.each_object do |obj|
179
+ begin
180
+ if obj.class == Mongrel::HttpServer
181
+ worker_list = obj.workers.list
182
+
183
+ if worker_list.length > 0
184
+ keys = "-----\n\tKEYS:"
185
+ worker_list.each {|t| keys << "\n\t\t-- #{t}: #{t.keys.inspect}" }
186
+ end
187
+
188
+ MongrelDbg::trace(:threads, "#{obj.host}:#{obj.port} -- THREADS: #{worker_list.length} #{keys}")
182
189
  end
183
-
184
- MongrelDbg::trace(:threads, "#{obj.host}:#{obj.port} -- THREADS: #{worker_list.length} #{keys}")
190
+ rescue Object # Ignore since obj.class can sometimes take parameters
185
191
  end
186
- rescue Object
187
- # ignore since obj.class can sometimes take parameters
188
192
  end
193
+ rescue Object # Ignore since ObjectSpace might not be loaded on JRuby
189
194
  end
190
195
  end
191
196
  end
@@ -2,19 +2,18 @@ module Mongrel
2
2
  module Gems
3
3
  class << self
4
4
 
5
- alias :original_require :require
6
-
7
5
  def require(library, version = nil)
8
6
  begin
9
- original_require library
7
+ Kernel.require library
10
8
  rescue LoadError, RuntimeError => e
11
- unless respond_to? 'gem'
9
+ begin
12
10
  # ActiveSupport breaks 'require' by making it always return a true value
13
11
  require 'rubygems'
14
- gem library, version if version
15
- retry
12
+ version ? gem(library, version) : gem(library)
13
+ retry
14
+ rescue Gem::LoadError, LoadError, RuntimeError
15
+ # puts "** #{library.inspect} could not be loaded" unless library == "mongrel_experimental"
16
16
  end
17
- # Fail without reraising
18
17
  end
19
18
  end
20
19
 
@@ -43,7 +43,7 @@ module Mongrel
43
43
  @socket = socket
44
44
  @body = StringIO.new
45
45
  @status = 404
46
- @reason = HTTP_STATUS_CODES[@status]
46
+ @reason = nil
47
47
  @header = HeaderOut.new(StringIO.new)
48
48
  @header[Const::DATE] = Time.now.httpdate
49
49
  @body_sent = false
@@ -59,7 +59,7 @@ module Mongrel
59
59
  # by simple passing "finalize=true" to the start method. By default
60
60
  # all handlers run and then mongrel finalizes the request when they're
61
61
  # all done.
62
- def start(status=200, finalize=false, reason=HTTP_STATUS_CODES[status])
62
+ def start(status=200, finalize=false, reason=nil)
63
63
  @status = status.to_i
64
64
  @reason = reason
65
65
  yield @header, @body
@@ -84,7 +84,7 @@ module Mongrel
84
84
  def send_status(content_length=@body.length)
85
85
  if not @status_sent
86
86
  @header['Content-Length'] = content_length if content_length and @status != 304
87
- write(Const::STATUS_FORMAT % [@status, @reason])
87
+ write(Const::STATUS_FORMAT % [@status, @reason || HTTP_STATUS_CODES[@status]])
88
88
  @status_sent = true
89
89
  end
90
90
  end
@@ -1,16 +1,16 @@
1
1
 
2
- # Gem::Specification for Mongrel-1.1
2
+ # Gem::Specification for Mongrel-1.1.1
3
3
  # Originally generated by Echoe
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = %q{mongrel}
7
- s.version = "1.1"
7
+ s.version = "1.1.1"
8
8
 
9
9
  s.specification_version = 2 if s.respond_to? :specification_version=
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.authors = ["Zed A. Shaw"]
13
- s.date = %q{2007-11-01}
13
+ s.date = %q{2007-11-12}
14
14
  s.default_executable = %q{mongrel_rails}
15
15
  s.description = %q{A small fast HTTP library and server that runs Rails, Camping, Nitro and Iowa apps.}
16
16
  s.email = %q{}
@@ -43,20 +43,21 @@ end
43
43
  # p.summary = "A small fast HTTP library and server that runs Rails, Camping, Nitro and Iowa apps."
44
44
  # p.author ="Zed A. Shaw"
45
45
  # p.clean_pattern = ['ext/http11/*.{bundle,so,o,obj,pdb,lib,def,exp}', 'lib/*.{bundle,so,o,obj,pdb,lib,def,exp}', 'ext/http11/Makefile', 'pkg', 'lib/*.bundle', '*.gem', 'site/output', '.config', 'lib/http11.jar', 'ext/http11_java/classes', 'coverage']
46
- # p.rdoc_pattern = ['README', 'LICENSE', 'COPYING', 'lib/**/*.rb', 'doc/**/*.rdoc']
46
+ # p.rdoc_pattern = ['README', 'LICENSE', 'CHANGELOG', 'COPYING', 'lib/**/*.rb', 'doc/**/*.rdoc']
47
47
  # p.ignore_pattern = /^(pkg|site|projects|doc|log)|CVS|\.log/
48
48
  # p.ruby_version = '>= 1.8.4'
49
49
  # p.dependencies = ['gem_plugin >=0.2.3', 'cgi_multipart_eof_fix >=2.4']
50
+ # (p.rdoc_template = `allison --path`.chomp) rescue nil
50
51
  #
51
52
  # p.need_tar_gz = false
52
53
  # p.need_tgz = true
53
54
  #
54
- # # case RUBY_PLATFORM
55
- # # when /mswin/
56
- # # else
57
- # # end
55
+ # # case RUBY_PLATFORM
56
+ # # when /mswin/
57
+ # # else
58
+ # # end
58
59
  #
59
- # p.eval = proc do
60
+ # p.eval = proc do
60
61
  # case RUBY_PLATFORM
61
62
  # when /mswin/
62
63
  # extensions.clear
@@ -71,7 +72,7 @@ end
71
72
  # add_dependency('fastthread', '>= 1.0.1')
72
73
  # end
73
74
  # end
74
- #
75
+ #
75
76
  # end
76
77
  #
77
78
  # #### Ragel builder
@@ -107,10 +108,10 @@ end
107
108
  # Dir["ext/**/*.#{Config::CONFIG['DLEXT']}"].each { |file| mv file, "lib/" }
108
109
  # end
109
110
  #
110
- # def java_classpath_arg
111
+ # def java_classpath_arg
111
112
  # # A myriad of ways to discover the JRuby classpath
112
113
  # classpath = begin
113
- # require 'java'
114
+ # require 'java'
114
115
  # # Already running in a JRuby JVM
115
116
  # Java::java.lang.System.getProperty('java.class.path')
116
117
  # rescue LoadError
@@ -123,12 +124,12 @@ end
123
124
  # when /mswin/
124
125
  # filename = "lib/http11.so"
125
126
  # file filename do
126
- # Dir.chdir("ext/http11") do
127
+ # Dir.chdir("ext/http11") do
127
128
  # ruby "extconf.rb"
128
129
  # system(PLATFORM =~ /mswin/ ? 'nmake' : 'make')
129
130
  # end
130
131
  # move_extensions
131
- # end
132
+ # end
132
133
  # task :compile => [filename]
133
134
  #
134
135
  # when /java/
@@ -139,8 +140,8 @@ end
139
140
  # sources = FileList['ext/http11_java/**/*.java'].join(' ')
140
141
  # sh "javac -target 1.4 -source 1.4 -d #{build_dir} #{java_classpath_arg} #{sources}"
141
142
  # sh "jar cf lib/http11.jar -C #{build_dir} ."
142
- # move_extensions
143
- # end
143
+ # move_extensions
144
+ # end
144
145
  # task :compile => [filename]
145
146
  #
146
147
  # end
@@ -151,7 +152,7 @@ end
151
152
  # targets.each do |target|
152
153
  # Dir.chdir "projects/#{project}" do
153
154
  # unless RUBY_PLATFORM =~ /mswin/
154
- # sh %{rake --trace #{target.to_s} }
155
+ # sh("rake #{target.to_s}") # --trace
155
156
  # end
156
157
  # end
157
158
  # end
@@ -185,8 +186,8 @@ end
185
186
  # sub_project("mongrel_status", :install)
186
187
  # sub_project("mongrel_upload_progress", :install)
187
188
  # sub_project("mongrel_console", :install)
188
- # sub_project("mongrel_cluster", :install)
189
- # sub_project("mongrel_experimental", :install)
189
+ # sub_project("mongrel_cluster", :install)
190
+ # # sub_project("mongrel_experimental", :install)
190
191
  # sub_project("mongrel_service", :install) if RUBY_PLATFORM =~ /mswin/
191
192
  # end
192
193
  #
@@ -197,8 +198,8 @@ end
197
198
  # sub_project("mongrel_upload_progress", :uninstall)
198
199
  # sub_project("mongrel_console", :uninstall)
199
200
  # sub_project("gem_plugin", :uninstall)
200
- # sub_project("fastthread", :uninstall)
201
- # sub_project("mongrel_experimental", :uninstall)
201
+ # sub_project("fastthread", :uninstall)
202
+ # # sub_project("mongrel_experimental", :uninstall)
202
203
  # sub_project("mongrel_service", :uninstall) if RUBY_PLATFORM =~ /mswin/
203
204
  # end
204
205
  #
@@ -210,8 +211,8 @@ end
210
211
  # sub_project("mongrel_status", :clean)
211
212
  # sub_project("mongrel_upload_progress", :clean)
212
213
  # sub_project("mongrel_console", :clean)
213
- # sub_project("mongrel_cluster", :clean)
214
- # sub_project("mongrel_experimental", :clean)
214
+ # sub_project("mongrel_cluster", :clean)
215
+ # sub_project("mongrel_experimental", :clean)
215
216
  # sub_project("mongrel_service", :clean) if RUBY_PLATFORM =~ /mswin/
216
217
  # end
217
218
  #
@@ -225,39 +226,39 @@ end
225
226
  # rm_rf "pkg/tars"
226
227
  # mkdir_p "pkg/gems"
227
228
  # mkdir_p "pkg/tars"
228
- #
229
+ #
229
230
  # FileList["**/*.gem"].each { |gem| mv gem, "pkg/gems" }
230
231
  # FileList["**/*.tgz"].each {|tgz| mv tgz, "pkg/tars" }
231
- #
232
+ #
232
233
  # # XXX Hack, because only Luis can package for Win32 right now
233
234
  # sh "cp ~/Downloads/mongrel-#{e.version}-mswin32.gem pkg/gems/"
234
- # sh "cp ~/Downloads/mongrel_service-0.3.3-mswin32.gem pkg/gems/"
235
+ # sh "cp ~/Downloads/mongrel_service-0.3.3-mswin32.gem pkg/gems/"
235
236
  # sh "rm -rf pkg/mongrel*"
236
- # sh "gem generate_index -d pkg"
237
- # sh "scp -r CHANGELOG pkg/* rubyforge.org:/var/www/gforge-projects/mongrel/releases/"
237
+ # sh "gem generate_index -d pkg"
238
+ # sh "scp -r CHANGELOG pkg/* rubyforge.org:/var/www/gforge-projects/mongrel/releases/"
238
239
  # sh "svn log -v > SVN_LOG"
239
- # sh "scp -r SVN_LOG pkg/* rubyforge.org:/var/www/gforge-projects/mongrel/releases/"
240
- # rm "SVN_LOG"
240
+ # sh "scp -r SVN_LOG pkg/* rubyforge.org:/var/www/gforge-projects/mongrel/releases/"
241
+ # rm "SVN_LOG"
241
242
  # end
242
- #
243
+ #
243
244
  # desc "Upload the website"
244
245
  # task :web do
245
- # # Requires the 'webgem' gem and the 'atom-tools' gem
246
- # sh "cd site; webgen; webgen; ruby atom.rb > output/feed.atom; rsync -azv --no-perms --no-times output/* rubyforge.org:/var/www/gforge-projects/mongrel/"
246
+ # # Requires the 'webgem' gem
247
+ # sh "cd site; webgen; webgen; curl 'http://feed43.com/mongrel.xml' > output/rss.xml; rsync -azv --no-perms --no-times output/* rubyforge.org:/var/www/gforge-projects/mongrel/"
247
248
  # end
248
- #
249
+ #
249
250
  # desc "Upload the rdocs"
250
251
  # task :rdoc => [:doc] do
251
252
  # sh "rsync -azv --no-perms --no-times doc/* rubyforge.org:/var/www/gforge-projects/mongrel/rdoc/"
252
253
  # sh "cd projects/gem_plugin; rake site:rdoc"
253
254
  # end
254
- #
255
+ #
255
256
  # desc "Upload the coverage report"
256
257
  # task :coverage => [:rcov] do
257
258
  # sh "rsync -azv --no-perms --no-times test/coverage/* rubyforge.org:/var/www/gforge-projects/mongrel/coverage/" rescue nil
258
259
  # end
259
- #
260
+ #
260
261
  # desc "Upload the website, the rdocs, and the coverage report"
261
262
  # task :all => [:clean, :web, :rdoc, :coverage]
262
- #
263
+ #
263
264
  # end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4.6
3
3
  specification_version: 2
4
4
  name: mongrel
5
5
  version: !ruby/object:Gem::Version
6
- version: "1.1"
7
- date: 2007-11-01 00:00:00 -04:00
6
+ version: 1.1.1
7
+ date: 2007-11-12 00:00:00 -05:00
8
8
  summary: A small fast HTTP library and server that runs Rails, Camping, Nitro and Iowa apps.
9
9
  require_paths:
10
10
  - lib
metadata.gz.sig CHANGED
Binary file