thin 0.7.0-x86-mswin32-60 → 0.7.1-x86-mswin32-60

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

Potentially problematic release.


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

Files changed (47) hide show
  1. data/CHANGELOG +11 -1
  2. data/COMMITTERS +3 -0
  3. data/README +4 -0
  4. data/Rakefile +2 -0
  5. data/ext/thin_parser/thin.c +9 -0
  6. data/lib/thin.rb +5 -5
  7. data/lib/thin/backends/base.rb +114 -0
  8. data/lib/thin/{connectors → backends}/swiftiply_client.rb +6 -6
  9. data/lib/thin/{connectors → backends}/tcp_server.rb +2 -2
  10. data/lib/thin/{connectors → backends}/unix_server.rb +19 -8
  11. data/lib/thin/connection.rb +3 -3
  12. data/lib/thin/controllers/controller.rb +6 -5
  13. data/lib/thin/controllers/service.rb +3 -1
  14. data/lib/thin/daemonizing.rb +20 -7
  15. data/lib/thin/logging.rb +1 -1
  16. data/lib/thin/request.rb +5 -5
  17. data/lib/thin/server.rb +63 -78
  18. data/lib/thin/version.rb +4 -2
  19. data/lib/thin_parser.so +0 -0
  20. data/spec/{connectors → backends}/swiftiply_client_spec.rb +10 -10
  21. data/spec/{connectors → backends}/tcp_server_spec.rb +5 -5
  22. data/spec/backends/unix_server_spec.rb +37 -0
  23. data/spec/command_spec.rb +1 -0
  24. data/spec/connection_spec.rb +1 -1
  25. data/spec/controllers/controller_spec.rb +1 -0
  26. data/spec/daemonizing_spec.rb +31 -23
  27. data/spec/{request/perf_spec.rb → perf/request_perf_spec.rb} +0 -0
  28. data/spec/perf/response_perf_spec.rb +19 -0
  29. data/spec/perf/server_perf_spec.rb +39 -0
  30. data/spec/request/mongrel_spec.rb +1 -1
  31. data/spec/response_spec.rb +0 -11
  32. data/spec/runner_spec.rb +4 -4
  33. data/spec/server/builder_spec.rb +8 -3
  34. data/spec/server/pipelining_spec.rb +6 -5
  35. data/spec/server/swiftiply_spec.rb +25 -20
  36. data/spec/server/tcp_spec.rb +1 -9
  37. data/spec/server/unix_socket_spec.rb +1 -5
  38. data/spec/server_spec.rb +4 -7
  39. data/spec/spec_helper.rb +29 -5
  40. data/tasks/announce.rake +2 -2
  41. data/tasks/email.erb +13 -15
  42. data/tasks/ext.rake +28 -24
  43. data/tasks/gem.rake +8 -4
  44. data/tasks/spec.rake +14 -9
  45. metadata +19 -15
  46. data/lib/thin/connectors/connector.rb +0 -73
  47. data/spec/connectors/unix_server_spec.rb +0 -43
@@ -11,17 +11,21 @@ spec = Gem::Specification.new do |s|
11
11
  s.author = "Marc-Andre Cournoyer"
12
12
  s.email = 'macournoyer@gmail.com'
13
13
  s.homepage = 'http://code.macournoyer.com/thin/'
14
+ s.rubyforge_project = 'thin'
15
+ s.has_rdoc = true
14
16
  s.executables = %w(thin)
15
17
 
16
- s.required_ruby_version = '>= 1.8.6' # Makes sure the CGI eof fix is there
18
+ s.required_ruby_version = '>= 1.8.5'
17
19
 
18
20
  s.add_dependency 'rack', '>= 0.2.0'
19
- s.add_dependency 'eventmachine', '>= 0.8.1'
20
- unless WIN
21
+ if WIN
22
+ s.add_dependency 'eventmachine', '>= 0.8.1'
23
+ else
21
24
  s.add_dependency 'daemons', '>= 1.0.9'
25
+ s.add_dependency 'eventmachine', '>= 0.10.0' # TODO '>= 0.11.0' when it's released
22
26
  end
23
27
 
24
- s.files = %w(COPYING CHANGELOG README Rakefile) +
28
+ s.files = %w(COPYING CHANGELOG COMMITTERS README Rakefile) +
25
29
  Dir.glob("{benchmark,bin,doc,example,lib,spec,tasks}/**/*") +
26
30
  Dir.glob("ext/**/*.{h,c,rb,rl}")
27
31
 
@@ -1,19 +1,19 @@
1
1
  CLEAN.include %w(coverage tmp log)
2
2
 
3
- if RUBY_1_9
3
+ if RUBY_1_9 # RSpec not yet working w/ Ruby 1.9
4
4
  task :spec do
5
5
  warn 'RSpec not yet supporting Ruby 1.9, so cannot run the specs :('
6
6
  end
7
7
  else
8
- # RSpec not yet working w/ Ruby 1.9
9
8
  require 'spec/rake/spectask'
10
9
 
11
10
  desc "Run all examples"
12
- Spec::Rake::SpecTask.new('spec') do |t|
13
- t.spec_files = FileList['spec/**/*_spec.rb']
11
+ Spec::Rake::SpecTask.new(:spec) do |t|
12
+ t.spec_opts = %w(-fs -c)
13
+ t.spec_files = FileList['spec/**/*_spec.rb'] - FileList['spec/perf/*_spec.rb']
14
14
  if WIN
15
15
  t.spec_files -= [
16
- 'spec/connectors/unix_server_spec.rb',
16
+ 'spec/backends/unix_server_spec.rb',
17
17
  'spec/controllers/service_spec.rb',
18
18
  'spec/daemonizing_spec.rb',
19
19
  'spec/server/unix_socket_spec.rb',
@@ -21,15 +21,20 @@ else
21
21
  ]
22
22
  end
23
23
  end
24
+ task :spec => :compile
24
25
 
25
- task :check_spec_gems do
26
+ desc "Run all performance examples"
27
+ Spec::Rake::SpecTask.new('spec:perf') do |t|
28
+ t.spec_files = FileList['spec/perf/*_spec.rb']
29
+ end
30
+
31
+ task :check_benchmark_unit_gem do
26
32
  begin
27
- require 'spec'
28
33
  require 'benchmark_unit'
29
34
  rescue LoadError
30
- abort "To run specs, install rspec and benchmark_unit gems"
35
+ abort "To run specs, install benchmark_unit gem"
31
36
  end
32
37
  end
33
38
 
34
- task :spec => [:check_spec_gems, :compile]
39
+ task 'spec:perf' => :check_benchmark_unit_gem
35
40
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: x86-mswin32-60
6
6
  authors:
7
7
  - Marc-Andre Cournoyer
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-02-21 00:00:00 -07:00
12
+ date: 2008-03-06 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -41,6 +41,7 @@ extra_rdoc_files: []
41
41
  files:
42
42
  - COPYING
43
43
  - CHANGELOG
44
+ - COMMITTERS
44
45
  - README
45
46
  - Rakefile
46
47
  - benchmark/abc
@@ -61,13 +62,13 @@ files:
61
62
  - lib/rack/handler
62
63
  - lib/rack/handler/thin.rb
63
64
  - lib/thin
65
+ - lib/thin/backends
66
+ - lib/thin/backends/base.rb
67
+ - lib/thin/backends/swiftiply_client.rb
68
+ - lib/thin/backends/tcp_server.rb
69
+ - lib/thin/backends/unix_server.rb
64
70
  - lib/thin/command.rb
65
71
  - lib/thin/connection.rb
66
- - lib/thin/connectors
67
- - lib/thin/connectors/connector.rb
68
- - lib/thin/connectors/swiftiply_client.rb
69
- - lib/thin/connectors/tcp_server.rb
70
- - lib/thin/connectors/unix_server.rb
71
72
  - lib/thin/controllers
72
73
  - lib/thin/controllers/cluster.rb
73
74
  - lib/thin/controllers/controller.rb
@@ -85,15 +86,15 @@ files:
85
86
  - lib/thin/statuses.rb
86
87
  - lib/thin/version.rb
87
88
  - lib/thin.rb
89
+ - spec/backends
90
+ - spec/backends/swiftiply_client_spec.rb
91
+ - spec/backends/tcp_server_spec.rb
92
+ - spec/backends/unix_server_spec.rb
88
93
  - spec/command_spec.rb
89
94
  - spec/configs
90
95
  - spec/configs/cluster.yml
91
96
  - spec/configs/single.yml
92
97
  - spec/connection_spec.rb
93
- - spec/connectors
94
- - spec/connectors/swiftiply_client_spec.rb
95
- - spec/connectors/tcp_server_spec.rb
96
- - spec/connectors/unix_server_spec.rb
97
98
  - spec/controllers
98
99
  - spec/controllers/cluster_spec.rb
99
100
  - spec/controllers/controller_spec.rb
@@ -101,6 +102,10 @@ files:
101
102
  - spec/daemonizing_spec.rb
102
103
  - spec/headers_spec.rb
103
104
  - spec/logging_spec.rb
105
+ - spec/perf
106
+ - spec/perf/request_perf_spec.rb
107
+ - spec/perf/response_perf_spec.rb
108
+ - spec/perf/server_perf_spec.rb
104
109
  - spec/rack_rails_spec.rb
105
110
  - spec/rails_app
106
111
  - spec/rails_app/app
@@ -160,7 +165,6 @@ files:
160
165
  - spec/request
161
166
  - spec/request/mongrel_spec.rb
162
167
  - spec/request/parser_spec.rb
163
- - spec/request/perf_spec.rb
164
168
  - spec/request/persistent_spec.rb
165
169
  - spec/request/processing_spec.rb
166
170
  - spec/response_spec.rb
@@ -192,7 +196,7 @@ files:
192
196
  - ext/thin_parser/common.rl
193
197
  - ext/thin_parser/parser.rl
194
198
  - lib/thin_parser.so
195
- has_rdoc: false
199
+ has_rdoc: true
196
200
  homepage: http://code.macournoyer.com/thin/
197
201
  post_install_message:
198
202
  rdoc_options: []
@@ -203,7 +207,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
203
207
  requirements:
204
208
  - - ">="
205
209
  - !ruby/object:Gem::Version
206
- version: 1.8.6
210
+ version: 1.8.5
207
211
  version:
208
212
  required_rubygems_version: !ruby/object:Gem::Requirement
209
213
  requirements:
@@ -213,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
213
217
  version:
214
218
  requirements: []
215
219
 
216
- rubyforge_project:
220
+ rubyforge_project: thin
217
221
  rubygems_version: 1.0.1
218
222
  signing_key:
219
223
  specification_version: 2
@@ -1,73 +0,0 @@
1
- module Thin
2
- module Connectors
3
- # A Connector connect the server to the client. It handles:
4
- # * connection/disconnection to the server
5
- # * initialization of the connections
6
- # * manitoring of the active connections.
7
- class Connector
8
- # Server serving the connections throught the connector
9
- attr_accessor :server
10
-
11
- # Maximum time for incoming data to arrive
12
- attr_accessor :timeout
13
-
14
- # Maximum number of connections that can be persistent
15
- attr_accessor :maximum_persistent_connections
16
-
17
- # Number of persistent connections currently opened
18
- attr_accessor :persistent_connection_count
19
-
20
- def initialize
21
- @connections = []
22
- @timeout = Server::DEFAULT_TIMEOUT
23
- @persistent_connection_count = 0
24
- @maximum_persistent_connections = Server::DEFAULT_MAXIMUM_PERSISTENT_CONNECTIONS
25
- end
26
-
27
- # Free up resources used by the connector.
28
- def close
29
- end
30
-
31
- def running?
32
- @server.running?
33
- end
34
-
35
- # Initialize a new connection to a client.
36
- def initialize_connection(connection)
37
- connection.connector = self
38
- connection.app = @server.app
39
- connection.comm_inactivity_timeout = @timeout
40
-
41
- # We control the number of persistent connections by keeping
42
- # a count of the total one allowed yet.
43
- if @persistent_connection_count < @maximum_persistent_connections
44
- connection.can_persist!
45
- @persistent_connection_count += 1
46
- end
47
-
48
- @connections << connection
49
- end
50
-
51
- # Close all active connections.
52
- def close_connections
53
- @connections.each { |connection| connection.close_connection }
54
- end
55
-
56
- # Called by a connection when it's unbinded.
57
- def connection_finished(connection)
58
- @persistent_connection_count -= 1 if connection.can_persist?
59
- @connections.delete(connection)
60
- end
61
-
62
- # Returns +true+ if no active connection.
63
- def empty?
64
- @connections.empty?
65
- end
66
-
67
- # Number of active connections.
68
- def size
69
- @connections.size
70
- end
71
- end
72
- end
73
- end
@@ -1,43 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
2
-
3
- describe Connectors::UnixServer do
4
- before do
5
- @connector = Connectors::UnixServer.new('/tmp/thin-test.sock')
6
- end
7
-
8
- it "should connect" do
9
- EventMachine.run do
10
- @connector.connect
11
- EventMachine.stop
12
- end
13
- end
14
-
15
- it "should disconnect" do
16
- EventMachine.run do
17
- @connector.connect
18
- @connector.disconnect
19
- EventMachine.stop
20
- end
21
- end
22
-
23
- it "should remove socket file on close" do
24
- @connector.close
25
- File.exist?('/tmp/thin-test.sock').should be_false
26
- end
27
- end
28
-
29
- describe UnixConnection do
30
- before do
31
- @connection = UnixConnection.new(nil)
32
- end
33
-
34
- it "should return nil on error retreiving remote_address" do
35
- @connection.stub!(:get_peername).and_raise(RuntimeError)
36
- @connection.remote_address.should be_nil
37
- end
38
-
39
- it "should return remote_address" do
40
- @connection.stub!(:get_peername).and_return("\000\001127.0.0.1\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")
41
- @connection.remote_address.should == '127.0.0.1'
42
- end
43
- end