webroar 0.2.5 → 0.2.6
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.
- data/CHANGELOG +34 -0
- data/lib/dependencies.rb +9 -7
- data/lib/installer.rb +46 -18
- data/src/admin_panel/app/controllers/graph_controller.rb +2 -2
- data/src/admin_panel/app/views/graph/_javascript_partial.html.erb +1 -0
- data/src/admin_panel/lib/yaml_writer.rb +1 -1
- data/src/head/wr_application.c +2 -3
- data/src/head/wr_application.h +2 -2
- data/src/head/wr_config.h +2 -1
- data/src/head/wr_configurator.c +3 -10
- data/src/head/wr_connection.c +11 -10
- data/src/head/wr_controller.c +2 -6
- data/src/head/wr_main.c +2 -2
- data/src/head/wr_request.c +2 -5
- data/src/head/wr_resolver.c +2 -2
- data/src/head/wr_server.c +0 -2
- data/src/head/wr_worker.c +0 -4
- data/src/helper/wr_logger.c +5 -8
- data/src/helper/wr_logger.h +2 -2
- data/src/helper/wr_yaml_parser.c +1 -1
- data/src/ruby_lib/ruby_interface/client.rb +9 -2
- data/src/ruby_lib/ruby_interface/constants.rb +1 -0
- data/src/ruby_lib/ruby_interface/deflater.rb +28 -91
- data/src/ruby_lib/ruby_interface/logger.rb +3 -3
- data/src/ruby_lib/ruby_interface/request_handler.rb +23 -8
- data/src/ruby_lib/ruby_interface/utils.rb +17 -6
- data/src/ruby_lib/ruby_interface/version.rb +1 -1
- data/src/ruby_lib/webroar_app_loader.rb +2 -2
- data/src/worker/wkr_http.c +6 -6
- data/src/worker/wkr_http_response.c +8 -5
- data/src/worker/wkr_main.c +3 -3
- data/src/worker/wkr_static.c +5 -8
- data/src/worker/wkr_static.h +1 -1
- data/test/spec/content_encoding_spec.rb +14 -0
- metadata +2 -24
- data/src/admin_panel/public/blank_iframe.html +0 -2
- data/src/admin_panel/public/images/calendar_date_select/calendar.gif +0 -0
- data/src/admin_panel/public/javascripts/calendar_date_select/calendar_date_select.js +0 -443
- data/src/admin_panel/public/javascripts/calendar_date_select/format_american.js +0 -34
- data/src/admin_panel/public/javascripts/calendar_date_select/format_db.js +0 -27
- data/src/admin_panel/public/javascripts/calendar_date_select/format_euro_24hr.js +0 -7
- data/src/admin_panel/public/javascripts/calendar_date_select/format_euro_24hr_ymd.js +0 -7
- data/src/admin_panel/public/javascripts/calendar_date_select/format_finnish.js +0 -32
- data/src/admin_panel/public/javascripts/calendar_date_select/format_hyphen_ampm.js +0 -37
- data/src/admin_panel/public/javascripts/calendar_date_select/format_iso_date.js +0 -46
- data/src/admin_panel/public/javascripts/calendar_date_select/format_italian.js +0 -24
- data/src/admin_panel/public/javascripts/calendar_date_select/locale/de.js +0 -11
- data/src/admin_panel/public/javascripts/calendar_date_select/locale/fi.js +0 -10
- data/src/admin_panel/public/javascripts/calendar_date_select/locale/fr.js +0 -10
- data/src/admin_panel/public/javascripts/calendar_date_select/locale/pl.js +0 -10
- data/src/admin_panel/public/javascripts/calendar_date_select/locale/pt.js +0 -11
- data/src/admin_panel/public/javascripts/calendar_date_select/locale/ru.js +0 -10
- data/src/admin_panel/public/stylesheets/calendar_date_select/blue.css +0 -130
- data/src/admin_panel/public/stylesheets/calendar_date_select/default.css +0 -135
- data/src/admin_panel/public/stylesheets/calendar_date_select/plain.css +0 -128
- data/src/admin_panel/public/stylesheets/calendar_date_select/red.css +0 -135
- data/src/admin_panel/public/stylesheets/calendar_date_select/silver.css +0 -133
@@ -1,109 +1,46 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
#
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
# WebROaR - Ruby Application Server - http://webroar.in/
|
2
|
+
# Copyright (C) 2009 Goonj LLC
|
3
|
+
#
|
4
|
+
# This file is part of WebROaR.
|
5
|
+
#
|
6
|
+
# WebROaR is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# WebROaR is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with WebROaR. If not, see <http://www.gnu.org/licenses/>.
|
7
18
|
|
8
|
-
|
19
|
+
require 'rubygems'
|
20
|
+
require 'rack'
|
21
|
+
|
22
|
+
module Webroar
|
23
|
+
|
24
|
+
class Deflater < Rack::Deflater
|
9
25
|
|
10
|
-
class Deflater
|
11
26
|
def initialize(app)
|
12
27
|
@app = app
|
28
|
+
super
|
13
29
|
end
|
14
30
|
|
15
31
|
def call(env)
|
16
|
-
status, headers, body = @app.call(env)
|
17
|
-
|
18
|
-
# Skip compressing empty entity body responses and responses with
|
19
|
-
# no-transform set.
|
20
|
-
if ::Rack::Utils::STATUS_WITH_NO_ENTITY_BODY.include?(status) ||
|
21
|
-
headers['Cache-Control'].to_s =~ /\bno-transform\b/
|
22
|
-
return [status, headers, body]
|
23
|
-
end
|
24
|
-
|
25
|
-
# Skip compressing entity body responses if already compressed.
|
26
|
-
if headers.has_key?(Content_Encoding)
|
27
|
-
return [status, headers, body]
|
28
|
-
end
|
29
|
-
|
30
32
|
# Skip compressing entity body if user agent is IE6
|
31
33
|
# refer http://schroepl.net/projekte/mod_gzip/browser.htm and
|
32
34
|
# http://support.microsoft.com/default.aspx?scid=kb;en-us;Q313712
|
33
35
|
# for problem details
|
34
36
|
#
|
35
37
|
if env['HTTP_USER_AGENT'] =~ /MSIE 6.0/
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
encoding = ::Rack::Utils.select_best_encoding(%w(gzip deflate identity),
|
42
|
-
request.accept_encoding)
|
43
|
-
|
44
|
-
# Set the Vary HTTP header.
|
45
|
-
vary = headers["Vary"].to_s.split(",").map { |v| v.strip }
|
46
|
-
unless vary.include?("*") || vary.include?("Accept-Encoding")
|
47
|
-
headers["Vary"] = vary.push("Accept-Encoding").join(",")
|
48
|
-
end
|
49
|
-
|
50
|
-
case encoding
|
51
|
-
when "gzip"
|
52
|
-
mtime = if headers.has_key?("Last-Modified")
|
53
|
-
Time.httpdate(headers["Last-Modified"])
|
54
|
-
else
|
55
|
-
Time.now
|
56
|
-
end
|
57
|
-
body = self.class.gzip(body, mtime)
|
58
|
-
# Here changing the content length
|
59
|
-
headers[Content_Length] = Webroar::Utils.calculate_content_length(body)
|
60
|
-
[status,
|
61
|
-
headers.merge("Content-Encoding" => "gzip"),
|
62
|
-
body]
|
63
|
-
when "deflate"
|
64
|
-
body = self.class.deflate(body)
|
65
|
-
# Here changing content length
|
66
|
-
headers[Content_Length] = Webroar::Utils.calculate_content_length(body)
|
67
|
-
[status,
|
68
|
-
headers.merge("Content-Encoding" => "deflate"),
|
69
|
-
body]
|
70
|
-
when "identity"
|
71
|
-
[status, headers, body]
|
72
|
-
when nil
|
73
|
-
# Requested encoding not fouud, returning plain response.
|
74
|
-
[status, headers, body]
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
def self.gzip(body, mtime)
|
79
|
-
io = StringIO.new
|
80
|
-
gzip = Zlib::GzipWriter.new(io)
|
81
|
-
gzip.mtime = mtime
|
82
|
-
|
83
|
-
# TODO: Add streaming
|
84
|
-
body.each { |part| gzip << part }
|
85
|
-
|
86
|
-
gzip.close
|
87
|
-
return io.string
|
38
|
+
@app.call(env)
|
39
|
+
else
|
40
|
+
super
|
41
|
+
end
|
88
42
|
end
|
89
43
|
|
90
|
-
DEFLATE_ARGS = [
|
91
|
-
Zlib::DEFAULT_COMPRESSION,
|
92
|
-
# drop the zlib header which causes both Safari and IE to choke
|
93
|
-
-Zlib::MAX_WBITS,
|
94
|
-
Zlib::DEF_MEM_LEVEL,
|
95
|
-
Zlib::DEFAULT_STRATEGY
|
96
|
-
]
|
97
|
-
|
98
|
-
# Loosely based on Mongrel's Deflate handler
|
99
|
-
def self.deflate(body)
|
100
|
-
deflater = Zlib::Deflate.new(*DEFLATE_ARGS)
|
101
|
-
|
102
|
-
# TODO: Add streaming
|
103
|
-
body.each { |part| deflater << part }
|
104
|
-
|
105
|
-
return deflater.finish
|
106
|
-
end
|
107
44
|
end
|
108
45
|
|
109
46
|
end
|
@@ -19,15 +19,15 @@
|
|
19
19
|
module Webroar
|
20
20
|
|
21
21
|
def self.log_info(message)
|
22
|
-
Webroar::
|
22
|
+
Webroar::log_message( "Info", 5, message)
|
23
23
|
end
|
24
24
|
|
25
25
|
def self.log_error(message, level = 4)
|
26
|
-
Webroar::
|
26
|
+
Webroar::log_message( "Error", level, message)
|
27
27
|
end
|
28
28
|
|
29
29
|
def self.log_debug(message)
|
30
|
-
Webroar::
|
30
|
+
Webroar::log_message( "Debug", 1, message)
|
31
31
|
end
|
32
32
|
|
33
33
|
end
|
@@ -27,7 +27,7 @@ module Webroar
|
|
27
27
|
return false if headers.has_key?(Content_Length)
|
28
28
|
return false if (100..199).include?(status) || status == 204 || status == 304
|
29
29
|
return false if headers.has_key?(Transfer_Encoding) && headers[Transfer_Encoding] =~ /\bchunked\b/i
|
30
|
-
return false unless body.kind_of?(String) || body.
|
30
|
+
return false unless body.kind_of?(String) || body.respond_to?(:each)
|
31
31
|
true
|
32
32
|
end
|
33
33
|
|
@@ -35,12 +35,20 @@ module Webroar
|
|
35
35
|
begin
|
36
36
|
app = $app
|
37
37
|
status, headers, body = app.call(client.env)
|
38
|
-
rescue
|
39
|
-
|
38
|
+
rescue Exception => e
|
39
|
+
error = e.class.to_s + '-' + e.to_s + "\n" + e.backtrace.join("\n").to_s
|
40
|
+
Webroar.log_error(error)
|
40
41
|
status = 500
|
41
|
-
headers = {Content_Type =>
|
42
|
-
body =
|
43
|
-
|
42
|
+
headers = {Content_Type => 'text/html'}
|
43
|
+
body = "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r\n\
|
44
|
+
<html><head>\r\n\
|
45
|
+
<title>Internal Server Error</title>\r\n\
|
46
|
+
</head><body>\r\n\
|
47
|
+
<h1>Internal Server Error</h1>\r\n\
|
48
|
+
<p>The server encountered an unexpected condition which prevented it from fulfilling the request.</p>\r\n\
|
49
|
+
<br><br><hr>#{SERVER}\
|
50
|
+
</body></html>"
|
51
|
+
|
44
52
|
end # begin
|
45
53
|
|
46
54
|
status = status.to_i
|
@@ -49,7 +57,8 @@ module Webroar
|
|
49
57
|
headers[Content_Length] = "0"
|
50
58
|
else
|
51
59
|
# Content-Length header checking and calculation according to Thin
|
52
|
-
|
60
|
+
# if body responding to 'each', accumulating body content into an Array
|
61
|
+
headers[Content_Length], actual_content = Webroar::Utils.calculate_content_length(body) if need_content_length?([status,headers,body])
|
53
62
|
end
|
54
63
|
|
55
64
|
if !client.keep_alive?
|
@@ -65,10 +74,16 @@ module Webroar
|
|
65
74
|
client.write_headers(headers, status, content_length)
|
66
75
|
|
67
76
|
if(content_length > 0)
|
68
|
-
|
77
|
+
if actual_content
|
78
|
+
client.write_body(actual_content)
|
79
|
+
else
|
80
|
+
client.write_body(body)
|
81
|
+
end
|
69
82
|
end
|
83
|
+
body.close if body.respond_to?(:close)
|
70
84
|
rescue => e
|
71
85
|
Webroar.log_error("WebROaR Error! #{e.class} #{e.message}\n #{e.backtrace.join("\n")}")
|
86
|
+
body.close if body.respond_to?(:close)
|
72
87
|
return
|
73
88
|
ensure
|
74
89
|
end # self.process
|
@@ -20,16 +20,27 @@ module Webroar
|
|
20
20
|
class Utils
|
21
21
|
class << self
|
22
22
|
def calculate_content_length(body)
|
23
|
-
|
24
|
-
|
23
|
+
if body.respond_to?(:to_path)
|
24
|
+
#TODO: Some files(e.g. /proc) doesn't provide size info. We may have to figure out
|
25
|
+
# by reading entire content.
|
26
|
+
if filesize = File.size?(body.to_path)
|
27
|
+
filesize.to_s
|
28
|
+
else
|
29
|
+
"0"
|
30
|
+
end
|
31
|
+
elsif body.kind_of?(String)
|
25
32
|
# See http://redmine.ruby-lang.org/issues/show/203
|
26
|
-
|
27
|
-
|
28
|
-
|
33
|
+
(body.respond_to?(:bytesize) ? body.bytesize : body.size).to_s
|
34
|
+
else
|
35
|
+
# TODO: Yup, this is a ugly hack, accumulating body content at wrong place - only for little performance
|
36
|
+
# and DRYing up the things.
|
37
|
+
bytes = 0
|
38
|
+
body_content = []
|
29
39
|
body.each do |p|
|
30
40
|
bytes += p.respond_to?(:bytesize) ? p.bytesize : p.size
|
41
|
+
body_content << p
|
31
42
|
end
|
32
|
-
bytes.to_s
|
43
|
+
[bytes.to_s, body_content]
|
33
44
|
end
|
34
45
|
end
|
35
46
|
end
|
@@ -79,7 +79,7 @@ begin
|
|
79
79
|
end #Webroar
|
80
80
|
Webroar.log_info("Application loaded successfully")
|
81
81
|
rescue Exception => e
|
82
|
-
error = e.to_s + "\n" + e.backtrace.join("\n").to_s
|
83
|
-
Webroar
|
82
|
+
error = e.class.to_s + '-' + e.to_s + "\n" + e.backtrace.join("\n").to_s
|
83
|
+
Webroar::log_message( "Error", 5, error)
|
84
84
|
raise
|
85
85
|
end
|
data/src/worker/wkr_http.c
CHANGED
@@ -146,9 +146,9 @@ VALUE req_env(VALUE _, VALUE rb_req) {
|
|
146
146
|
return hash;
|
147
147
|
}
|
148
148
|
|
149
|
-
/** Logging 'Ruby'
|
150
|
-
VALUE
|
151
|
-
a_log(StringValuePtr(message_type), FIX2INT(severity), StringValuePtr(
|
149
|
+
/** Logging 'Ruby' message */
|
150
|
+
VALUE log_message(VALUE _, VALUE message_type, VALUE severity, VALUE message) {
|
151
|
+
a_log(StringValuePtr(message_type), FIX2INT(severity), StringValuePtr(message));
|
152
152
|
return Qnil;
|
153
153
|
}
|
154
154
|
|
@@ -168,7 +168,7 @@ void init_ruby_interface(http_t *h) {
|
|
168
168
|
mObj = rb_define_module("Webroar");
|
169
169
|
cReq = rb_define_class_under(mObj, "Client", rb_cObject);
|
170
170
|
cRequestHandler = rb_define_class_under(mObj, "RequestHandler", rb_cObject);
|
171
|
-
rb_define_singleton_method(mObj, "
|
171
|
+
rb_define_singleton_method(mObj, "log_message", log_message, 3);
|
172
172
|
rb_define_singleton_method(mObj, "read_request", read_request, 2);
|
173
173
|
rb_define_singleton_method(mObj, "client_env", req_env, 1);
|
174
174
|
rb_define_singleton_method(mObj, "client_write_headers", req_write_headers, 4);
|
@@ -234,8 +234,8 @@ err:
|
|
234
234
|
int load_rack_adapter(wkr_tmp_t *tmp) {
|
235
235
|
LOG_FUNCTION
|
236
236
|
|
237
|
-
int state = 0
|
238
|
-
|
237
|
+
int state = 0;
|
238
|
+
|
239
239
|
LOG_DEBUG(DEBUG,"load_rack_adapter() Application path is = %s",tmp->path.str);
|
240
240
|
// TODO: Keys are being setup as strings. Doesn't allow standard symbol based access in ruby script.
|
241
241
|
VALUE g_options=rb_hash_new();
|
@@ -34,7 +34,11 @@ http_resp_t* http_resp_new() {
|
|
34
34
|
rsp->bytes_write = 0;
|
35
35
|
rsp->resp_code = 0;
|
36
36
|
rsp->scgi = NULL;
|
37
|
+
#ifdef _POSIX_C_SOURCE
|
38
|
+
rsp->file = 0;
|
39
|
+
#else
|
37
40
|
rsp->file = NULL;
|
41
|
+
#endif
|
38
42
|
|
39
43
|
return rsp;
|
40
44
|
}
|
@@ -112,14 +116,14 @@ int http_resp_process(http_resp_t *rsp) {
|
|
112
116
|
void http_resp_file_write_cb(struct ev_loop* loop, struct ev_io* watcher, int revent) {
|
113
117
|
LOG_FUNCTION
|
114
118
|
wkr_t *w = (wkr_t*) watcher->data;
|
115
|
-
http_resp_t *rsp = w->http->resp;
|
116
|
-
|
117
|
-
ssize_t sent;
|
118
119
|
|
119
120
|
LOG_DEBUG(DEBUG, "http_resp_file_write_cb() conn id=%d, Request id=%d",
|
120
121
|
w->http->conn_id, w->http->req_id);
|
121
122
|
|
122
123
|
if (revent & EV_WRITE) {
|
124
|
+
#ifndef _POSIX_C_SOURCE
|
125
|
+
http_resp_t *rsp = w->http->resp;
|
126
|
+
ssize_t sent;
|
123
127
|
|
124
128
|
if (rsp->file) {
|
125
129
|
char buffer[WR_REQ_BODY_MAX_SIZE];
|
@@ -153,6 +157,7 @@ void http_resp_file_write_cb(struct ev_loop* loop, struct ev_io* watcher, int re
|
|
153
157
|
ev_io_init(watcher, http_req_header_cb, w->req_fd, EV_READ);
|
154
158
|
ev_io_start(loop, watcher);
|
155
159
|
}
|
160
|
+
#endif
|
156
161
|
}
|
157
162
|
}
|
158
163
|
|
@@ -292,8 +297,6 @@ void http_resp_scgi_write_cb(struct ev_loop* loop, struct ev_io* watcher, int re
|
|
292
297
|
wkr_t *w = (wkr_t*) watcher->data;
|
293
298
|
http_resp_t *rsp = w->http->resp;
|
294
299
|
|
295
|
-
ssize_t sent;
|
296
|
-
|
297
300
|
LOG_DEBUG(DEBUG, "http_resp_scgi_write_cb() conn id=%d, Request id=%d",
|
298
301
|
w->http->conn_id, w->http->req_id);
|
299
302
|
|
data/src/worker/wkr_main.c
CHANGED
@@ -222,7 +222,7 @@ static inline wkr_tmp_t* parse_args(int argc, char **argv) {
|
|
222
222
|
}
|
223
223
|
|
224
224
|
if(tmp->log_file.str){
|
225
|
-
initialize_logger(tmp->log_file.str);
|
225
|
+
initialize_logger(tmp->log_file.str, WR_SERVER, WR_VERSION);
|
226
226
|
redirect_standard_io();
|
227
227
|
#ifdef L_DEBUG
|
228
228
|
set_log_severity(DEBUG);
|
@@ -281,7 +281,7 @@ void idle_cb (struct ev_loop *loop, struct ev_idle *w, int revents) {
|
|
281
281
|
}
|
282
282
|
|
283
283
|
int main(int argc, char **argv) {
|
284
|
-
int
|
284
|
+
int retval = 0;
|
285
285
|
wkr_t* w = NULL;
|
286
286
|
|
287
287
|
if(argc == 1) {
|
@@ -340,7 +340,7 @@ int main(int argc, char **argv) {
|
|
340
340
|
signal(SIGHUP, sigproc); /* catch hangup signal */
|
341
341
|
signal(SIGINT, sigproc);
|
342
342
|
signal(SIGTERM, sigproc);
|
343
|
-
signal(SIGCHLD, SIG_IGN);
|
343
|
+
// signal(SIGCHLD, SIG_IGN);
|
344
344
|
signal(SIGTSTP, SIG_IGN);
|
345
345
|
signal(SIGTTOU, SIG_IGN);
|
346
346
|
signal(SIGTTIN, SIG_IGN);
|
data/src/worker/wkr_static.c
CHANGED
@@ -218,11 +218,11 @@ static long int get_default_expires(node_t *root) {
|
|
218
218
|
static int create_dictionary(const char *mapping_file, long int expires) {
|
219
219
|
node_t *root = yaml_parse(mapping_file), *node;
|
220
220
|
static_file_t *ext;
|
221
|
-
int index
|
221
|
+
int index;
|
222
222
|
|
223
223
|
// Initialize map with NULL value
|
224
|
-
for (
|
225
|
-
map[
|
224
|
+
for (index = 0; index < MAP_SIZE; index++) {
|
225
|
+
map[index] = NULL;
|
226
226
|
}
|
227
227
|
|
228
228
|
if (root == NULL) {
|
@@ -345,7 +345,6 @@ void http_resp_304(http_t *h, const char *path, struct stat *buf) {
|
|
345
345
|
void http_resp_403(http_t *h, const char *path, struct stat *buf) {
|
346
346
|
LOG_FUNCTION
|
347
347
|
char str[WR_LONG_LONG_STR_LEN], current_date[WR_STR_LEN];
|
348
|
-
time_t t;
|
349
348
|
const char *conn_header = scgi_header_value_get(h->req->scgi, HTTP_HEADER_CONNECTION);
|
350
349
|
int len;
|
351
350
|
|
@@ -367,7 +366,6 @@ void http_resp_403(http_t *h, const char *path, struct stat *buf) {
|
|
367
366
|
void http_resp_404(http_t *h, const char *path, struct stat *buf) {
|
368
367
|
LOG_FUNCTION
|
369
368
|
char str[WR_LONG_LONG_STR_LEN], current_date[WR_STR_LEN];
|
370
|
-
time_t t;
|
371
369
|
const char *conn_header = scgi_header_value_get(h->req->scgi, HTTP_HEADER_CONNECTION);
|
372
370
|
int len;
|
373
371
|
|
@@ -395,7 +393,7 @@ void send_static_worker_pid(char *root_path) {
|
|
395
393
|
root = yaml_parse(file_name);
|
396
394
|
if(root == NULL) {
|
397
395
|
LOG_ERROR(SEVERE, "Could not parse server_internal_config.yml file. PID can not be sent to analyzer");
|
398
|
-
return
|
396
|
+
return;
|
399
397
|
} else {
|
400
398
|
char *host = NULL, *port = NULL, *queue_name = NULL;
|
401
399
|
wr_msg_queue_server_t *msg_queue_server = NULL;
|
@@ -448,7 +446,6 @@ err:
|
|
448
446
|
int static_module_init(char *root_path) {
|
449
447
|
LOG_FUNCTION
|
450
448
|
node_t *root;
|
451
|
-
char *node_value;
|
452
449
|
char file_name[100];
|
453
450
|
long int expires;
|
454
451
|
|
@@ -491,7 +488,7 @@ void static_module_free() {
|
|
491
488
|
}
|
492
489
|
|
493
490
|
/* Serve static file content */
|
494
|
-
|
491
|
+
void static_file_process(http_t *h) {
|
495
492
|
LOG_FUNCTION
|
496
493
|
wkr_t *w = h->wkr;
|
497
494
|
short resp_code;
|
data/src/worker/wkr_static.h
CHANGED
@@ -49,4 +49,18 @@ describe 'Content-Encoding' do
|
|
49
49
|
body.should =~ /ok/
|
50
50
|
end
|
51
51
|
|
52
|
+
it "should return plain text when asked for deflate encoded content and User-Agent is MSIE 6.0" do
|
53
|
+
request = "GET /test_app/test/content_encoding HTTP/1.1\r\nHost: localhost\r\nAccept-Encoding: deflate\r\nUser-Agent: MSIE 6.0\r\n\r\n"
|
54
|
+
@conn.write request
|
55
|
+
status, headers, body = parse_response @conn.read
|
56
|
+
body.should =~ /ok/
|
57
|
+
end
|
58
|
+
|
59
|
+
it "should return plain text when asked for gzip encoded content and User-Agent is MSIE 6.0" do
|
60
|
+
request = "GET /test_app/test/content_encoding HTTP/1.1\r\nHost: localhost\r\nAccept-Encoding: gzip\r\nUser-Agent: MSIE 6.0\r\n\r\n"
|
61
|
+
@conn.write request
|
62
|
+
status, headers, body = parse_response @conn.read
|
63
|
+
body.should =~ /ok/
|
64
|
+
end
|
65
|
+
|
52
66
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webroar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aditya Babbar
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2009-12-
|
14
|
+
date: 2009-12-23 00:00:00 +05:30
|
15
15
|
default_executable:
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
@@ -190,21 +190,6 @@ files:
|
|
190
190
|
- src/admin_panel/public/javascripts/builder.js
|
191
191
|
- src/admin_panel/public/javascripts/ui.slider_old.js
|
192
192
|
- src/admin_panel/public/javascripts/jquery-1.3.2.js
|
193
|
-
- src/admin_panel/public/javascripts/calendar_date_select/format_euro_24hr.js
|
194
|
-
- src/admin_panel/public/javascripts/calendar_date_select/format_american.js
|
195
|
-
- src/admin_panel/public/javascripts/calendar_date_select/format_euro_24hr_ymd.js
|
196
|
-
- src/admin_panel/public/javascripts/calendar_date_select/format_iso_date.js
|
197
|
-
- src/admin_panel/public/javascripts/calendar_date_select/calendar_date_select.js
|
198
|
-
- src/admin_panel/public/javascripts/calendar_date_select/format_finnish.js
|
199
|
-
- src/admin_panel/public/javascripts/calendar_date_select/locale/fi.js
|
200
|
-
- src/admin_panel/public/javascripts/calendar_date_select/locale/pl.js
|
201
|
-
- src/admin_panel/public/javascripts/calendar_date_select/locale/de.js
|
202
|
-
- src/admin_panel/public/javascripts/calendar_date_select/locale/ru.js
|
203
|
-
- src/admin_panel/public/javascripts/calendar_date_select/locale/pt.js
|
204
|
-
- src/admin_panel/public/javascripts/calendar_date_select/locale/fr.js
|
205
|
-
- src/admin_panel/public/javascripts/calendar_date_select/format_italian.js
|
206
|
-
- src/admin_panel/public/javascripts/calendar_date_select/format_hyphen_ampm.js
|
207
|
-
- src/admin_panel/public/javascripts/calendar_date_select/format_db.js
|
208
193
|
- src/admin_panel/public/javascripts/ui.core.js
|
209
194
|
- src/admin_panel/public/javascripts/prototype.js
|
210
195
|
- src/admin_panel/public/javascripts/effects.js
|
@@ -219,17 +204,11 @@ files:
|
|
219
204
|
- src/admin_panel/public/stylesheets/netscape/style.css
|
220
205
|
- src/admin_panel/public/stylesheets/safari/login.css
|
221
206
|
- src/admin_panel/public/stylesheets/safari/style.css
|
222
|
-
- src/admin_panel/public/stylesheets/calendar_date_select/default.css
|
223
|
-
- src/admin_panel/public/stylesheets/calendar_date_select/plain.css
|
224
|
-
- src/admin_panel/public/stylesheets/calendar_date_select/red.css
|
225
|
-
- src/admin_panel/public/stylesheets/calendar_date_select/silver.css
|
226
|
-
- src/admin_panel/public/stylesheets/calendar_date_select/blue.css
|
227
207
|
- src/admin_panel/public/dispatch.fcgi
|
228
208
|
- src/admin_panel/public/404.html
|
229
209
|
- src/admin_panel/public/favicon.ico
|
230
210
|
- src/admin_panel/public/open-flash-chart.swf
|
231
211
|
- src/admin_panel/public/dispatch.cgi
|
232
|
-
- src/admin_panel/public/blank_iframe.html
|
233
212
|
- src/admin_panel/public/images/bar.gif
|
234
213
|
- src/admin_panel/public/images/logout.gif
|
235
214
|
- src/admin_panel/public/images/bullet.gif
|
@@ -268,7 +247,6 @@ files:
|
|
268
247
|
- src/admin_panel/public/images/home_up.gif
|
269
248
|
- src/admin_panel/public/images/exceptions_ad.gif
|
270
249
|
- src/admin_panel/public/images/analytics_dn.gif
|
271
|
-
- src/admin_panel/public/images/calendar_date_select/calendar.gif
|
272
250
|
- src/admin_panel/public/images/tit_analytics_ad.gif
|
273
251
|
- src/admin_panel/public/images/close.gif
|
274
252
|
- src/admin_panel/public/images/setting_up.gif
|
Binary file
|