Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/libexec/httpd/main.c,v rcsdiff: /ftp/cvs/cvsroot/src/libexec/httpd/main.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.3 retrieving revision 1.3.2.2 diff -u -p -r1.3 -r1.3.2.2 --- src/libexec/httpd/main.c 2011/08/27 15:33:59 1.3 +++ src/libexec/httpd/main.c 2014/05/22 11:37:13 1.3.2.2 @@ -1,10 +1,10 @@ -/* $NetBSD: main.c,v 1.3 2011/08/27 15:33:59 joerg Exp $ */ +/* $NetBSD: main.c,v 1.3.2.2 2014/05/22 11:37:13 yamt Exp $ */ -/* $eterna: main.c,v 1.4 2010/07/11 00:34:28 mrg Exp $ */ +/* $eterna: main.c,v 1.6 2011/11/18 09:21:15 mrg Exp $ */ /* from: eterna: bozohttpd.c,v 1.159 2009/05/23 02:14:30 mrg Exp */ /* - * Copyright (c) 1997-2010 Matthew R. Green + * Copyright (c) 1997-2014 Matthew R. Green * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -79,12 +79,15 @@ usage(bozohttpd_t *httpd, char *progname bozo_warn(httpd, " -c cgibin\t\tenable cgi-bin support in this directory"); #endif +#ifndef NO_LUA_SUPPORT + bozo_warn(httpd, " -L arg script\tadd this Lua script"); +#endif + bozo_warn(httpd, " -I port\t\tbind or use on this port"); #ifndef NO_DAEMON_MODE bozo_warn(httpd, " -b\t\t\tbackground and go into daemon mode"); bozo_warn(httpd, " -f\t\t\tkeep daemon mode in the foreground"); bozo_warn(httpd, " -i address\t\tbind on this address (daemon mode only)"); - bozo_warn(httpd, " -I port\t\tbind on this port (daemon mode only)"); bozo_warn(httpd, " -P pidfile\t\tpath to the pid file to create"); #endif bozo_warn(httpd, " -S version\t\tset server version string"); @@ -138,9 +141,22 @@ main(int argc, char **argv) bozo_set_defaults(&httpd, &prefs); while ((c = getopt(argc, argv, - "C:HI:M:P:S:U:VXZ:bc:defhi:np:rst:uv:x:z:")) != -1) { + "C:HI:L:M:P:S:U:VXZ:bc:defhi:np:rst:uv:x:z:")) != -1) { switch(c) { + case 'L': +#ifdef NO_LUA_SUPPORT + bozo_err(&httpd, 1, + "Lua support is not enabled"); + /* NOTREACHED */ +#else + /* make sure there's two argument */ + if (argc - optind < 1) + usage(&httpd, progname); + bozo_add_lua_map(&httpd, optarg, argv[optind]); + optind++; + break; +#endif /* NO_LUA_SUPPORT */ case 'M': #ifdef NO_DYNAMIC_CONTENT bozo_err(&httpd, 1, @@ -198,12 +214,15 @@ main(int argc, char **argv) bozo_set_pref(&prefs, "index.html", optarg); break; + case 'I': + bozo_set_pref(&prefs, "port number", optarg); + break; + #ifdef NO_DAEMON_MODE case 'b': case 'e': case 'f': case 'i': - case 'I': case 'P': bozo_err(&httpd, 1, "Daemon mode is not enabled"); /* NOTREACHED */ @@ -233,9 +252,6 @@ main(int argc, char **argv) bozo_set_pref(&prefs, "bind address", optarg); break; - case 'I': - bozo_set_pref(&prefs, "port number", optarg); - break; case 'P': bozo_set_pref(&prefs, "pid file", optarg); break;