Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/httpd/lua Pass the expected httpd instance when call...



details:   https://anonhg.NetBSD.org/src/rev/d2df6bd91bbb
branches:  trunk
changeset: 361513:d2df6bd91bbb
user:      sevan <sevan%NetBSD.org@localhost>
date:      Wed May 02 00:00:30 2018 +0000

description:
Pass the expected httpd instance when calling set_pref()
process_request() only takes a single argument.

diffstat:

 libexec/httpd/lua/bozo.lua |  42 +++++++++++++++++++++---------------------
 1 files changed, 21 insertions(+), 21 deletions(-)

diffs (116 lines):

diff -r 20b509912d15 -r d2df6bd91bbb libexec/httpd/lua/bozo.lua
--- a/libexec/httpd/lua/bozo.lua        Tue May 01 23:59:42 2018 +0000
+++ b/libexec/httpd/lua/bozo.lua        Wed May 02 00:00:30 2018 +0000
@@ -32,7 +32,7 @@
 -- command line args
 dofile "optparse.lua"
 
-opt = OptionParser{usage="%prog [options] root [vhost]", version="20091105"}                           
+opt = OptionParser{usage="%prog [options] root [vhost]", version="20180502"}                           
 
 opt.add_option{"-C", "--cgimap", action="store", dest="cgimap", help="--cgimap 's t'"}
 opt.add_option{"-E", "--enable-user-cgibin", action="store_true", dest="enableusercgibin", help="--enable-user-cgibin"}
@@ -75,22 +75,22 @@
 -- parse command line args
 options,args = opt.parse_args()
 if options.portnum then
-        bozohttpd.set_pref(prefs, "port number", options.portnum)
+        bozohttpd.set_pref(httpd, prefs, "port number", options.portnum)
 end
 if options.background then
-        bozohttpd.set_pref(prefs, "background", options.background)
+        bozohttpd.set_pref(httpd, prefs, "background", options.background)
 end
 if options.numeric then
-        bozohttpd.set_pref(prefs, "numeric", "true")
+        bozohttpd.set_pref(httpd, prefs, "numeric", "true")
 end
 if options.logstderr then
-        bozohttpd.set_pref(prefs, "log to stderr", "true")
+        bozohttpd.set_pref(httpd, prefs, "log to stderr", "true")
 end
 if options.foreground then
-        bozohttpd.set_pref(prefs, "foreground", "true")
+        bozohttpd.set_pref(httpd, prefs, "foreground", "true")
 end
 if options.trustedref then
-        bozohttpd.set_pref(prefs, "trusted referal", "true")
+        bozohttpd.set_pref(httpd, prefs, "trusted referal", "true")
 end
 if options.dynmime then
        suffix, type, s1, s2 = string.find(options.dynmime,
@@ -98,29 +98,29 @@
         bozohttpd.dynamic_mime(httpd, suffix, type, s1, s2)
 end
 if options.serversw then
-        bozohttpd.set_pref(prefs, "server software", options.serversw)
+        bozohttpd.set_pref(httpd, prefs, "server software", options.serversw)
 end
 if options.ssl then
        cert, priv = string.find(options.ssl, "(%S+)%s+(%S+)")
         bozohttpd.dynamic_mime(httpd, cert, priv)
 end
 if options.username then
-        bozohttpd.set_pref(prefs, "username", options.username)
+        bozohttpd.set_pref(httpd, prefs, "username", options.username)
 end
 if options.unknownslash then
-        bozohttpd.set_pref(prefs, "unknown slash", "true")
+        bozohttpd.set_pref(httpd, prefs, "unknown slash", "true")
 end
 if options.virtbase then
-        bozohttpd.set_pref(prefs, "virtual base", options.virtbase)
+        bozohttpd.set_pref(httpd, prefs, "virtual base", options.virtbase)
 end
 if options.indexhtml then
-        bozohttpd.set_pref(prefs, "index.html", options.indexhtml)
+        bozohttpd.set_pref(httpd, prefs, "index.html", options.indexhtml)
 end
 if options.dirtyenv then
-        bozohttpd.set_pref(prefs, "dirty environment", "true")
+        bozohttpd.set_pref(httpd, prefs, "dirty environment", "true")
 end
 if options.bindaddr then
-        bozohttpd.set_pref(prefs, "bind address", options.bindaddr)
+        bozohttpd.set_pref(httpd, prefs, "bind address", options.bindaddr)
 end
 if options.cgibin then
         bozohttpd.cgi_setbin(httpd, options.cgibin)
@@ -130,22 +130,22 @@
         bozohttpd.cgi_map(httpd, name, handler)
 end
 if options.public_html then
-        bozohttpd.set_pref(prefs, "public_html", options.public_html)
+        bozohttpd.set_pref(httpd, prefs, "public_html", options.public_html)
 end
 if options.chroot then
-        bozohttpd.set_pref(prefs, "chroot dir", options.chroot)
+        bozohttpd.set_pref(httpd, prefs, "chroot dir", options.chroot)
 end
 if options.enableusers then
-        bozohttpd.set_pref(prefs, "enable users", "true")
+        bozohttpd.set_pref(httpd, prefs, "enable users", "true")
 end
 if options.hidedots then
-        bozohttpd.set_pref(prefs, "hide dots", "true")
+        bozohttpd.set_pref(httpd, prefs, "hide dots", "true")
 end
 if options.enableusercgibin then
-        bozohttpd.set_pref(prefs, "enable user cgibin", "true")
+        bozohttpd.set_pref(httpd, prefs, "enable user cgibin", "true")
 end
 if options.dirindex then
-        bozohttpd.set_pref(prefs, "directory indexing", "true")
+        bozohttpd.set_pref(httpd, prefs, "directory indexing", "true")
 end
 
 if #args < 1 then
@@ -159,7 +159,7 @@
        local numreps = options.background or 0
        repeat
                req = bozohttpd.read_request(httpd)
-               bozohttpd.process_request(httpd, req)
+               bozohttpd.process_request(req)
                bozohttpd.clean_request(req)
        until numreps == 0
 end



Home | Main Index | Thread Index | Old Index