Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/libexec/httpd move some #if support into bozohttpd.h.
details: https://anonhg.NetBSD.org/src/rev/8f8783ec43bd
branches: trunk
changeset: 994742:8f8783ec43bd
user: mrg <mrg%NetBSD.org@localhost>
date: Tue Nov 20 01:15:50 2018 +0000
description:
move some #if support into bozohttpd.h.
diffstat:
libexec/httpd/bozohttpd.h | 57 +++++++++++++++++++++++++++++++---------------
libexec/httpd/main.c | 52 +------------------------------------------
2 files changed, 39 insertions(+), 70 deletions(-)
diffs (213 lines):
diff -r 486e7409ee42 -r 8f8783ec43bd libexec/httpd/bozohttpd.h
--- a/libexec/httpd/bozohttpd.h Tue Nov 20 01:06:46 2018 +0000
+++ b/libexec/httpd/bozohttpd.h Tue Nov 20 01:15:50 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bozohttpd.h,v 1.51 2018/11/20 01:06:46 mrg Exp $ */
+/* $NetBSD: bozohttpd.h,v 1.52 2018/11/20 01:15:50 mrg Exp $ */
/* $eterna: bozohttpd.h,v 1.39 2011/11/18 09:21:15 mrg Exp $ */
@@ -225,8 +225,10 @@
#ifndef NO_DEBUG
void debug__(bozohttpd_t *, int, const char *, ...) BOZO_PRINTFLIKE(3, 4);
#define debug(x) debug__ x
+#define have_debug (0)
#else
#define debug(x)
+#define have_debug (1)
#endif /* NO_DEBUG */
int bozo_http_error(bozohttpd_t *, int, bozo_httpreq_t *, const char *);
@@ -256,19 +258,23 @@
#define bozo_noop do { /* nothing */ } while (/*CONSTCOND*/0)
+#define have_all (1)
+
/* ssl-bozo.c */
#ifdef NO_SSL_SUPPORT
-#define bozo_ssl_set_opts(w, x, y) bozo_noop
-#define bozo_ssl_set_ciphers(w, x, y) bozo_noop
-#define bozo_ssl_init(x) bozo_noop
-#define bozo_ssl_accept(x) (0)
-#define bozo_ssl_destroy(x) bozo_noop
+#define bozo_ssl_set_opts(w, x, y) bozo_noop
+#define bozo_ssl_set_ciphers(w, x, y) bozo_noop
+#define bozo_ssl_init(x) bozo_noop
+#define bozo_ssl_accept(x) (0)
+#define bozo_ssl_destroy(x) bozo_noop
+#define have_ssl (0)
#else
void bozo_ssl_set_opts(bozohttpd_t *, const char *, const char *);
void bozo_ssl_set_ciphers(bozohttpd_t *, const char *);
void bozo_ssl_init(bozohttpd_t *);
int bozo_ssl_accept(bozohttpd_t *);
void bozo_ssl_destroy(bozohttpd_t *);
+#define have_ssl (1)
#endif
@@ -283,64 +289,74 @@
void bozo_auth_cgi_setenv(bozo_httpreq_t *, char ***);
int bozo_auth_cgi_count(bozo_httpreq_t *);
#else
-#define bozo_auth_init(x) bozo_noop
-#define bozo_auth_check(x, y) 0
-#define bozo_auth_cleanup(x) bozo_noop
-#define bozo_auth_check_headers(y, z, a, b) 0
-#define bozo_auth_check_special_files(x, y) 0
-#define bozo_auth_check_401(x, y) bozo_noop
-#define bozo_auth_cgi_setenv(x, y) bozo_noop
-#define bozo_auth_cgi_count(x) 0
+#define bozo_auth_init(x) bozo_noop
+#define bozo_auth_check(x, y) (0)
+#define bozo_auth_cleanup(x) bozo_noop
+#define bozo_auth_check_headers(y, z, a, b) (0)
+#define bozo_auth_check_special_files(x, y) (0)
+#define bozo_auth_check_401(x, y) bozo_noop
+#define bozo_auth_cgi_setenv(x, y) bozo_noop
+#define bozo_auth_cgi_count(x) (0)
#endif /* DO_HTPASSWD */
/* cgi-bozo.c */
#ifdef NO_CGIBIN_SUPPORT
-#define bozo_process_cgi(h) 0
+#define bozo_process_cgi(h) (0)
+#define have_cgibin (0)
#else
void bozo_cgi_setbin(bozohttpd_t *, const char *);
void bozo_setenv(bozohttpd_t *, const char *, const char *, char **);
int bozo_process_cgi(bozo_httpreq_t *);
void bozo_add_content_map_cgi(bozohttpd_t *, const char *, const char *);
+#define have_cgibin (1)
#endif /* NO_CGIBIN_SUPPORT */
/* lua-bozo.c */
#ifdef NO_LUA_SUPPORT
-#define bozo_process_lua(h) 0
+#define bozo_process_lua(h) (0)
+#define have_lua (0)
#else
void bozo_add_lua_map(bozohttpd_t *, const char *, const char *);
int bozo_process_lua(bozo_httpreq_t *);
+#define have_lua (1)
#endif /* NO_LUA_SUPPORT */
/* daemon-bozo.c */
#ifdef NO_DAEMON_MODE
#define bozo_daemon_init(x) bozo_noop
-#define bozo_daemon_fork(x) 0
+#define bozo_daemon_fork(x) (0)
#define bozo_daemon_closefds(x) bozo_noop
+#define have_daemon_mode (0)
#else
void bozo_daemon_init(bozohttpd_t *);
int bozo_daemon_fork(bozohttpd_t *);
void bozo_daemon_closefds(bozohttpd_t *);
+#define have_daemon_mode (1)
#endif /* NO_DAEMON_MODE */
/* tilde-luzah-bozo.c */
#ifdef NO_USER_SUPPORT
-#define bozo_user_transform(x) 0
+#define bozo_user_transform(x) (0)
#define bozo_user_free(x) /* nothing */
+#define have_user (0)
#else
int bozo_user_transform(bozo_httpreq_t *);
#define bozo_user_free(x) free(x)
+#define have_user (1)
#endif /* NO_USER_SUPPORT */
/* dir-index-bozo.c */
#ifdef NO_DIRINDEX_SUPPORT
-#define bozo_dir_index(a, b, c) 0
+#define bozo_dir_index(a, b, c) (0)
+#define have_dirindex (0)
#else
int bozo_dir_index(bozo_httpreq_t *, const char *, int);
+#define have_dirindex (1)
#endif /* NO_DIRINDEX_SUPPORT */
@@ -352,6 +368,9 @@
#ifndef NO_DYNAMIC_CONTENT
void bozo_add_content_map_mime(bozohttpd_t *, const char *, const char *,
const char *, const char *);
+#define have_dynamic_content (0)
+#else
+#define have_dynamic_content (1)
#endif
/* I/O */
diff -r 486e7409ee42 -r 8f8783ec43bd libexec/httpd/main.c
--- a/libexec/httpd/main.c Tue Nov 20 01:06:46 2018 +0000
+++ b/libexec/httpd/main.c Tue Nov 20 01:15:50 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.17 2018/11/20 01:06:46 mrg Exp $ */
+/* $NetBSD: main.c,v 1.18 2018/11/20 01:15:50 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 */
@@ -54,56 +54,6 @@
#define LOG_FTP LOG_DAEMON
#endif
-#ifdef NO_DAEMON_MODE
-#define have_daemon_mode (0)
-#else
-#define have_daemon_mode (1)
-#endif
-
-#ifdef NO_DEBUG
-#define have_debug (0)
-#else
-#define have_debug (1)
-#endif
-
-#ifdef NO_USER_SUPPORT
-#define have_user (0)
-#else
-#define have_user (1)
-#endif
-
-#ifdef NO_CGIBIN_SUPPORT
-#define have_cgibin (0)
-#else
-#define have_cgibin (1)
-#endif
-
-#ifdef NO_DYNAMIC_CONTENT
-#define have_dynamic_content (0)
-#else
-#define have_dynamic_content (1)
-#endif
-
-#ifdef NO_LUA_SUPPORT
-#define have_lua (0)
-#else
-#define have_lua (1)
-#endif
-
-#ifdef NO_DIRINDEX_SUPPORT
-#define have_dirindex (0)
-#else
-#define have_dirindex (1)
-#endif
-
-#ifdef NO_SSL_SUPPORT
-#define have_ssl (0)
-#else
-#define have_ssl (1)
-#endif
-
-#define have_all (1)
-
/* print a usage message, and then exit */
BOZO_DEAD static void
usage(bozohttpd_t *httpd, char *progname)
Home |
Main Index |
Thread Index |
Old Index