mongrel2 0.43.2 → 0.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f7852405a9d60c17ae16546869be99a7e042457
4
- data.tar.gz: 709c3eb15aeeca3cb090b2d75bb9f18510adbe58
3
+ metadata.gz: 26139efa603e33508d75a1ce39b158d5c3c9718a
4
+ data.tar.gz: e4cd15d5ff533a8139f6c3b0601c6a9ec7ae1b7a
5
5
  SHA512:
6
- metadata.gz: d44d49fabcaa5dc7e967758f10db8934fe73c8c184356a94222ccfa524d26570e254427c7caf8dbe5c8188a287ba8cedda0c75c71d0eab246d3be8430a21c09e
7
- data.tar.gz: 37f057770da4532f7fa95cef17cc26d7a853f31b0ee94e7b7df5175320b74d07674443a4f666b0a7a817d24ebe9eddb41ebbae11aaeb610b76d88c7d5e835fdf
6
+ metadata.gz: a036ca5e4bac09a1a03d1c4c75b8451c543c081384a8407f3c27ae8acd00dc477909edb7d03470ada71613c92961f944be442ab4bcbd0a02a5144c026ef4364d
7
+ data.tar.gz: 1ce62fe189f10d61946a01e7d9857da78359668bc943ace456b46ca3a55b183084b403c9629d3b1cf326245cd79d6aaf21f167a4a819e47f9085aa965bac3af7
checksums.yaml.gz.sig CHANGED
Binary file
data/ChangeLog CHANGED
@@ -1,8 +1,58 @@
1
+ 2016-01-20 Mahlon E. Smith <mahlon@martini.nu>
2
+
3
+ * lib/mongrel2/handler.rb, lib/mongrel2/request.rb, spec/helpers.rb,
4
+ spec/mongrel2/config/dsl_spec.rb, spec/mongrel2/handler_spec.rb:
5
+ Ensure that Mongrel2 spool files are removed after the lifetime of a
6
+ request.
7
+ [250431675079] [github/master, tip]
8
+
9
+ 2015-12-30 Mahlon E. Smith <mahlon@martini.nu>
10
+
11
+ * lib/mongrel2/constants.rb:
12
+ Add the newly proposed code specific to legal obstacles /
13
+ censorship.
14
+
15
+ https://datatracker.ietf.org/doc/draft-ietf-httpbis-legally-
16
+ restricted-status/?include_text=1
17
+ [65558310228d]
18
+
1
19
  2015-10-01 Michael Granger <ged@FaerieMUD.org>
2
20
 
21
+ * .hgtags:
22
+ Added tag v0.43.2 for changeset ebb8ae0b71ff
23
+ [fb7a9cf2c2ea]
24
+
25
+ * .hgsigs:
26
+ Added signature for changeset 17359ad421b0
27
+ [ebb8ae0b71ff] [v0.43.2]
28
+
29
+ * History.rdoc, lib/mongrel2.rb:
30
+ Bumped the patch version, as 0.43.1 somehow got released without a
31
+ tag.
32
+ [17359ad421b0]
33
+
34
+ * .hgtags:
35
+ Added tag v0.43.1 for changeset 8c5c225990c0
36
+ [083b75a08bf5]
37
+
38
+ * .hgsigs:
39
+ Added signature for changeset f8a9e5cc138d
40
+ [8c5c225990c0] [v0.43.1]
41
+
42
+ * History.rdoc:
43
+ Update history.
44
+ [f8a9e5cc138d]
45
+
46
+ * lib/mongrel2/connection.rb:
47
+ Strip some debug logging.
48
+
49
+ They were throwing encoding errors under the latest Ruby 2.2, and
50
+ they weren't really serving a purpose any longer anyway.
51
+ [33a9fd04279f]
52
+
3
53
  * .gems:
4
54
  Update gemset to latest versions
5
- [23b8eb49ae8f] [tip]
55
+ [23b8eb49ae8f]
6
56
 
7
57
  2015-03-25 Michael Granger <ged@FaerieMUD.org>
8
58
 
@@ -12,7 +62,7 @@
12
62
 
13
63
  * History.rdoc, lib/mongrel2.rb:
14
64
  Bump the patch version, update history.
15
- [d86faeea99f6] [github/master]
65
+ [d86faeea99f6]
16
66
 
17
67
  * lib/mongrel2/constants.rb:
18
68
  Remove some duplicated constant
data/History.rdoc CHANGED
@@ -1,3 +1,16 @@
1
+ == v0.44.0 [2016-01-20] Mahlon E. Smith <mahlon@martini.nu>
2
+
3
+ Enhancements:
4
+
5
+ - Ensure that Mongrel2 spool files are removed after the lifetime of a
6
+ request.
7
+ - Add the newly proposed code specific to legal obstacles /
8
+ censorship.
9
+
10
+ https://datatracker.ietf.org/doc/draft-ietf-httpbis-legally-
11
+ restricted-status/?include_text=1
12
+
13
+
1
14
  == v0.43.2 [2015-03-25] Michael Granger <ged@FaerieMUD.org>
2
15
 
3
16
  Bugfixes:
@@ -81,6 +81,7 @@ module Mongrel2::Constants
81
81
  RECONDITION_REQUIRED = 428
82
82
  TOO_MANY_REQUESTS = 429
83
83
  REQUEST_HEADERS_TOO_LARGE = 431
84
+ UNAVAILABLE_DUE_TO_LEGALITIES = 451
84
85
 
85
86
  SERVER_ERROR = 500
86
87
  NOT_IMPLEMENTED = 501
@@ -143,6 +144,7 @@ module Mongrel2::Constants
143
144
  428 => "Precondition Required",
144
145
  429 => "Too Many Requests",
145
146
  431 => "Request Headers too Large",
147
+ 451 => "Unavailable For Legal Reasons",
146
148
  500 => "Internal Server Error",
147
149
  501 => "Method Not Implemented",
148
150
  502 => "Bad Gateway",
@@ -256,6 +256,15 @@ class Mongrel2::Handler
256
256
  self.log.info( res.inspect )
257
257
  @conn.reply( res ) unless @conn.closed?
258
258
  end
259
+ ensure
260
+ # Remove any temporarily spooled Mongrel2 files.
261
+ begin
262
+ if req && req.body && req.body.respond_to?( :path ) && req.body.path
263
+ File.unlink( req.body.path )
264
+ end
265
+ rescue Errno::ENOENT => err
266
+ self.log.debug "File already cleaned up: %s (%s)" % [ req.body.path, err.message ]
267
+ end
259
268
  end
260
269
 
261
270
 
@@ -201,7 +201,7 @@ class Mongrel2::Request
201
201
  self.log.error "uploaded body %s not found: tried relative to cwd and server chroot (%s)" %
202
202
  [ relpath, chrooted ]
203
203
  raise Mongrel2::UploadError,
204
- "couldn't find the path to uploaded body."
204
+ "couldn't find the path to uploaded body %p." % [ chrooted.to_s ]
205
205
  end
206
206
  end
207
207
 
data/lib/mongrel2.rb CHANGED
@@ -25,10 +25,10 @@ module Mongrel2
25
25
  abort "\n\n>>> Mongrel2 requires Ruby 1.9.2 or later. <<<\n\n" if RUBY_VERSION < '1.9.2'
26
26
 
27
27
  # Library version constant
28
- VERSION = '0.43.2'
28
+ VERSION = '0.44.0'
29
29
 
30
30
  # Version-control revision constant
31
- REVISION = %q$Revision: 17359ad421b0 $
31
+ REVISION = %q$Revision: 796ca99139a6 $
32
32
 
33
33
 
34
34
  require 'mongrel2/constants'
data/spec/helpers.rb CHANGED
@@ -30,6 +30,7 @@ require 'sequel/model'
30
30
  ### RSpec helper functions that are used to test Mongrel2 itself.
31
31
  module Mongrel2::SpecHelpers
32
32
  include Mongrel2::TestConstants
33
+ include Mongrel2::Config::DSL
33
34
 
34
35
  ###############
35
36
  module_function
@@ -45,6 +46,12 @@ module Mongrel2::SpecHelpers
45
46
  def setup_config_db
46
47
  Mongrel2::Config.db ||= Mongrel2::Config.in_memory_db
47
48
  Mongrel2::Config.init_database
49
+ clean_config_db()
50
+ end
51
+
52
+
53
+ ### Wipe out any existing db data.
54
+ def clean_config_db
48
55
  Mongrel2::Config.db.tables.collect {|t| Mongrel2::Config.db[t] }.each( &:truncate )
49
56
  end
50
57
 
@@ -62,8 +69,24 @@ module Mongrel2::SpecHelpers
62
69
  end
63
70
 
64
71
 
72
+ ### Provide a default mongrel2 configuration.
73
+ ###
74
+ def setup_mongrel2_config
75
+ server 'test-server' do
76
+ chroot Dir.tmpdir
77
+ port 8080
78
+ default_host 'test-host'
79
+
80
+ host 'test-host' do
81
+ route '/handler', handler( TEST_RECV_SPEC, 'test-handler' )
82
+ end
83
+ end
84
+ end
85
+
86
+
65
87
  ### Make a raw Mongrel2 request from the specified +opts+ and return it as a String.
66
88
  def make_request( opts={} )
89
+ setup_mongrel2_config()
67
90
  opts = TEST_REQUEST_OPTS.merge( opts )
68
91
  headers = normalize_headers( opts )
69
92
 
@@ -21,11 +21,7 @@ describe Mongrel2::Config::DSL do
21
21
  end
22
22
 
23
23
  before( :each ) do
24
- Mongrel2::Config::Server.truncate
25
- Mongrel2::Config::Host.truncate
26
- Mongrel2::Config::Route.truncate
27
- Mongrel2::Config::Filter.truncate
28
- Mongrel2::Config::XRequest.truncate
24
+ clean_config_db()
29
25
  end
30
26
 
31
27
  after( :all ) do
@@ -77,6 +77,11 @@ describe Mongrel2::Handler do
77
77
  Mongrel2::Config::Handler.create( @handler_config )
78
78
  end
79
79
 
80
+ after( :each ) do
81
+ clean_config_db
82
+ end
83
+
84
+
80
85
  it "can look up connection information given an application ID" do
81
86
  expect(
82
87
  Mongrel2::Handler.connection_info_for(TEST_UUID)
@@ -121,7 +126,7 @@ describe Mongrel2::Handler do
121
126
  Mongrel2::Config::Handler.dataset.truncate
122
127
  expect {
123
128
  Mongrel2::Handler.connection_info_for( TEST_UUID )
124
- }.to raise_error()
129
+ }.to raise_error( ArgumentError )
125
130
  end
126
131
 
127
132
  end
@@ -300,5 +305,18 @@ describe Mongrel2::Handler do
300
305
  expect( res.conn ).to_not equal( original_conn )
301
306
  end
302
307
 
308
+ it "cleans any mongrel2 request spool files after sending a response" do
309
+ spoolfile = Pathname.new( Dir.tmpdir + '/mongrel2.uskd8l1' )
310
+ spoolfile.write( "Hi!" )
311
+
312
+ req = make_request( 'METHOD' => 'POST', :headers => {
313
+ 'x-mongrel2-upload-start' => spoolfile.basename,
314
+ 'x-mongrel2-upload-done' => spoolfile.basename
315
+ })
316
+ expect( @request_sock ).to receive( :recv ).and_return( req )
317
+
318
+ res = OneShotHandler.new( TEST_UUID, TEST_SEND_SPEC, TEST_RECV_SPEC ).run
319
+ expect( spoolfile ).to_not exist
320
+ end
303
321
  end
304
322
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongrel2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.43.2
4
+ version: 0.44.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Granger
@@ -30,7 +30,7 @@ cert_chain:
30
30
  G8LHR7EjtPPmqCCunfyecJ6MmCNaiJCBxq2NYzyNmluPyHT8+0fuB5kccUVZm6CD
31
31
  xn3DzOkDE6NYbk8gC9rTsA==
32
32
  -----END CERTIFICATE-----
33
- date: 2015-10-02 00:00:00.000000000 Z
33
+ date: 2016-01-20 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: sequel
@@ -410,7 +410,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
410
410
  version: '0'
411
411
  requirements: []
412
412
  rubyforge_project:
413
- rubygems_version: 2.4.7
413
+ rubygems_version: 2.4.8
414
414
  signing_key:
415
415
  specification_version: 4
416
416
  summary: Ruby-Mongrel2 is a complete Ruby connector for Mongrel2[http://mongrel2.org/]
metadata.gz.sig CHANGED
Binary file