hayabusa 0.0.22 → 0.0.23

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.22
1
+ 0.0.23
data/hayabusa.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "hayabusa"
8
- s.version = "0.0.22"
8
+ s.version = "0.0.23"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kasper Johansen"]
12
- s.date = "2013-06-28"
12
+ s.date = "2013-06-30"
13
13
  s.description = "A threadded web/app-server that focuses on threadding, shared ressources, speed and more."
14
14
  s.email = "k@spernj.org"
15
15
  s.executables = ["check_running.rb", "hayabusa_benchmark.rb", "hayabusa_cgi.rb", "hayabusa_fcgi.fcgi", "hayabusa_fcgi.rb", "hayabusa_fcgi_server.rb", "hayabusa_spec_restart.rb", "knjappserver_start.rb"]
@@ -84,9 +84,11 @@ Gem::Specification.new do |s|
84
84
  "pages/debug_http_sessions.rhtml",
85
85
  "pages/debug_memory_usage.rhtml",
86
86
  "pages/error_notfound.rhtml",
87
+ "pages/image.png",
87
88
  "pages/logs_latest.rhtml",
88
89
  "pages/logs_show.rhtml",
89
90
  "pages/spec.rhtml",
91
+ "pages/spec_exit.rhtml",
90
92
  "pages/spec_multiple_threads.rhtml",
91
93
  "pages/spec_sleeper.rhtml",
92
94
  "pages/spec_test_multiple_clients.rhtml",
@@ -148,21 +148,17 @@ class Hayabusa::Http_session::Response
148
148
  @cgroup.content_length = nil
149
149
  end
150
150
 
151
- if @status == 304
152
- #do nothing.
153
- else
154
- if @chunked
155
- @cgroup.write_to_socket
156
- @socket.write("0#{NL}")
157
-
158
- @headers_trailing.each do |header_id_str, header|
159
- @socket.write("#{header[0]}: #{header[1]}#{NL}")
160
- end
161
-
162
- @socket.write(NL)
163
- else
164
- @cgroup.write_to_socket
151
+ if @chunked
152
+ @cgroup.write_to_socket
153
+ @socket.write("0#{NL}")
154
+
155
+ @headers_trailing.each do |header_id_str, header|
156
+ @socket.write("#{header[0]}: #{header[1]}#{NL}")
165
157
  end
158
+
159
+ @socket.write(NL)
160
+ else
161
+ @cgroup.write_to_socket
166
162
  end
167
163
 
168
164
  # Validate that no more has been written than given in content-length, since that will corrupt the client.
data/pages/image.png ADDED
Binary file
@@ -0,0 +1,5 @@
1
+ <%
2
+ _httpsession.resp.status = 304
3
+ puts "ExitOutput"
4
+ exit
5
+ %>
@@ -98,8 +98,13 @@ describe "Hayabusa" do
98
98
  File.symlink(img_from_path, img_to_path)
99
99
 
100
100
  begin
101
+ http = $testmodes.first[:http]
102
+ res = http.get("image.rhtml?path64=#{Base64.encode64("image.png").to_s.strip}&rounded_corners=8&width=550")
103
+ res.contenttype.should eql("image/png")
104
+ res.header?("content-length").should eql(true)
105
+
101
106
  $testmodes.each do |tdata|
102
- 5.times do
107
+ 3.times do
103
108
  path = "#{File.dirname(__FILE__)}/../pages/testpic.jpeg"
104
109
 
105
110
  res = tdata[:http].get("#{tdata[:path_pre]}testpic.jpeg")
@@ -107,7 +112,22 @@ describe "Hayabusa" do
107
112
 
108
113
  res.body.bytes.to_a.should eql(File.read(path).bytes.to_a)
109
114
 
115
+ #puts "Getting forced image through #{tdata[:name]}"
110
116
  res = tdata[:http].get("#{tdata[:path_pre]}image.rhtml?force=true&path64=#{Base64.encode64("testpic.jpeg").to_s.strip}")
117
+
118
+ #puts "Getting normal image through #{tdata[:name]}"
119
+ res1 = tdata[:http].get("#{tdata[:path_pre]}image.rhtml?path64=#{Base64.encode64("image.png").to_s.strip}&rounded_corners=8&width=550")
120
+ res1.contenttype.should eql("image/png")
121
+
122
+ #puts "Getting exit-script through #{tdata[:name]}"
123
+ res_exit = tdata[:http].get("#{tdata[:path_pre]}spec_exit.rhtml")
124
+ res_exit.body.should eql("ExitOutput\n")
125
+
126
+ #puts "Getting normal image through #{tdata[:name]}"
127
+ res2 = tdata[:http].get("#{tdata[:path_pre]}image.rhtml?path64=#{Base64.encode64("image.png").to_s.strip}&rounded_corners=8&width=550")
128
+ res2.contenttype.should eql("image/png")
129
+
130
+ res1.body.bytesize.should eql(res2.body.bytesize)
111
131
  end
112
132
  end
113
133
  ensure
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hayabusa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.23
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-28 00:00:00.000000000 Z
12
+ date: 2013-06-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: knjrbfw
@@ -318,9 +318,11 @@ files:
318
318
  - pages/debug_http_sessions.rhtml
319
319
  - pages/debug_memory_usage.rhtml
320
320
  - pages/error_notfound.rhtml
321
+ - pages/image.png
321
322
  - pages/logs_latest.rhtml
322
323
  - pages/logs_show.rhtml
323
324
  - pages/spec.rhtml
325
+ - pages/spec_exit.rhtml
324
326
  - pages/spec_multiple_threads.rhtml
325
327
  - pages/spec_sleeper.rhtml
326
328
  - pages/spec_test_multiple_clients.rhtml
@@ -352,7 +354,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
352
354
  version: '0'
353
355
  segments:
354
356
  - 0
355
- hash: 4203364333015306411
357
+ hash: 4394094248699079700
356
358
  required_rubygems_version: !ruby/object:Gem::Requirement
357
359
  none: false
358
360
  requirements: