changeset 207:063e31ae8f92 trunk

[svn] Properly zero out proxy configuration strings if no value is retrieved, otherwise we crash and burn on shutdown.
author chainsaw
date Fri, 03 Nov 2006 15:33:42 -0800
parents f258fef5c5fc
children d58fe97fcfd1
files ChangeLog src/flac112/plugin.c src/flac113/plugin.c
diffstat 3 files changed, 23 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Nov 03 14:57:45 2006 -0800
+++ b/ChangeLog	Fri Nov 03 15:33:42 2006 -0800
@@ -1,3 +1,11 @@
+2006-11-03 22:57:45 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [412]
+  - spelling. just check it.
+  
+  trunk/src/paranormal/presets/Makefile |    2 +-
+  1 file changed, 1 insertion(+), 1 deletion(-)
+
+
 2006-11-03 22:54:55 +0000  William Pitcock <nenolod@nenolod.net>
   revision [410]
   - yield back to the scheduler after processing a frame (maybe this will make paranormal be nicer.)
--- a/src/flac112/plugin.c	Fri Nov 03 14:57:45 2006 -0800
+++ b/src/flac112/plugin.c	Fri Nov 03 15:33:42 2006 -0800
@@ -280,15 +280,18 @@
 	decoder_ = decoder_func_table_ -> new_decoder();
 
 	bmp_cfg_db_get_bool(db, NULL, "use_proxy", &flac_cfg.stream.use_proxy);
-	bmp_cfg_db_get_string(db, NULL, "proxy_host", &flac_cfg.stream.proxy_host);
+	if(!bmp_cfg_db_get_string(db, NULL, "proxy_host", &flac_cfg.stream.proxy_host))
+		flac_cfg.stream.proxy_host = NULL;
 	bmp_cfg_db_get_string(db, NULL, "proxy_port", &tmp);
 
 	if (tmp != NULL)
 		flac_cfg.stream.proxy_port = atoi(tmp);
 
 	bmp_cfg_db_get_bool(db, NULL, "proxy_use_auth", &flac_cfg.stream.proxy_use_auth);
-	bmp_cfg_db_get_string(db, NULL, "proxy_user", &flac_cfg.stream.proxy_user);
-	bmp_cfg_db_get_string(db, NULL, "proxy_pass", &flac_cfg.stream.proxy_pass);
+	if(!bmp_cfg_db_get_string(db, NULL, "proxy_user", &flac_cfg.stream.proxy_user))
+		flac_cfg.stream.proxy_user = NULL;
+	if(!bmp_cfg_db_get_string(db, NULL, "proxy_pass", &flac_cfg.stream.proxy_pass))
+		flac_cfg.stream.proxy_pass = NULL;
 
 	bmp_cfg_db_close(db);
 }
--- a/src/flac113/plugin.c	Fri Nov 03 14:57:45 2006 -0800
+++ b/src/flac113/plugin.c	Fri Nov 03 15:33:42 2006 -0800
@@ -247,12 +247,18 @@
 	bmp_cfg_db_get_bool(db, "flac", "stream.use_udp_channel", &flac_cfg.stream.use_udp_channel);
 
 	bmp_cfg_db_get_bool(db, NULL, "use_proxy", &flac_cfg.stream.use_proxy);
-	bmp_cfg_db_get_string(db, NULL, "proxy_host", &flac_cfg.stream.proxy_host);
+	if(!bmp_cfg_db_get_string(db, NULL, "proxy_host", &flac_cfg.stream.proxy_host))
+		flac_cfg.stream.proxy_host = NULL;
+
 	bmp_cfg_db_get_string(db, NULL, "proxy_port", &tmp);
+	if (tmp != NULL)
+                flac_cfg.stream.proxy_port = atoi(tmp);
 
 	bmp_cfg_db_get_bool(db, NULL, "proxy_use_auth", &flac_cfg.stream.proxy_use_auth);
-	bmp_cfg_db_get_string(db, NULL, "proxy_user", &flac_cfg.stream.proxy_user);
-	bmp_cfg_db_get_string(db, NULL, "proxy_pass", &flac_cfg.stream.proxy_pass);
+	if(!bmp_cfg_db_get_string(db, NULL, "proxy_user", &flac_cfg.stream.proxy_user))
+		flac_cfg.stream.proxy_user = NULL;
+	if(!bmp_cfg_db_get_string(db, NULL, "proxy_pass", &flac_cfg.stream.proxy_pass))
+		flac_cfg.stream.proxy_pass = NULL;
 
 	decoder_ = FLAC__stream_decoder_new();
 	bmp_cfg_db_close(db);