From dcaf1f16efe990efdcf8bb6e181eec97dbf4bf75 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 25 Aug 2008 20:32:26 +0000 Subject: [PATCH] (shttpd) replace VERSION with SHTTPD_VERSION. (shttpd) make shttpd_edit_passwords() a public function for now to fix the build. --- libtransmission/rpc-server.c | 2 +- third-party/shttpd/auth.c | 2 +- third-party/shttpd/compat_win32.c | 2 +- third-party/shttpd/config.h | 4 ++-- third-party/shttpd/defs.h | 2 +- third-party/shttpd/io_emb.c | 2 +- third-party/shttpd/shttpd.c | 2 +- third-party/shttpd/shttpd.h | 5 +++++ third-party/shttpd/standalone.c | 4 ++-- 9 files changed, 15 insertions(+), 10 deletions(-) diff --git a/libtransmission/rpc-server.c b/libtransmission/rpc-server.c index e7d0ade06..ecf969fe6 100644 --- a/libtransmission/rpc-server.c +++ b/libtransmission/rpc-server.c @@ -371,7 +371,7 @@ startServer( tr_rpc_server * server ) if( !server->isPasswordEnabled ) unlink( passwd ); else - edit_passwords( passwd, MY_REALM, server->username, server->password ); + shttpd_edit_passwords( passwd, MY_REALM, server->username, server->password ); argv[argc++] = tr_strdup( "appname-unused" ); diff --git a/third-party/shttpd/auth.c b/third-party/shttpd/auth.c index 85d1b4d49..b3975932f 100644 --- a/third-party/shttpd/auth.c +++ b/third-party/shttpd/auth.c @@ -350,7 +350,7 @@ _shttpd_send_authorization_request(struct conn *c) * Edit the passwords file. */ int -_shttpd_edit_passwords(const char *fname, const char *domain, +shttpd_edit_passwords(const char *fname, const char *domain, const char *user, const char *pass) { int ret = EXIT_SUCCESS, found = 0; diff --git a/third-party/shttpd/compat_win32.c b/third-party/shttpd/compat_win32.c index d3b740a83..6266ac4a4 100644 --- a/third-party/shttpd/compat_win32.c +++ b/third-party/shttpd/compat_win32.c @@ -533,7 +533,7 @@ systray(void *arg) cls.lpfnWndProc = (WNDPROC) WindowProc; cls.hIcon = LoadIcon(NULL, IDI_APPLICATION); - cls.lpszClassName = "shttpd v." VERSION; + cls.lpszClassName = "shttpd v." SHTTPD_VERSION; if (!RegisterClass(&cls)) _shttpd_elog(E_FATAL, NULL, "RegisterClass: %d", ERRNO); diff --git a/third-party/shttpd/config.h b/third-party/shttpd/config.h index c23b9c59e..cbe1f8ebd 100644 --- a/third-party/shttpd/config.h +++ b/third-party/shttpd/config.h @@ -11,7 +11,7 @@ #ifndef CONFIG_HEADER_DEFINED #define CONFIG_HEADER_DEFINED -#define VERSION "1.42" /* Version */ +#define SHTTPD_VERSION "1.42" /* Version */ #define CONFIG_FILE "shttpd.conf" /* Configuration file */ #define HTPASSWD ".htpasswd" /* Passwords file name */ #define URI_MAX 16384 /* Default max request size */ @@ -24,6 +24,6 @@ #define EXPIRE_TIME 3600 /* Expiration time, seconds */ #define ENV_MAX 4096 /* Size of environment block */ #define CGI_ENV_VARS 64 /* Maximum vars passed to CGI */ -#define SERVICE_NAME "SHTTPD " VERSION /* NT service name */ +#define SERVICE_NAME "SHTTPD " SHTTPD_VERSION /* NT service name */ #endif /* CONFIG_HEADER_DEFINED */ diff --git a/third-party/shttpd/defs.h b/third-party/shttpd/defs.h index 120de352f..abaaeff86 100644 --- a/third-party/shttpd/defs.h +++ b/third-party/shttpd/defs.h @@ -380,7 +380,7 @@ extern void _shttpd_ssi_func_destructor(struct llhead *lp); extern int _shttpd_check_authorization(struct conn *c, const char *path); extern int _shttpd_is_authorized_for_put(struct conn *c); extern void _shttpd_send_authorization_request(struct conn *c); -extern int _shttpd_edit_passwords(const char *fname, const char *domain, +extern int shttpd_edit_passwords(const char *fname, const char *domain, const char *user, const char *pass); /* diff --git a/third-party/shttpd/io_emb.c b/third-party/shttpd/io_emb.c index 468180b57..1e36d5129 100644 --- a/third-party/shttpd/io_emb.c +++ b/third-party/shttpd/io_emb.c @@ -13,7 +13,7 @@ const char * shttpd_version(void) { - return (VERSION); + return (SHTTPD_VERSION); } static void diff --git a/third-party/shttpd/shttpd.c b/third-party/shttpd/shttpd.c index 8b66243cb..f75b160fb 100644 --- a/third-party/shttpd/shttpd.c +++ b/third-party/shttpd/shttpd.c @@ -1760,7 +1760,7 @@ _shttpd_usage(const char *prog) (void) fprintf(stderr, "SHTTPD version %s (c) Sergey Lyubka\n" - "usage: %s [options] [config_file]\n", VERSION, prog); + "usage: %s [options] [config_file]\n", SHTTPD_VERSION, prog); #if !defined(NO_AUTH) fprintf(stderr, " -A \n"); diff --git a/third-party/shttpd/shttpd.h b/third-party/shttpd/shttpd.h index d475b06b7..f9d034685 100644 --- a/third-party/shttpd/shttpd.h +++ b/third-party/shttpd/shttpd.h @@ -104,6 +104,11 @@ void shttpd_wakeup(const void *priv); int shttpd_join(struct shttpd_ctx *, fd_set *, fd_set *, int *max_fd); int shttpd_socketpair(int sp[2]); + +extern int shttpd_edit_passwords(const char *fname, const char *domain, + const char *user, const char *pass); + + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/third-party/shttpd/standalone.c b/third-party/shttpd/standalone.c index 89ba661b4..dacb0614d 100644 --- a/third-party/shttpd/standalone.c +++ b/third-party/shttpd/standalone.c @@ -36,7 +36,7 @@ main(int argc, char *argv[]) if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'A') { if (argc != 6) _shttpd_usage(argv[0]); - exit(_shttpd_edit_passwords(argv[2],argv[3],argv[4],argv[5])); + exit(shttpd_edit_passwords(argv[2],argv[3],argv[4],argv[5])); } #endif /* NO_AUTH */ @@ -60,7 +60,7 @@ main(int argc, char *argv[]) "Cannot initialize SHTTPD context"); _shttpd_elog(E_LOG, NULL, "shttpd %s started on port(s) %s, serving %s", - VERSION, ctx->options[OPT_PORTS], ctx->options[OPT_ROOT]); + SHTTPD_VERSION, ctx->options[OPT_PORTS], ctx->options[OPT_ROOT]); while (exit_flag == 0) shttpd_poll(ctx, 10 * 1000);