1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 09:37:56 +00:00

(shttpd) replace VERSION with SHTTPD_VERSION.

(shttpd) make shttpd_edit_passwords() a public function for now to fix the build.
This commit is contained in:
Charles Kerr 2008-08-25 20:32:26 +00:00
parent 39541d4c5f
commit dcaf1f16ef
9 changed files with 15 additions and 10 deletions

View file

@ -371,7 +371,7 @@ startServer( tr_rpc_server * server )
if( !server->isPasswordEnabled ) if( !server->isPasswordEnabled )
unlink( passwd ); unlink( passwd );
else 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" ); argv[argc++] = tr_strdup( "appname-unused" );

View file

@ -350,7 +350,7 @@ _shttpd_send_authorization_request(struct conn *c)
* Edit the passwords file. * Edit the passwords file.
*/ */
int 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) const char *user, const char *pass)
{ {
int ret = EXIT_SUCCESS, found = 0; int ret = EXIT_SUCCESS, found = 0;

View file

@ -533,7 +533,7 @@ systray(void *arg)
cls.lpfnWndProc = (WNDPROC) WindowProc; cls.lpfnWndProc = (WNDPROC) WindowProc;
cls.hIcon = LoadIcon(NULL, IDI_APPLICATION); cls.hIcon = LoadIcon(NULL, IDI_APPLICATION);
cls.lpszClassName = "shttpd v." VERSION; cls.lpszClassName = "shttpd v." SHTTPD_VERSION;
if (!RegisterClass(&cls)) if (!RegisterClass(&cls))
_shttpd_elog(E_FATAL, NULL, "RegisterClass: %d", ERRNO); _shttpd_elog(E_FATAL, NULL, "RegisterClass: %d", ERRNO);

View file

@ -11,7 +11,7 @@
#ifndef CONFIG_HEADER_DEFINED #ifndef CONFIG_HEADER_DEFINED
#define 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 CONFIG_FILE "shttpd.conf" /* Configuration file */
#define HTPASSWD ".htpasswd" /* Passwords file name */ #define HTPASSWD ".htpasswd" /* Passwords file name */
#define URI_MAX 16384 /* Default max request size */ #define URI_MAX 16384 /* Default max request size */
@ -24,6 +24,6 @@
#define EXPIRE_TIME 3600 /* Expiration time, seconds */ #define EXPIRE_TIME 3600 /* Expiration time, seconds */
#define ENV_MAX 4096 /* Size of environment block */ #define ENV_MAX 4096 /* Size of environment block */
#define CGI_ENV_VARS 64 /* Maximum vars passed to CGI */ #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 */ #endif /* CONFIG_HEADER_DEFINED */

View file

@ -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_check_authorization(struct conn *c, const char *path);
extern int _shttpd_is_authorized_for_put(struct conn *c); extern int _shttpd_is_authorized_for_put(struct conn *c);
extern void _shttpd_send_authorization_request(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); const char *user, const char *pass);
/* /*

View file

@ -13,7 +13,7 @@
const char * const char *
shttpd_version(void) shttpd_version(void)
{ {
return (VERSION); return (SHTTPD_VERSION);
} }
static void static void

View file

@ -1760,7 +1760,7 @@ _shttpd_usage(const char *prog)
(void) fprintf(stderr, (void) fprintf(stderr,
"SHTTPD version %s (c) Sergey Lyubka\n" "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) #if !defined(NO_AUTH)
fprintf(stderr, " -A <htpasswd_file> <realm> <user> <passwd>\n"); fprintf(stderr, " -A <htpasswd_file> <realm> <user> <passwd>\n");

View file

@ -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_join(struct shttpd_ctx *, fd_set *, fd_set *, int *max_fd);
int shttpd_socketpair(int sp[2]); 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 #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */

View file

@ -36,7 +36,7 @@ main(int argc, char *argv[])
if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'A') { if (argc > 1 && argv[1][0] == '-' && argv[1][1] == 'A') {
if (argc != 6) if (argc != 6)
_shttpd_usage(argv[0]); _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 */ #endif /* NO_AUTH */
@ -60,7 +60,7 @@ main(int argc, char *argv[])
"Cannot initialize SHTTPD context"); "Cannot initialize SHTTPD context");
_shttpd_elog(E_LOG, NULL, "shttpd %s started on port(s) %s, serving %s", _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) while (exit_flag == 0)
shttpd_poll(ctx, 10 * 1000); shttpd_poll(ctx, 10 * 1000);