puma 5.6.0-java → 5.6.1-java
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puma might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/History.md +6 -0
- data/lib/puma/const.rb +1 -1
- data/lib/puma/puma_http11.jar +0 -0
- data/lib/puma/request.rb +29 -47
- data/lib/puma/server.rb +9 -11
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13ee538038db45a4708423f03dfd2d8ac9fdd8739ef69ea6f06dd627fbfd9430
|
4
|
+
data.tar.gz: cac82e9c940c2f2647cbc9f54c993f517540144676100f719f805f19923036c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0b49f62e5e77305256fae6c69ca95d7c945c8622c2a66568e6a32cab6514d0b63a2526a567893a845cee0dabd3348805c5af183eca8b95c2f1a389f7438f05b
|
7
|
+
data.tar.gz: 9e816311e715873f136fa2095a65d0bfacd039af7200aef684c48c1ce78aedf1cf499ca3722a02866964acfc58a801845ff19326ad4ea53b91582fcbafac68a3
|
data/History.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## 5.6.1 / 2022-01-26
|
2
|
+
|
3
|
+
* Bugfixes
|
4
|
+
* Reverted a commit which appeared to be causing occasional blank header values ([#2809])
|
5
|
+
|
1
6
|
## 5.6.0 / 2022-01-25
|
2
7
|
|
3
8
|
* Features
|
@@ -1830,6 +1835,7 @@ be added back in a future date when a java Puma::MiniSSL is added.
|
|
1830
1835
|
* Bugfixes
|
1831
1836
|
* Your bugfix goes here <Most recent on the top, like GitHub> (#Github Number)
|
1832
1837
|
|
1838
|
+
[#2809]:https://github.com/puma/puma/pull/2809 "PR by @dentarg, merged 2022-01-26"
|
1833
1839
|
[#2764]:https://github.com/puma/puma/pull/2764 "PR by @dentarg, merged 2022-01-18"
|
1834
1840
|
[#2708]:https://github.com/puma/puma/issues/2708 "Issue by @erikaxel, closed 2022-01-18"
|
1835
1841
|
[#2780]:https://github.com/puma/puma/pull/2780 "PR by @dalibor, merged 2022-01-01"
|
data/lib/puma/const.rb
CHANGED
@@ -100,7 +100,7 @@ module Puma
|
|
100
100
|
# too taxing on performance.
|
101
101
|
module Const
|
102
102
|
|
103
|
-
PUMA_VERSION = VERSION = "5.6.
|
103
|
+
PUMA_VERSION = VERSION = "5.6.1".freeze
|
104
104
|
CODE_NAME = "Birdie's Version".freeze
|
105
105
|
|
106
106
|
PUMA_SERVER_STRING = ['puma', PUMA_VERSION, CODE_NAME].join(' ').freeze
|
data/lib/puma/puma_http11.jar
CHANGED
Binary file
|
data/lib/puma/request.rb
CHANGED
@@ -46,7 +46,11 @@ module Puma
|
|
46
46
|
env[HIJACK_P] = true
|
47
47
|
env[HIJACK] = client
|
48
48
|
|
49
|
-
|
49
|
+
body = client.body
|
50
|
+
|
51
|
+
head = env[REQUEST_METHOD] == HEAD
|
52
|
+
|
53
|
+
env[RACK_INPUT] = body
|
50
54
|
env[RACK_URL_SCHEME] ||= default_server_port(env) == PORT_443 ? HTTPS : HTTP
|
51
55
|
|
52
56
|
if @early_hints
|
@@ -65,58 +69,36 @@ module Puma
|
|
65
69
|
# A rack extension. If the app writes #call'ables to this
|
66
70
|
# array, we will invoke them when the request is done.
|
67
71
|
#
|
68
|
-
env[RACK_AFTER_REPLY] = []
|
72
|
+
after_reply = env[RACK_AFTER_REPLY] = []
|
69
73
|
|
70
74
|
begin
|
71
|
-
|
72
|
-
@
|
73
|
-
|
74
|
-
|
75
|
-
return :async if client.hijacked
|
76
|
-
|
77
|
-
status = status.to_i
|
78
|
-
|
79
|
-
if status == -1
|
80
|
-
unless headers.empty? and res_body == []
|
81
|
-
raise "async response must have empty headers and body"
|
75
|
+
begin
|
76
|
+
status, headers, res_body = @thread_pool.with_force_shutdown do
|
77
|
+
@app.call(env)
|
82
78
|
end
|
83
79
|
|
84
|
-
return :async
|
85
|
-
end
|
86
|
-
rescue ThreadPool::ForceShutdown => e
|
87
|
-
@events.unknown_error e, client, "Rack app"
|
88
|
-
@events.log "Detected force shutdown of a thread"
|
89
|
-
|
90
|
-
status, headers, res_body = lowlevel_error(e, env, 503)
|
91
|
-
rescue Exception => e
|
92
|
-
@events.unknown_error e, client, "Rack app"
|
80
|
+
return :async if client.hijacked
|
93
81
|
|
94
|
-
|
95
|
-
end
|
82
|
+
status = status.to_i
|
96
83
|
|
97
|
-
|
98
|
-
|
84
|
+
if status == -1
|
85
|
+
unless headers.empty? and res_body == []
|
86
|
+
raise "async response must have empty headers and body"
|
87
|
+
end
|
99
88
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
# @param lines [Puma::IOBuffer] modified in place
|
106
|
-
# @param requests [Integer] number of inline requests handled
|
107
|
-
# @param client [Puma::Client]
|
108
|
-
# @return [Boolean,:async]
|
109
|
-
def write_response(status, headers, res_body, lines, requests, client)
|
110
|
-
env = client.env
|
111
|
-
io = client.io
|
89
|
+
return :async
|
90
|
+
end
|
91
|
+
rescue ThreadPool::ForceShutdown => e
|
92
|
+
@events.unknown_error e, client, "Rack app"
|
93
|
+
@events.log "Detected force shutdown of a thread"
|
112
94
|
|
113
|
-
|
114
|
-
|
95
|
+
status, headers, res_body = lowlevel_error(e, env, 503)
|
96
|
+
rescue Exception => e
|
97
|
+
@events.unknown_error e, client, "Rack app"
|
115
98
|
|
116
|
-
|
117
|
-
|
99
|
+
status, headers, res_body = lowlevel_error(e, env, 500)
|
100
|
+
end
|
118
101
|
|
119
|
-
begin
|
120
102
|
res_info = {}
|
121
103
|
res_info[:content_length] = nil
|
122
104
|
res_info[:no_body] = head
|
@@ -167,9 +149,9 @@ module Puma
|
|
167
149
|
res_body.each do |part|
|
168
150
|
next if part.bytesize.zero?
|
169
151
|
if chunked
|
170
|
-
|
171
|
-
|
172
|
-
|
152
|
+
fast_write io, (part.bytesize.to_s(16) << line_ending)
|
153
|
+
fast_write io, part # part may have different encoding
|
154
|
+
fast_write io, line_ending
|
173
155
|
else
|
174
156
|
fast_write io, part
|
175
157
|
end
|
@@ -187,7 +169,7 @@ module Puma
|
|
187
169
|
ensure
|
188
170
|
uncork_socket io
|
189
171
|
|
190
|
-
|
172
|
+
body.close
|
191
173
|
client.tempfile.unlink if client.tempfile
|
192
174
|
res_body.close if res_body.respond_to? :close
|
193
175
|
|
data/lib/puma/server.rb
CHANGED
@@ -476,7 +476,7 @@ module Puma
|
|
476
476
|
end
|
477
477
|
true
|
478
478
|
rescue StandardError => e
|
479
|
-
client_error(e, client
|
479
|
+
client_error(e, client)
|
480
480
|
# The ensure tries to close +client+ down
|
481
481
|
requests > 0
|
482
482
|
ensure
|
@@ -504,36 +504,34 @@ module Puma
|
|
504
504
|
# :nocov:
|
505
505
|
|
506
506
|
# Handle various error types thrown by Client I/O operations.
|
507
|
-
def client_error(e, client
|
507
|
+
def client_error(e, client)
|
508
508
|
# Swallow, do not log
|
509
509
|
return if [ConnectionError, EOFError].include?(e.class)
|
510
510
|
|
511
|
+
lowlevel_error(e, client.env)
|
511
512
|
case e
|
512
513
|
when MiniSSL::SSLError
|
513
514
|
@events.ssl_error e, client.io
|
514
515
|
when HttpParserError
|
515
|
-
|
516
|
-
write_response(status, headers, res_body, buffer, requests, client)
|
516
|
+
client.write_error(400)
|
517
517
|
@events.parse_error e, client
|
518
518
|
else
|
519
|
-
|
520
|
-
write_response(status, headers, res_body, buffer, requests, client)
|
519
|
+
client.write_error(500)
|
521
520
|
@events.unknown_error e, nil, "Read"
|
522
521
|
end
|
523
522
|
end
|
524
523
|
|
525
524
|
# A fallback rack response if +@app+ raises as exception.
|
526
525
|
#
|
527
|
-
def lowlevel_error(e, env, status
|
526
|
+
def lowlevel_error(e, env, status=500)
|
528
527
|
if handler = @options[:lowlevel_error_handler]
|
529
528
|
if handler.arity == 1
|
530
|
-
|
529
|
+
return handler.call(e)
|
531
530
|
elsif handler.arity == 2
|
532
|
-
|
531
|
+
return handler.call(e, env)
|
533
532
|
else
|
534
|
-
|
533
|
+
return handler.call(e, env, status)
|
535
534
|
end
|
536
|
-
return [handler_status || status, headers || {}, res_body || []]
|
537
535
|
end
|
538
536
|
|
539
537
|
if @leak_stack_on_error
|