Commit 6dc92dae authored by Ed "oddsock" Zaleski's avatar Ed "oddsock" Zaleski
Browse files

fixed some variable definitions to be ANSI compatable.

updated win32 project files with new files

svn path=/trunk/icecast/; revision=5761
parent 57dd5f71
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
auth_result auth_check_client(source_t *source, client_t *client) auth_result auth_check_client(source_t *source, client_t *client)
{ {
auth_t *authenticator = source->authenticator; auth_t *authenticator = source->authenticator;
auth_result result;
if(authenticator) { if(authenticator) {
/* This will look something like "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" */ /* This will look something like "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" */
...@@ -56,7 +57,7 @@ auth_result auth_check_client(source_t *source, client_t *client) ...@@ -56,7 +57,7 @@ auth_result auth_check_client(source_t *source, client_t *client)
username = userpass; username = userpass;
password = tmp+1; password = tmp+1;
auth_result result = authenticator->authenticate( result = authenticator->authenticate(
authenticator, username, password); authenticator, username, password);
if(result == AUTH_OK) if(result == AUTH_OK)
...@@ -118,12 +119,12 @@ static int get_line(FILE *file, char *buf, int len) ...@@ -118,12 +119,12 @@ static int get_line(FILE *file, char *buf, int len)
static char *get_hash(char *data, int len) static char *get_hash(char *data, int len)
{ {
struct MD5Context context; struct MD5Context context;
unsigned char digest[16];
MD5Init(&context); MD5Init(&context);
MD5Update(&context, data, len); MD5Update(&context, data, len);
unsigned char digest[16];
MD5Final(digest, &context); MD5Final(digest, &context);
return util_bin_to_hex(digest, 16); return util_bin_to_hex(digest, 16);
...@@ -179,11 +180,12 @@ static auth_result htpasswd_auth(auth_t *auth, char *username, char *password) ...@@ -179,11 +180,12 @@ static auth_result htpasswd_auth(auth_t *auth, char *username, char *password)
static auth_t *auth_get_htpasswd_auth(config_options_t *options) static auth_t *auth_get_htpasswd_auth(config_options_t *options)
{ {
auth_t *authenticator = calloc(1, sizeof(auth_t)); auth_t *authenticator = calloc(1, sizeof(auth_t));
htpasswd_auth_state *state;
authenticator->authenticate = htpasswd_auth; authenticator->authenticate = htpasswd_auth;
authenticator->free = htpasswd_clear; authenticator->free = htpasswd_clear;
htpasswd_auth_state *state = calloc(1, sizeof(htpasswd_auth_state)); state = calloc(1, sizeof(htpasswd_auth_state));
while(options) { while(options) {
if(!strcmp(options->name, "filename")) if(!strcmp(options->name, "filename"))
......
...@@ -106,6 +106,7 @@ void config_clear(ice_config_t *c) ...@@ -106,6 +106,7 @@ void config_clear(ice_config_t *c)
mount_proxy *mount, *nextmount; mount_proxy *mount, *nextmount;
aliases *alias, *nextalias; aliases *alias, *nextalias;
int i; int i;
config_options_t *option;
if (c->config_filename) if (c->config_filename)
free(c->config_filename); free(c->config_filename);
...@@ -172,7 +173,7 @@ void config_clear(ice_config_t *c) ...@@ -172,7 +173,7 @@ void config_clear(ice_config_t *c)
xmlFree(mount->fallback_mount); xmlFree(mount->fallback_mount);
xmlFree(mount->auth_type); xmlFree(mount->auth_type);
config_options_t *option = mount->auth_options; option = mount->auth_options;
while(option) { while(option) {
config_options_t *nextopt = option->next; config_options_t *nextopt = option->next;
xmlFree(option->name); xmlFree(option->name);
...@@ -451,6 +452,8 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node, ...@@ -451,6 +452,8 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node,
mount_proxy *mount = calloc(1, sizeof(mount_proxy)); mount_proxy *mount = calloc(1, sizeof(mount_proxy));
mount_proxy *current = configuration->mounts; mount_proxy *current = configuration->mounts;
mount_proxy *last=NULL; mount_proxy *last=NULL;
xmlNodePtr option;
config_options_t *last_option;
while(current) { while(current) {
last = current; last = current;
...@@ -506,8 +509,8 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node, ...@@ -506,8 +509,8 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node,
} }
else if (strcmp(node->name, "authentication") == 0) { else if (strcmp(node->name, "authentication") == 0) {
mount->auth_type = xmlGetProp(node, "type"); mount->auth_type = xmlGetProp(node, "type");
xmlNodePtr option = node->xmlChildrenNode; option = node->xmlChildrenNode;
config_options_t *last = NULL; last_option = NULL;
while(option != NULL) { while(option != NULL) {
if(strcmp(option->name, "option") == 0) { if(strcmp(option->name, "option") == 0) {
config_options_t *opt = malloc(sizeof(config_options_t)); config_options_t *opt = malloc(sizeof(config_options_t));
...@@ -525,11 +528,11 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node, ...@@ -525,11 +528,11 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node,
continue; continue;
} }
if(last) if(last_option)
last->next = opt; last_option->next = opt;
else else
mount->auth_options = opt; mount->auth_options = opt;
last = opt; last_option = opt;
} }
option = option->next; option = option->next;
} }
......
...@@ -13,19 +13,19 @@ Class2=CIcecast2winDlg ...@@ -13,19 +13,19 @@ Class2=CIcecast2winDlg
Class3=CAboutDlg Class3=CAboutDlg
ResourceCount=10 ResourceCount=10
Resource1=IDD_CONFIGDIALOG Resource1=IDD_SSTATUS
Resource2=IDR_MAINFRAME Resource2=IDR_MAINFRAME
Resource3=IDD_ICECAST2WIN_DIALOG Resource3=IDD_ABOUTBOX
Resource4=IDR_MENU3 Resource4=IDR_MENU2
Class4=CStatus Class4=CStatus
Resource5=IDD_STATSDIALOG Resource5=IDR_TRAY
Class5=CConfigTab Class5=CConfigTab
Class6=CStatsTab Class6=CStatsTab
Resource6=IDR_MENU2 Resource6=IDR_MENU4
Resource7=IDD_SSTATUS Resource7=IDD_ICECAST2WIN_DIALOG
Resource8=IDD_ABOUTBOX Resource8=IDD_CONFIGDIALOG
Resource9=IDR_TRAY Resource9=IDR_MENU3
Resource10=IDR_MENU4 Resource10=IDD_STATSDIALOG
[CLS:CIcecast2winApp] [CLS:CIcecast2winApp]
Type=0 Type=0
......
...@@ -93,6 +93,14 @@ SOURCE=..\src\admin.h ...@@ -93,6 +93,14 @@ SOURCE=..\src\admin.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\auth.c
# End Source File
# Begin Source File
SOURCE=..\src\auth.h
# End Source File
# Begin Source File
SOURCE=..\src\avl\avl.c SOURCE=..\src\avl\avl.c
# End Source File # End Source File
# Begin Source File # Begin Source File
...@@ -213,6 +221,14 @@ SOURCE=..\src\main.c ...@@ -213,6 +221,14 @@ SOURCE=..\src\main.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\src\md5.c
# End Source File
# Begin Source File
SOURCE=..\src\md5.h
# End Source File
# Begin Source File
SOURCE=..\src\os.h SOURCE=..\src\os.h
# End Source File # End Source File
# Begin Source File # Begin Source File
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment