thin 1.8.2 → 2.0.0.pre
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of thin might be problematic. Click here for more details.
- data/.gitignore +9 -0
- data/CHANGELOG +29 -116
- data/Gemfile +8 -0
- data/README.md +44 -78
- data/Rakefile +28 -18
- data/bin/thin +4 -4
- data/examples/async.ru +21 -0
- data/examples/thin.conf.rb +39 -0
- data/lib/thin/async.rb +108 -0
- data/lib/thin/backends/prefork.rb +44 -0
- data/lib/thin/backends/single_process.rb +28 -0
- data/lib/thin/chunked_body.rb +28 -0
- data/lib/thin/configurator.rb +118 -0
- data/lib/thin/connection.rb +246 -172
- data/lib/thin/listener.rb +114 -0
- data/lib/thin/request.rb +94 -76
- data/lib/thin/response.rb +112 -45
- data/lib/thin/runner.rb +134 -197
- data/lib/thin/server.rb +203 -252
- data/lib/thin/system.rb +49 -0
- data/lib/thin/version.rb +12 -27
- data/lib/thin.rb +2 -44
- data/man/index.txt +3 -0
- data/man/thin-conf.5.ronn +121 -0
- data/man/thin.1.ronn +105 -0
- data/site/.gitignore +2 -0
- data/site/README.md +21 -0
- data/site/Rakefile +20 -0
- data/site/config.ru +4 -0
- data/site/public/images/grid.png +0 -0
- data/site/public/javascripts/dd_belatedpng.js +13 -0
- data/site/public/javascripts/modernizr-1.6.min.js +30 -0
- data/site/public/man/thin-conf.5.html +220 -0
- data/site/public/man/thin.1.html +177 -0
- data/site/site/assets/javascripts/main.coffee +2 -0
- data/site/site/assets/stylesheets/_config.scss +55 -0
- data/site/site/assets/stylesheets/main.scss +24 -0
- data/site/site/helpers.rb +17 -0
- data/site/site/layouts/base.erb +55 -0
- data/site/site/layouts/default.erb +17 -0
- data/site/site/pages/about.md +5 -0
- data/site/site/pages/index.erb +10 -0
- data/site/site/partials/.gitkeep +0 -0
- data/test/fixtures/big.txt +1 -0
- data/test/fixtures/small.txt +1 -0
- data/test/fixtures/thin.conf.rb +15 -0
- data/test/integration/async_test.rb +35 -0
- data/test/integration/big_request_test.rb +30 -0
- data/test/integration/config.ru +57 -0
- data/test/integration/daemonize_test.rb +26 -0
- data/test/integration/env_test.rb +44 -0
- data/test/integration/error_test.rb +37 -0
- data/test/integration/file_sending_test.rb +24 -0
- data/test/integration/keep_alive_test.rb +35 -0
- data/test/integration/robustness_test.rb +37 -0
- data/test/integration/single_process_test.rb +15 -0
- data/test/integration/socket_family_test.rb +38 -0
- data/test/integration/worker_test.rb +22 -0
- data/test/test_helper.rb +195 -0
- data/test/unit/configurator_test.rb +43 -0
- data/test/unit/connection_test.rb +94 -0
- data/test/unit/listener_test.rb +74 -0
- data/test/unit/request_test.rb +74 -0
- data/test/unit/response_test.rb +90 -0
- data/test/unit/server_test.rb +29 -0
- data/test/unit/system_test.rb +17 -0
- data/thin.gemspec +26 -0
- data/v2.todo +21 -0
- metadata +138 -93
- checksums.yaml +0 -7
- data/example/adapter.rb +0 -32
- data/example/async_app.ru +0 -126
- data/example/async_chat.ru +0 -247
- data/example/async_tailer.ru +0 -100
- data/example/config.ru +0 -22
- data/example/monit_sockets +0 -20
- data/example/monit_unixsock +0 -20
- data/example/myapp.rb +0 -1
- data/example/ramaze.ru +0 -12
- data/example/thin.god +0 -80
- data/example/thin_solaris_smf.erb +0 -36
- data/example/thin_solaris_smf.readme.txt +0 -150
- data/example/vlad.rake +0 -72
- data/ext/thin_parser/common.rl +0 -59
- data/ext/thin_parser/ext_help.h +0 -14
- data/ext/thin_parser/extconf.rb +0 -6
- data/ext/thin_parser/parser.c +0 -1447
- data/ext/thin_parser/parser.h +0 -49
- data/ext/thin_parser/parser.rl +0 -152
- data/ext/thin_parser/thin.c +0 -435
- data/lib/rack/adapter/loader.rb +0 -75
- data/lib/rack/adapter/rails.rb +0 -178
- data/lib/rack/handler/thin.rb +0 -38
- data/lib/thin/backends/base.rb +0 -169
- data/lib/thin/backends/swiftiply_client.rb +0 -66
- data/lib/thin/backends/tcp_server.rb +0 -34
- data/lib/thin/backends/unix_server.rb +0 -56
- data/lib/thin/command.rb +0 -53
- data/lib/thin/controllers/cluster.rb +0 -178
- data/lib/thin/controllers/controller.rb +0 -189
- data/lib/thin/controllers/service.rb +0 -76
- data/lib/thin/controllers/service.sh.erb +0 -39
- data/lib/thin/daemonizing.rb +0 -199
- data/lib/thin/headers.rb +0 -47
- data/lib/thin/logging.rb +0 -174
- data/lib/thin/stats.html.erb +0 -216
- data/lib/thin/stats.rb +0 -52
- data/lib/thin/statuses.rb +0 -48
data/example/vlad.rake
DELETED
@@ -1,72 +0,0 @@
|
|
1
|
-
# $GEM_HOME/gems/vlad-1.2.0/lib/vlad/thin.rb
|
2
|
-
# Thin tasks for Vlad the Deployer
|
3
|
-
# By cnantais
|
4
|
-
require 'vlad'
|
5
|
-
|
6
|
-
namespace :vlad do
|
7
|
-
##
|
8
|
-
# Thin app server
|
9
|
-
|
10
|
-
set :thin_address, nil
|
11
|
-
set :thin_command, "thin"
|
12
|
-
set(:thin_conf) { "#{shared_path}/thin_cluster.conf" }
|
13
|
-
set :thin_environment, "production"
|
14
|
-
set :thin_group, nil
|
15
|
-
set :thin_log_file, nil
|
16
|
-
set :thin_pid_file, nil
|
17
|
-
set :thin_port, nil
|
18
|
-
set :thin_socket, nil
|
19
|
-
set :thin_prefix, nil
|
20
|
-
set :thin_servers, 2
|
21
|
-
set :thin_user, nil
|
22
|
-
|
23
|
-
set :thin_uses_bundler, true
|
24
|
-
|
25
|
-
desc "Prepares application servers for deployment. thin
|
26
|
-
configuration is set via the thin_* variables.".cleanup
|
27
|
-
|
28
|
-
remote_task :setup_app, :roles => :app do
|
29
|
-
|
30
|
-
raise(ArgumentError, "Please provide either thin_socket or thin_port") if thin_port.nil? && thin_socket.nil?
|
31
|
-
|
32
|
-
cmd = [
|
33
|
-
"config",
|
34
|
-
(%(-s "#{thin_servers}") if thin_servers),
|
35
|
-
(%(-S "#{thin_socket}") if thin_socket),
|
36
|
-
(%(-e "#{thin_environment}") if thin_environment),
|
37
|
-
(%(-a "#{thin_address}") if thin_address),
|
38
|
-
%(-c "#{current_path}"),
|
39
|
-
(%(-C "#{thin_conf}") if thin_conf),
|
40
|
-
(%(-P "#{thin_pid_file}") if thin_pid_file),
|
41
|
-
(%(-l "#{thin_log_file}") if thin_log_file),
|
42
|
-
(%(--user "#{thin_user}") if thin_user),
|
43
|
-
(%(--group "#{thin_group}") if thin_group),
|
44
|
-
(%(--prefix "#{thin_prefix}") if thin_prefix),
|
45
|
-
(%(-p "#{thin_port}") if thin_port),
|
46
|
-
].compact.join ' '
|
47
|
-
|
48
|
-
thin(cmd)
|
49
|
-
end
|
50
|
-
|
51
|
-
def thin(cmd) # :nodoc:
|
52
|
-
command = if thin_uses_bundler
|
53
|
-
%(BUNDLE_GEMFILE="#{current_path}/Gemfile" bundle exec #{thin_command} #{cmd} -C "#{thin_conf}")
|
54
|
-
else
|
55
|
-
%(#{thin_command} #{cmd} -C "#{thin_conf}")
|
56
|
-
end
|
57
|
-
|
58
|
-
%(cd "#{current_path}" && #{command})
|
59
|
-
end
|
60
|
-
|
61
|
-
desc "Restart the app servers"
|
62
|
-
|
63
|
-
remote_task :start_app, :roles => :app do
|
64
|
-
run thin(%(restart -O -s "#{thin_servers}"))
|
65
|
-
end
|
66
|
-
|
67
|
-
desc "Stop the app servers"
|
68
|
-
|
69
|
-
remote_task :stop_app, :roles => :app do
|
70
|
-
run thin(%(stop -s "#{thin_servers}"))
|
71
|
-
end
|
72
|
-
end
|
data/ext/thin_parser/common.rl
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
%%{
|
2
|
-
|
3
|
-
machine http_parser_common;
|
4
|
-
|
5
|
-
#### HTTP PROTOCOL GRAMMAR
|
6
|
-
# line endings
|
7
|
-
CRLF = "\r\n";
|
8
|
-
|
9
|
-
# character types
|
10
|
-
CTL = (cntrl | 127);
|
11
|
-
safe = ("$" | "-" | "_" | ".");
|
12
|
-
extra = ("!" | "*" | "'" | "(" | ")" | ",");
|
13
|
-
reserved = (";" | "/" | "?" | ":" | "@" | "&" | "=" | "+");
|
14
|
-
sorta_safe = ("\"" | "<" | ">");
|
15
|
-
unsafe = (CTL | " " | "#" | "%" | sorta_safe);
|
16
|
-
national = any -- (alpha | digit | reserved | extra | safe | unsafe);
|
17
|
-
unreserved = (alpha | digit | safe | extra | national);
|
18
|
-
escape = ("%" "u"? xdigit xdigit);
|
19
|
-
uchar = (unreserved | escape | sorta_safe);
|
20
|
-
pchar = (uchar | ":" | "@" | "&" | "=" | "+");
|
21
|
-
tspecials = ("(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\\" | "\"" | "/" | "[" | "]" | "?" | "=" | "{" | "}" | " " | "\t");
|
22
|
-
|
23
|
-
# elements
|
24
|
-
token = (ascii -- (CTL | tspecials));
|
25
|
-
|
26
|
-
# URI schemes and absolute paths
|
27
|
-
scheme = ( "http"i ("s"i)? );
|
28
|
-
hostname = ((alnum | "-" | "." | "_")+ | ("[" (":" | xdigit)+ "]"));
|
29
|
-
host_with_port = (hostname (":" digit*)?);
|
30
|
-
userinfo = ((unreserved | escape | ";" | ":" | "&" | "=" | "+")+ "@")*;
|
31
|
-
|
32
|
-
path = ( pchar+ ( "/" pchar* )* ) ;
|
33
|
-
query = ( uchar | reserved )* %query_string ;
|
34
|
-
param = ( pchar | "/" )* ;
|
35
|
-
params = ( param ( ";" param )* ) ;
|
36
|
-
rel_path = (path? (";" params)? %request_path) ("?" %start_query query)?;
|
37
|
-
absolute_path = ( "/"+ rel_path );
|
38
|
-
path_uri = absolute_path > mark %request_uri;
|
39
|
-
Absolute_URI = (scheme "://" userinfo host_with_port path_uri);
|
40
|
-
|
41
|
-
Request_URI = ((absolute_path | "*") >mark %request_uri) | Absolute_URI;
|
42
|
-
Fragment = ( uchar | reserved )* >mark %fragment;
|
43
|
-
Method = ( upper | digit | safe ){1,20} >mark %request_method;
|
44
|
-
|
45
|
-
http_number = ( digit+ "." digit+ ) ;
|
46
|
-
HTTP_Version = ( "HTTP/" http_number ) >mark %http_version ;
|
47
|
-
Request_Line = ( Method " " Request_URI ("#" Fragment){0,1} " " HTTP_Version CRLF ) ;
|
48
|
-
|
49
|
-
field_name = ( token -- ":" )+ >start_field %write_field;
|
50
|
-
|
51
|
-
field_value = any* >start_value %write_value;
|
52
|
-
|
53
|
-
message_header = field_name ":" " "* field_value :> CRLF;
|
54
|
-
|
55
|
-
Request = Request_Line ( message_header )* ( CRLF @done );
|
56
|
-
|
57
|
-
main := Request;
|
58
|
-
|
59
|
-
}%%
|
data/ext/thin_parser/ext_help.h
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#ifndef ext_help_h
|
2
|
-
#define ext_help_h
|
3
|
-
|
4
|
-
#define RAISE_NOT_NULL(T) if(T == NULL) rb_raise(rb_eArgError, "NULL found for " # T " when shouldn't be.");
|
5
|
-
#define DATA_GET(from,type,name) Data_Get_Struct(from,type,name); RAISE_NOT_NULL(name);
|
6
|
-
#define REQUIRE_TYPE(V, T) if(TYPE(V) != T) rb_raise(rb_eTypeError, "Wrong argument type for " # V " required " # T);
|
7
|
-
|
8
|
-
#ifdef DEBUG
|
9
|
-
#define TRACE() fprintf(stderr, "> %s:%d:%s\n", __FILE__, __LINE__, __FUNCTION__)
|
10
|
-
#else
|
11
|
-
#define TRACE()
|
12
|
-
#endif
|
13
|
-
|
14
|
-
#endif
|