mongrel 1.0.5 → 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.

@@ -56,6 +56,7 @@ class ConfiguratorTest < Test::Unit::TestCase
56
56
  end
57
57
  end
58
58
 
59
+ # pp @config.listeners.values.first.classifier.routes
59
60
 
60
61
  @config.listeners.each do |host,listener|
61
62
  assert listener.classifier.uris.length == 3, "Wrong number of registered URIs"
@@ -9,7 +9,9 @@ require 'test/testhelp'
9
9
  class RedirectHandlerTest < Test::Unit::TestCase
10
10
 
11
11
  def setup
12
- @server = Mongrel::HttpServer.new('127.0.0.1', 9998)
12
+ redirect_test_io do
13
+ @server = Mongrel::HttpServer.new('127.0.0.1', 9998)
14
+ end
13
15
  @server.run
14
16
  @client = Net::HTTP.new('127.0.0.1', 9998)
15
17
  end
@@ -38,7 +38,9 @@ end
38
38
 
39
39
  class RequestProgressTest < Test::Unit::TestCase
40
40
  def setup
41
- @server = Mongrel::HttpServer.new("127.0.0.1", 9998)
41
+ redirect_test_io do
42
+ @server = Mongrel::HttpServer.new("127.0.0.1", 9998)
43
+ end
42
44
  @handler = UploadBeginHandler.new
43
45
  @server.register("/upload", @handler)
44
46
  @server.run
@@ -124,6 +124,7 @@ class URIClassifierTest < Test::Unit::TestCase
124
124
  current << c.chr
125
125
  uri_classifier.register(current, c)
126
126
  end
127
+
127
128
 
128
129
  # Try to resolve everything with no asserts as a fuzzing
129
130
  tests.each do |prefix|
@@ -186,7 +187,6 @@ class URIClassifierTest < Test::Unit::TestCase
186
187
 
187
188
  tests.each do |uri|
188
189
  script_name, path_info, handler = uri_classifier.resolve(uri)
189
- # p uri_classifier.resolve(uri)
190
190
  assert_equal root, script_name, "#{uri} did not resolve to #{root}"
191
191
  assert_equal uri, path_info
192
192
  assert_equal 2, handler
@@ -22,9 +22,12 @@ class WebServerTest < Test::Unit::TestCase
22
22
 
23
23
  def setup
24
24
  @valid_request = "GET / HTTP/1.1\r\nHost: www.zedshaw.com\r\nContent-Type: text/plain\r\n\r\n"
25
-
26
- # We set num_processors=1 so that we can test the reaping code
27
- @server = HttpServer.new("127.0.0.1", 9998, num_processors=1)
25
+
26
+ redirect_test_io do
27
+ # We set num_processors=1 so that we can test the reaping code
28
+ @server = HttpServer.new("127.0.0.1", 9998, num_processors=1)
29
+ end
30
+
28
31
  @tester = TestHandler.new
29
32
  @server.register("/test", @tester)
30
33
  redirect_test_io do
@@ -44,7 +47,7 @@ class WebServerTest < Test::Unit::TestCase
44
47
  end
45
48
 
46
49
 
47
- def do_test(string, chunk, close_after=nil)
50
+ def do_test(string, chunk, close_after=nil, shutdown_delay=0)
48
51
  # Do not use instance variables here, because it needs to be thread safe
49
52
  socket = TCPSocket.new("127.0.0.1", 9998);
50
53
  request = StringIO.new(string)
@@ -59,7 +62,9 @@ class WebServerTest < Test::Unit::TestCase
59
62
  sleep 1
60
63
  end
61
64
  end
65
+ sleep(shutdown_delay)
62
66
  socket.write(" ") # Some platforms only raise the exception on attempted write
67
+ socket.flush
63
68
  end
64
69
 
65
70
  def test_trickle_attack
@@ -81,8 +86,8 @@ class WebServerTest < Test::Unit::TestCase
81
86
  def test_header_is_too_long
82
87
  redirect_test_io do
83
88
  long = "GET /test HTTP/1.1\r\n" + ("X-Big: stuff\r\n" * 15000) + "\r\n"
84
- assert_raises Errno::ECONNRESET, Errno::EPIPE, Errno::ECONNABORTED, Errno::EINVAL do
85
- do_test(long, long.length/2)
89
+ assert_raises Errno::ECONNRESET, Errno::EPIPE, Errno::ECONNABORTED, Errno::EINVAL, IOError do
90
+ do_test(long, long.length/2, 10)
86
91
  end
87
92
  end
88
93
  end
@@ -20,6 +20,7 @@ require 'benchmark'
20
20
  require 'digest/sha1'
21
21
  require 'uri'
22
22
  require 'stringio'
23
+ require 'pp'
23
24
 
24
25
  require 'mongrel'
25
26
  require 'mongrel/stats'
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
2
+ rubygems_version: 0.9.4.6
3
+ specification_version: 2
4
4
  name: mongrel
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.5
7
- date: 2007-12-29 00:00:00 -03:00
6
+ version: "1.1"
7
+ date: 2007-11-01 00:00:00 -04: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
@@ -17,12 +17,18 @@ autorequire:
17
17
  default_executable:
18
18
  bindir: bin
19
19
  has_rdoc: true
20
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ required_ruby_version: !ruby/object:Gem::Requirement
21
21
  requirements:
22
22
  - - ">="
23
23
  - !ruby/object:Gem::Version
24
24
  version: 1.8.4
25
25
  version:
26
+ required_rubygems_version: !ruby/object:Gem::Requirement
27
+ requirements:
28
+ - - ">="
29
+ - !ruby/object:Gem::Version
30
+ version: "0"
31
+ version:
26
32
  platform: ruby
27
33
  signing_key:
28
34
  cert_chain:
@@ -50,24 +56,24 @@ cert_chain:
50
56
 
51
57
  - |
52
58
  -----BEGIN CERTIFICATE-----
53
- MIIDQzCCAiugAwIBAgIBADANBgkqhkiG9w0BAQUFADBOMRwwGgYDVQQDDBNtb25n
59
+ MIIDPzCCAiegAwIBAgIBADANBgkqhkiG9w0BAQUFADBOMRwwGgYDVQQDDBNtb25n
54
60
  cmVsLWRldmVsb3BtZW50MRkwFwYKCZImiZPyLGQBGRYJcnVieWZvcmdlMRMwEQYK
55
- CZImiZPyLGQBGRYDb3JnMB4XDTA3MDkyNDAyMzAzOVoXDTA4MDkyMzAyMzAzOVow
56
- QTETMBEGA1UEAwwKbHVpc2xhdmVuYTEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMw
57
- EQYKCZImiZPyLGQBGRYDY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
58
- AQEA5gIWDL7FYk43BEM3guuNz1vrr2RW7UAh+KY8w2+cGxt+MNi3P+rrfx/LAr7d
59
- KKV+RT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OiyvDsAivn7GjKXhVvflp2/npMhBBe83P4HOWqeQBjkk3QJI
66
+ FFNBvqbFLeEXIP+HiqAOiyNHZEVXMepLEJLzGrg3Ly7M7A6L5fK7jDrt8jkm+c+8
67
+ zGquVHV5ohAebGd/vpHMLjpA7lCG5+MBgYZd33rRfNtCxDJMNRgnOu9PsB05+LJn
68
+ MpDKQq3x0SkOf5A+MVOcadNCaAkFflYk3SUcXaXWxu/eCHgqfW1m76RNSp5djpKE
69
+ CgNPK9lGIWpB3CHzDaVNAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSw
70
+ MB0GA1UdDgQWBBT5aonPfFBdJ5rWFG+8dZwgyB54LjANBgkqhkiG9w0BAQUFAAOC
71
+ AQEAiKbzWgMcvZs/TPwJxr8tJ+7mSGz7+zDkWcbBl8FpQq1DtRcATh1oyTkQT7t+
72
+ rFEBYMmb0FxbbUnojQp8hIFgFkUwFpStwWBL/okLSehntzI2iwjuEtfj4ac9Q3Y2
73
+ uSdbmZqsQTuu+lEUc5C4qLK7YKwToaul+cx7vWxyk1YendcVwRlFLIBqA5cPrwo3
74
+ yyGLTHlRYn2c9PSbM1B63Yg+LqSSAa4QSU3Wv9pNdffVpvwHPVEQpO7ZDo5slQFL
75
+ Gf6+gbD/eZAvhpvmn8JlXb+LxKaFVMs2Yvrk1xOuT76SsPjEGWxkr7jZCIpsYfgQ
76
+ ALN3mi/9z0Mf1YroliUgF0v5Yw==
71
77
  -----END CERTIFICATE-----
72
78
 
73
79
  post_install_message:
@@ -98,33 +104,33 @@ files:
98
104
  - ext/http11/http11_parser.java.rl
99
105
  - ext/http11/http11_parser.rl
100
106
  - ext/http11/http11_parser_common.rl
101
- - ext/http11/MANIFEST
102
- - ext/http11/tst.h
103
- - ext/http11/tst_cleanup.c
104
- - ext/http11/tst_delete.c
105
- - ext/http11/tst_grow_node_free_list.c
106
- - ext/http11/tst_init.c
107
- - ext/http11/tst_insert.c
108
- - ext/http11/tst_search.c
107
+ - ext/http11_java/Http11Service.java
108
+ - ext/http11_java/org/jruby/mongrel/Http11.java
109
+ - ext/http11_java/org/jruby/mongrel/Http11Parser.java
109
110
  - lib/mongrel/camping.rb
110
111
  - lib/mongrel/cgi.rb
111
112
  - lib/mongrel/command.rb
112
113
  - lib/mongrel/configurator.rb
114
+ - lib/mongrel/const.rb
113
115
  - lib/mongrel/debug.rb
116
+ - lib/mongrel/gems.rb
114
117
  - lib/mongrel/handlers.rb
118
+ - lib/mongrel/header_out.rb
119
+ - lib/mongrel/http_request.rb
120
+ - lib/mongrel/http_response.rb
115
121
  - lib/mongrel/init.rb
116
122
  - lib/mongrel/mime_types.yml
117
123
  - lib/mongrel/rails.rb
118
124
  - lib/mongrel/stats.rb
119
125
  - lib/mongrel/tcphack.rb
126
+ - lib/mongrel/uri_classifier.rb
120
127
  - lib/mongrel.rb
121
- - lib/mutex_fix.rb
122
128
  - LICENSE
123
129
  - Manifest
124
130
  - mongrel-public_cert.pem
131
+ - mongrel.gemspec
125
132
  - README
126
133
  - setup.rb
127
- - test/jruby_socket.rb
128
134
  - test/mime.yaml
129
135
  - test/mongrel.conf
130
136
  - test/test_cgi_wrapper.rb
@@ -141,8 +147,8 @@ files:
141
147
  - test/test_uriclassifier.rb
142
148
  - test/test_ws.rb
143
149
  - test/testhelp.rb
150
+ - TODO
144
151
  - tools/trickletest.rb
145
- - mongrel.gemspec
146
152
  test_files:
147
153
  - test/test_cgi_wrapper.rb
148
154
  - test/test_command.rb
@@ -171,9 +177,36 @@ dependencies:
171
177
  - !ruby/object:Gem::Dependency
172
178
  name: gem_plugin
173
179
  version_requirement:
174
- version_requirements: !ruby/object:Gem::Version::Requirement
180
+ version_requirements: !ruby/object:Gem::Requirement
175
181
  requirements:
176
182
  - - ">="
177
183
  - !ruby/object:Gem::Version
178
184
  version: 0.2.3
179
185
  version:
186
+ - !ruby/object:Gem::Dependency
187
+ name: cgi_multipart_eof_fix
188
+ version_requirement:
189
+ version_requirements: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - ">="
192
+ - !ruby/object:Gem::Version
193
+ version: "2.4"
194
+ version:
195
+ - !ruby/object:Gem::Dependency
196
+ name: daemons
197
+ version_requirement:
198
+ version_requirements: !ruby/object:Gem::Requirement
199
+ requirements:
200
+ - - ">="
201
+ - !ruby/object:Gem::Version
202
+ version: 1.0.3
203
+ version:
204
+ - !ruby/object:Gem::Dependency
205
+ name: fastthread
206
+ version_requirement:
207
+ version_requirements: !ruby/object:Gem::Requirement
208
+ requirements:
209
+ - - ">="
210
+ - !ruby/object:Gem::Version
211
+ version: 1.0.1
212
+ version:
metadata.gz.sig CHANGED
@@ -1 +1 @@
1
- p��=����4��A���&e�RE}#k������b9���s9w��D3 ���UT���ZGv�ѩ
1
+ Cw�����q]o[ݳ$�]岧�b�M�� ovd�qV�"��\� �f��_0��|�ԏ��'i*�L�� ���Ò,��#X� Й;7X�XA;�]u+Oξ���+�|!���_�����|�.0w5�*\4Vΰ�Deedw��"�C���Y3Iiu��Z(��`v���[]0}�P�;��%^6$'���-SOch���u����E�ɿ��Q!ܗ��g3�Q��33ĩ`������X����l���P �v
File without changes
@@ -1,40 +0,0 @@
1
-
2
-
3
- struct node
4
- {
5
- unsigned char value;
6
- struct node *left;
7
- struct node *middle;
8
- struct node *right;
9
- };
10
-
11
- struct tst
12
- {
13
- int node_line_width;
14
- struct node_lines *node_lines;
15
- struct node *free_list;
16
- struct node *head[127];
17
- };
18
-
19
- struct node_lines
20
- {
21
- struct node *node_line;
22
- struct node_lines *next;
23
- };
24
-
25
- enum tst_constants
26
- {
27
- TST_OK, TST_ERROR, TST_NULL_KEY, TST_DUPLICATE_KEY, TST_REPLACE, TST_LONGEST_MATCH
28
- };
29
-
30
- struct tst *tst_init(int node_line_width);
31
-
32
- int tst_insert(unsigned char *key, void *data, struct tst *tst, int option, void **exist_ptr);
33
-
34
- void *tst_search(const unsigned char *key, struct tst *tst, int option, unsigned int *match_len);
35
-
36
- void *tst_delete(unsigned char *key, struct tst *tst);
37
-
38
- void tst_cleanup(struct tst *tst);
39
-
40
-
@@ -1,23 +0,0 @@
1
-
2
- #include "tst.h"
3
- #include <stdio.h>
4
- #include <stdlib.h>
5
-
6
- void tst_cleanup(struct tst *tst)
7
- {
8
- struct node_lines *current_line;
9
- struct node_lines *next_line;
10
-
11
- next_line = tst->node_lines;
12
-
13
- do
14
- {
15
- current_line = next_line;
16
- next_line = current_line->next;
17
- free(current_line->node_line);
18
- free(current_line);
19
- }
20
- while(next_line != NULL);
21
-
22
- free(tst);
23
- }
@@ -1,146 +0,0 @@
1
-
2
- #include "tst.h"
3
- #include <stdio.h>
4
- #include <stdlib.h>
5
-
6
- void *tst_delete(unsigned char *key, struct tst *tst)
7
- {
8
- struct node *current_node;
9
- struct node *current_node_parent;
10
- struct node *last_branch;
11
- struct node *last_branch_parent;
12
- struct node *next_node;
13
- struct node *last_branch_replacement;
14
- struct node *last_branch_dangling_child;
15
- int key_index;
16
-
17
-
18
- if(key[0] == 0)
19
- return NULL;
20
- if(tst->head[(int)key[0]] == NULL)
21
- return NULL;
22
-
23
- last_branch = NULL;
24
- last_branch_parent = NULL;
25
- current_node = tst->head[(int)key[0]];
26
- current_node_parent = NULL;
27
- key_index = 1;
28
- while(current_node != NULL)
29
- {
30
- if(key[key_index] == current_node->value)
31
- {
32
-
33
- if( (current_node->left != NULL) || (current_node->right != NULL) )
34
- {
35
- last_branch = current_node;
36
- last_branch_parent = current_node_parent;
37
- }
38
- if(key[key_index] == 0)
39
- break;
40
- else
41
- {
42
- current_node_parent = current_node;
43
- current_node = current_node->middle;
44
- key_index++;
45
- continue;
46
- }
47
- }
48
- else if( ((current_node->value == 0) && (key[key_index] < 64)) ||
49
- ((current_node->value != 0) && (key[key_index] <
50
- current_node->value)) )
51
- {
52
- last_branch_parent = current_node;
53
- current_node_parent = current_node;
54
- current_node = current_node->left;
55
- last_branch = current_node;
56
- continue;
57
- }
58
- else
59
- {
60
- last_branch_parent = current_node;
61
- current_node_parent = current_node;
62
- current_node = current_node->right;
63
- last_branch = current_node;
64
- continue;
65
- }
66
-
67
- }
68
- if(current_node == NULL)
69
- return NULL;
70
-
71
- if(last_branch == NULL)
72
- {
73
-
74
- next_node = tst->head[(int)key[0]];
75
- tst->head[(int)key[0]] = NULL;
76
- }
77
- else if( (last_branch->left == NULL) && (last_branch->right == NULL) )
78
- {
79
-
80
- if(last_branch_parent->left == last_branch)
81
- last_branch_parent->left = NULL;
82
- else
83
- last_branch_parent->right = NULL;
84
-
85
- next_node = last_branch;
86
- }
87
- else
88
- {
89
-
90
- if( (last_branch->left != NULL) && (last_branch->right != NULL) )
91
- {
92
- last_branch_replacement = last_branch->right;
93
- last_branch_dangling_child = last_branch->left;
94
- }
95
- else if(last_branch->right != NULL)
96
- {
97
- last_branch_replacement = last_branch->right;
98
- last_branch_dangling_child = NULL;
99
- }
100
- else
101
- {
102
- last_branch_replacement = last_branch->left;
103
- last_branch_dangling_child = NULL;
104
- }
105
-
106
- if(last_branch_parent == NULL)
107
- tst->head[(int)key[0]]=last_branch_replacement;
108
- else
109
- {
110
- if (last_branch_parent->left == last_branch)
111
- last_branch_parent->left = last_branch_replacement;
112
- else if (last_branch_parent->right == last_branch)
113
- last_branch_parent->right = last_branch_replacement;
114
- else
115
- last_branch_parent->middle = last_branch_replacement;
116
- }
117
-
118
- if(last_branch_dangling_child != NULL)
119
- {
120
- current_node = last_branch_replacement;
121
-
122
- while (current_node->left != NULL)
123
- current_node = current_node->left;
124
-
125
- current_node->left = last_branch_dangling_child;
126
- }
127
-
128
- next_node = last_branch;
129
- }
130
-
131
- do
132
- {
133
- current_node = next_node;
134
- next_node = current_node->middle;
135
-
136
- current_node->left = NULL;
137
- current_node->right = NULL;
138
- current_node->middle = tst->free_list;
139
- tst->free_list = current_node;
140
- }
141
- while(current_node->value != 0);
142
-
143
- return next_node;
144
-
145
- }
146
-