swiftiply 0.6.1.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CONTRIBUTORS +2 -0
- data/README.md +62 -0
- data/bin/{mongrel_rails → evented_mongrel_rails} +6 -14
- data/bin/swiftiplied_mongrel_rails +246 -0
- data/bin/swiftiply +136 -116
- data/bin/swiftiply_mongrel_rails +2 -2
- data/bin/swiftiplyctl +283 -0
- data/cleanup.sh +5 -0
- data/ext/deque/extconf.rb +162 -0
- data/ext/deque/swiftcore/rubymain.cpp +435 -0
- data/ext/fastfilereader/extconf.rb +2 -2
- data/ext/fastfilereader/mapper.cpp +2 -0
- data/ext/map/extconf.rb +161 -0
- data/ext/map/rubymain.cpp +500 -0
- data/ext/splaytree/extconf.rb +161 -0
- data/ext/splaytree/swiftcore/rubymain.cpp +580 -0
- data/ext/splaytree/swiftcore/splay_map.h +635 -0
- data/ext/splaytree/swiftcore/splay_set.h +575 -0
- data/ext/splaytree/swiftcore/splay_tree.h +1127 -0
- data/external/httpclient.rb +231 -0
- data/external/package.rb +13 -13
- data/setup.rb +18 -2
- data/src/swiftcore/Swiftiply.rb +417 -773
- data/src/swiftcore/Swiftiply/backend_protocol.rb +213 -0
- data/src/swiftcore/Swiftiply/cache_base.rb +49 -0
- data/src/swiftcore/Swiftiply/cache_base_mixin.rb +52 -0
- data/src/swiftcore/Swiftiply/cluster_managers/rest_based_cluster_manager.rb +9 -0
- data/src/swiftcore/Swiftiply/cluster_protocol.rb +70 -0
- data/src/swiftcore/Swiftiply/config.rb +370 -0
- data/src/swiftcore/Swiftiply/config/rest_updater.rb +26 -0
- data/src/swiftcore/Swiftiply/constants.rb +101 -0
- data/src/swiftcore/Swiftiply/content_cache_entry.rb +44 -0
- data/src/swiftcore/Swiftiply/content_response.rb +45 -0
- data/src/swiftcore/Swiftiply/control_protocol.rb +49 -0
- data/src/swiftcore/Swiftiply/dynamic_request_cache.rb +41 -0
- data/src/swiftcore/Swiftiply/etag_cache.rb +64 -0
- data/src/swiftcore/Swiftiply/file_cache.rb +46 -0
- data/src/swiftcore/Swiftiply/hash_cache_base.rb +22 -0
- data/src/swiftcore/Swiftiply/http_recognizer.rb +267 -0
- data/src/swiftcore/Swiftiply/loggers/Analogger.rb +21 -0
- data/src/swiftcore/Swiftiply/loggers/stderror.rb +13 -0
- data/src/swiftcore/Swiftiply/mocklog.rb +10 -0
- data/src/swiftcore/Swiftiply/proxy.rb +15 -0
- data/src/swiftcore/Swiftiply/proxy_backends/keepalive.rb +286 -0
- data/src/swiftcore/Swiftiply/proxy_backends/traditional.rb +286 -0
- data/src/swiftcore/Swiftiply/proxy_backends/traditional/redis_directory.rb +87 -0
- data/src/swiftcore/Swiftiply/proxy_backends/traditional/static_directory.rb +69 -0
- data/src/swiftcore/Swiftiply/proxy_bag.rb +716 -0
- data/src/swiftcore/Swiftiply/rest_based_cluster_manager.rb +15 -0
- data/src/swiftcore/Swiftiply/splay_cache_base.rb +21 -0
- data/src/swiftcore/Swiftiply/support_pagecache.rb +6 -3
- data/src/swiftcore/Swiftiply/swiftiply_2_http_proxy.rb +7 -0
- data/src/swiftcore/Swiftiply/swiftiply_client.rb +20 -5
- data/src/swiftcore/Swiftiply/version.rb +5 -0
- data/src/swiftcore/evented_mongrel.rb +26 -8
- data/src/swiftcore/hash.rb +43 -0
- data/src/swiftcore/method_builder.rb +28 -0
- data/src/swiftcore/streamer.rb +46 -0
- data/src/swiftcore/swiftiplied_mongrel.rb +91 -23
- data/src/swiftcore/types.rb +20 -3
- data/swiftiply.gemspec +14 -8
- data/test/TC_Deque.rb +152 -0
- data/test/TC_ProxyBag.rb +147 -166
- data/test/TC_Swiftiply.rb +576 -169
- data/test/TC_Swiftiply/mongrel/evented_hello.rb +1 -1
- data/test/TC_Swiftiply/mongrel/swiftiplied_hello.rb +1 -1
- data/test/TC_Swiftiply/test_serve_static_file_xsendfile/sendfile_client.rb +27 -0
- data/test/TC_Swiftiply/test_ssl/bin/validate_ssl_capability.rb +21 -0
- data/test/TC_Swiftiply/test_ssl/test.cert +16 -0
- data/test/TC_Swiftiply/test_ssl/test.key +15 -0
- data/{bin → test/bin}/echo_client +0 -0
- metadata +136 -94
- data/README +0 -126
- data/ext/swiftiply_parse/parse.rl +0 -90
@@ -1,90 +0,0 @@
|
|
1
|
-
/* def add_frontend_client clnt
|
2
|
-
clnt.create_time = @ctime
|
3
|
-
unless match_client_to_server_now(clnt)
|
4
|
-
if clnt.uri =~ /\w+-\w+-\w+\.\w+\.[\w\.]+-(\w+)?$/
|
5
|
-
@demanding_clients[$1].unshift clnt
|
6
|
-
else
|
7
|
-
@client_q[clnt.name].unshift(clnt)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
def match_client_to_server_now(client)
|
13
|
-
sq = @server_q[@incoming_map[client.name]]
|
14
|
-
if client.uri =~ /\w+-\w+-\w+\.\w+\.[\w\.]+-(\w+)?$/ and sidx = sq.index(@reverse_id_map[$1])
|
15
|
-
server = sq.delete_at(sidx)
|
16
|
-
server.associate = client
|
17
|
-
client.associate = server
|
18
|
-
client.push
|
19
|
-
true
|
20
|
-
elsif server = sq.pop
|
21
|
-
server.associate = client
|
22
|
-
client.associate = server
|
23
|
-
client.push
|
24
|
-
true
|
25
|
-
else
|
26
|
-
false
|
27
|
-
end
|
28
|
-
end
|
29
|
-
*/
|
30
|
-
|
31
|
-
/*
|
32
|
-
def receive_data data
|
33
|
-
@data.unshift data
|
34
|
-
if @name
|
35
|
-
push
|
36
|
-
else
|
37
|
-
data =~ /\s([^\s\?]*)/
|
38
|
-
@uri ||= $1
|
39
|
-
if data =~ /^Host:\s*([^\r\n:]*)/
|
40
|
-
@name = $1
|
41
|
-
ProxyBag.add_frontend_client self
|
42
|
-
push
|
43
|
-
elsif data.index(/\r\n\r\n/)
|
44
|
-
@name = ProxyBag.default_name
|
45
|
-
ProxyBag.add_frontend_client self
|
46
|
-
push
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
*/
|
51
|
-
|
52
|
-
/*
|
53
|
-
|
54
|
-
|
55
|
-
def receive_data data
|
56
|
-
unless @initialized
|
57
|
-
@id = data.slice!(0..11)
|
58
|
-
ProxyBag.add_id(self,@id)
|
59
|
-
@initialized = true
|
60
|
-
end
|
61
|
-
unless @headers_completed
|
62
|
-
if data.index(Crnrn)
|
63
|
-
@headers_completed = true
|
64
|
-
h,d = data.split(Rrnrn)
|
65
|
-
@headers << h << Crnrn
|
66
|
-
@headers =~ /Content-Length:\s*([^\r\n]+)/
|
67
|
-
@content_length = $1.to_i
|
68
|
-
@associate.send_data @headers
|
69
|
-
data = d
|
70
|
-
else
|
71
|
-
@headers << data
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
if @headers_completed
|
76
|
-
@associate.send_data data
|
77
|
-
@content_sent += data.length
|
78
|
-
if @content_sent >= @content_length
|
79
|
-
@associate.close_connection_after_writing
|
80
|
-
@associate = nil
|
81
|
-
setup
|
82
|
-
ProxyBag.add_server self
|
83
|
-
end
|
84
|
-
end
|
85
|
-
rescue
|
86
|
-
@associate.close_connection_after_writing
|
87
|
-
@associate = nil
|
88
|
-
setup
|
89
|
-
ProxyBag.add_server self
|
90
|
-
end
|