aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/share/ruby/aserv.rb
diff options
context:
space:
mode:
authorSean Dague2008-10-01 18:57:37 +0000
committerSean Dague2008-10-01 18:57:37 +0000
commit5d5a886b3401d4b229485014186b917c9bb1b530 (patch)
tree1423bd40b6a431aacf4c64bed44f663ffe23162a /share/ruby/aserv.rb
parentremove mysql_connection.ini.example, no one should be using this any (diff)
downloadopensim-SC_OLD-5d5a886b3401d4b229485014186b917c9bb1b530.zip
opensim-SC_OLD-5d5a886b3401d4b229485014186b917c9bb1b530.tar.gz
opensim-SC_OLD-5d5a886b3401d4b229485014186b917c9bb1b530.tar.bz2
opensim-SC_OLD-5d5a886b3401d4b229485014186b917c9bb1b530.tar.xz
remove these old ruby grid servers as they are really old (like a year
old). A project like this is welcomed to come back on opensim forge.
Diffstat (limited to '')
-rwxr-xr-xshare/ruby/aserv.rb35
1 files changed, 0 insertions, 35 deletions
diff --git a/share/ruby/aserv.rb b/share/ruby/aserv.rb
deleted file mode 100755
index 1ac3d60..0000000
--- a/share/ruby/aserv.rb
+++ /dev/null
@@ -1,35 +0,0 @@
1require "webrick"
2
3#
4# Dummy asset server
5#
6
7class AssetServlet < WEBrick::HTTPServlet::AbstractServlet
8 def do_GET(req, res)
9 uuid = req.path.split("/")[2].downcase.gsub(/[^0-9a-f]+/, "")
10 if uuid.length == 32
11 # length is correct
12 File.open("assets/#{uuid}/data") do |f|
13 res.body = f.read
14 end
15 end
16 # res["content-type"] = "text/plain" # or what do we set it to ?
17 end
18 def do_POST(req, res)
19 uuid = req.path.split("/")[2].downcase.gsub(/[^0-9a-f]+/, "")
20 if uuid.length == 32
21 Dir.mkdir("assets/#{uuid}")
22 File.open("assets/#{uuid}/data", "wb") do |f|
23 f.write req.body
24 STDERR.print "Written #{req.body.length} bytes for uuid #{uuid}\n\n"
25 end
26 end
27 end
28end
29
30
31svr = WEBrick::HTTPServer.new(:Port=>8003)
32svr.mount("/assets", AssetServlet, 5000000)
33trap(:INT){ svr.shutdown }
34svr.start
35