View | Details | Raw Unified | Return to bug 14017
Collapse All | Expand All

(-)xmms-scrobbler-0.3.8.1/gtkstuff.c (-10 / +58 lines)
Lines 15-23 Link Here
15
#include <string.h>
15
#include <string.h>
16
#include "config.h"
16
#include "config.h"
17
#include "md5.h"
17
#include "md5.h"
18
#include "tags/include/unicode.h"
18
19
19
static GtkWidget 	*eduname,
20
static GtkWidget 	*eduname,
20
			*edpwd;
21
			*edpwd,
22
			*edenc,
23
			*edprx;
21
static int errorbox_done;
24
static int errorbox_done;
22
void about_show(void)
25
void about_show(void)
23
{
26
{
Lines 115-120 static void saveconfig(GtkWidget *wid, g Link Here
115
118
116
	const char *pwd = gtk_entry_get_text(GTK_ENTRY(edpwd));
119
	const char *pwd = gtk_entry_get_text(GTK_ENTRY(edpwd));
117
	const char *uid = gtk_entry_get_text(GTK_ENTRY(eduname));
120
	const char *uid = gtk_entry_get_text(GTK_ENTRY(eduname));
121
	const char *enc = gtk_entry_get_text(GTK_ENTRY(edenc));
122
	const char *prx = gtk_entry_get_text(GTK_ENTRY(edprx));
123
124
	g_free(tags_encoding);
125
	tags_encoding = g_strdup(enc);
118
126
119
	if ((cfgfile = xmms_cfg_open_default_file())) {
127
	if ((cfgfile = xmms_cfg_open_default_file())) {
120
	
128
	
Lines 130-135 static void saveconfig(GtkWidget *wid, g Link Here
130
			xmms_cfg_write_string(cfgfile, "audioscrobbler", "password",
138
			xmms_cfg_write_string(cfgfile, "audioscrobbler", "password",
131
					(char *)hexify(md5pword, sizeof(md5pword)));
139
					(char *)hexify(md5pword, sizeof(md5pword)));
132
		}
140
		}
141
142
		xmms_cfg_write_string(cfgfile, "audioscrobbler", "encoding", (char *)enc);
143
		if (strcmp(prx, ""))
144
			xmms_cfg_write_string(cfgfile, "audioscrobbler", "proxy", (char *)prx);
145
		
133
#ifdef MAKE_XMMS
146
#ifdef MAKE_XMMS
134
		xmms_cfg_write_default_file(cfgfile);
147
		xmms_cfg_write_default_file(cfgfile);
135
#endif
148
#endif
Lines 147-154 void configure_dialog(void) Link Here
147
			*hbox,
160
			*hbox,
148
			*unhbox,
161
			*unhbox,
149
			*pwhbox,
162
			*pwhbox,
163
			*enhbox,
164
			*prhbox,
150
			*lblun,
165
			*lblun,
151
			*lblpw,
166
			*lblpw,
167
			*lblen,
168
			*lblpr,
152
			*frame;
169
			*frame;
153
			
170
			
154
	ConfigFile 	*cfgfile;
171
	ConfigFile 	*cfgfile;
Lines 184-193 void configure_dialog(void) Link Here
184
	gtk_entry_set_visibility(GTK_ENTRY(edpwd), FALSE);
201
	gtk_entry_set_visibility(GTK_ENTRY(edpwd), FALSE);
185
	gtk_box_pack_start(GTK_BOX(pwhbox), lblpw, FALSE, FALSE, 3);
202
	gtk_box_pack_start(GTK_BOX(pwhbox), lblpw, FALSE, FALSE, 3);
186
	gtk_box_pack_start(GTK_BOX(pwhbox), edpwd, FALSE, FALSE, 3);
203
	gtk_box_pack_start(GTK_BOX(pwhbox), edpwd, FALSE, FALSE, 3);
187
	
204
205
	enhbox = gtk_hbox_new(FALSE, 0);
206
	edenc = gtk_entry_new();
207
	lblen = gtk_label_new("Tags encoding");
208
	gtk_box_pack_start(GTK_BOX(enhbox), lblen, FALSE, FALSE, 3);
209
	gtk_box_pack_start(GTK_BOX(enhbox), edenc, FALSE, FALSE, 3);
210
	
211
	prhbox = gtk_hbox_new(FALSE, 0);
212
	edprx = gtk_entry_new();
213
	lblpr = gtk_label_new("Proxy server");
214
	gtk_box_pack_start(GTK_BOX(prhbox), lblpr, FALSE, FALSE, 3);
215
	gtk_box_pack_start(GTK_BOX(prhbox), edprx, FALSE, FALSE, 3);
216
188
	gtk_box_pack_start(GTK_BOX(vbox), unhbox, FALSE, FALSE, 3);
217
	gtk_box_pack_start(GTK_BOX(vbox), unhbox, FALSE, FALSE, 3);
189
	gtk_box_pack_start(GTK_BOX(vbox), pwhbox, FALSE, FALSE, 3);
218
	gtk_box_pack_start(GTK_BOX(vbox), pwhbox, FALSE, FALSE, 3);
190
	
219
	gtk_box_pack_start(GTK_BOX(vbox), enhbox, FALSE, FALSE, 3);
220
	gtk_box_pack_start(GTK_BOX(vbox), prhbox, FALSE, FALSE, 3);
221
222
191
	hbox = gtk_hbox_new(FALSE, 0);
223
	hbox = gtk_hbox_new(FALSE, 0);
192
224
193
	btnok = gtk_button_new_with_label("OK");
225
	btnok = gtk_button_new_with_label("OK");
Lines 202-218 void configure_dialog(void) Link Here
202
	
234
	
203
	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 3);
235
	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 3);
204
236
205
	frame = gtk_frame_new(" The plugin will have to be restarted for changes to take effect! ");
237
	frame = gtk_frame_new(" The plugin will have to be restarted for username/password and proxy changes to take effect! ");
206
	gtk_container_add(GTK_CONTAINER(frame), vbox);
238
	gtk_container_add(GTK_CONTAINER(frame), vbox);
207
	gtk_container_add(GTK_CONTAINER(cnfdlg), frame);
239
	gtk_container_add(GTK_CONTAINER(cnfdlg), frame);
208
	if ((cfgfile = xmms_cfg_open_default_file())) {
240
	if ((cfgfile = xmms_cfg_open_default_file())) {
209
		gchar *username = NULL;
241
		gchar *entry;
210
		xmms_cfg_read_string(cfgfile, "audioscrobbler", "username",
242
211
			&username);
243
		entry = NULL;
212
		if (username) {
244
		xmms_cfg_read_string(cfgfile, "audioscrobbler", "username", &entry);
213
			gtk_entry_set_text(GTK_ENTRY(eduname), username);
245
		if (entry) {
214
			g_free(username);
246
			gtk_entry_set_text(GTK_ENTRY(eduname), entry);
247
			g_free(entry);
248
		}
249
250
		entry = NULL;
251
		xmms_cfg_read_string(cfgfile, "audioscrobbler", "encoding", &entry);
252
		if (entry) {
253
			gtk_entry_set_text(GTK_ENTRY(edenc), entry);
254
			g_free(entry);
215
		}
255
		}
256
257
		entry = NULL;
258
		xmms_cfg_read_string(cfgfile, "audioscrobbler", "proxy", &entry);
259
		if (entry) {
260
			gtk_entry_set_text(GTK_ENTRY(edprx), entry);
261
			g_free(entry);
262
		}
263
216
		xmms_cfg_free(cfgfile);
264
		xmms_cfg_free(cfgfile);
217
	}
265
	}
218
	
266
	
(-)xmms-scrobbler-0.3.8.1/scrobbler.c (-2 / +177 lines)
Lines 42-47 static char *sc_submit_url, Link Here
42
		sc_curl_errbuf[CURL_ERROR_SIZE],
42
		sc_curl_errbuf[CURL_ERROR_SIZE],
43
		*sc_major_error;
43
		*sc_major_error;
44
44
45
char* proxy_server = NULL;
46
45
static void dump_queue();
47
static void dump_queue();
46
48
47
/* Error functions */
49
/* Error functions */
Lines 227-232 static void hexify(char *pass, int len) Link Here
227
229
228
static int sc_handshake(void)
230
static int sc_handshake(void)
229
{
231
{
232
	pdebug("Handshaking directly", DEBUG);
233
	int status;
234
	char buf[4096];
235
	CURL *curl;
236
237
	snprintf(buf, sizeof(buf), "%s/?hs=true&p=%s&c=%s&v=%s&u=%s",
238
			SCROBBLER_HS_URL, SCROBBLER_VERSION,
239
			SCROBBLER_CLI_ID, VERSION, sc_username);
240
241
	curl = curl_easy_init();
242
	curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1);
243
	curl_easy_setopt(curl, CURLOPT_URL, buf);
244
	curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, 
245
			sc_store_res);
246
	memset(sc_curl_errbuf, 0, sizeof(sc_curl_errbuf));
247
	curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, sc_curl_errbuf);
248
	curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
249
	status = curl_easy_perform(curl);
250
	curl_easy_cleanup(curl);
251
252
	sc_hs_timeout = time(NULL) + SCROBBLER_HS_WAIT;
253
254
	if (status) {
255
		pdebug(sc_curl_errbuf, DEBUG);
256
		sc_hs_errors++;
257
		sc_free_res();
258
		return -1;
259
	}
260
261
	if (sc_parse_hs_res()) {
262
		sc_hs_errors++;
263
		sc_free_res();
264
		return -1;
265
	}
266
267
	if (sc_challenge_hash != NULL) {
268
		md5_state_t md5state;
269
		unsigned char md5pword[16];
270
		
271
		md5_init(&md5state);
272
		/*pdebug(fmt_vastr("Pass Hash: %s", sc_password), DEBUG);*/
273
		md5_append(&md5state, (unsigned const char *)sc_password,
274
				strlen(sc_password));
275
		/*pdebug(fmt_vastr("Challenge Hash: %s", sc_challenge_hash), DEBUG);*/
276
		md5_append(&md5state, (unsigned const char *)sc_challenge_hash,
277
				strlen(sc_challenge_hash));
278
		md5_finish(&md5state, md5pword);
279
		hexify(md5pword, sizeof(md5pword));
280
		/*pdebug(fmt_vastr("Response Hash: %s", sc_response_hash), DEBUG);*/
281
	}
282
283
	sc_hs_errors = 0;
284
	sc_hs_status = 1;
285
286
	sc_free_res();
287
288
	pdebug(fmt_vastr("submiturl: %s - interval: %d", 
289
				sc_submit_url, sc_submit_interval), DEBUG);
290
291
	return 0;
292
}
293
294
static int sc_handshake_proxy(void)
295
{
296
	pdebug("Handshaking through proxy", DEBUG);
297
	if (!proxy_server)
298
	{
299
		pdebug("No proxy specified", DEBUG);
300
		sc_hs_errors++;
301
		sc_free_res();
302
		return -1;
303
	}
304
	pdebug(proxy_server, DEBUG);
305
230
	int status;
306
	int status;
231
	char buf[4096];
307
	char buf[4096];
232
	CURL *curl;
308
	CURL *curl;
Lines 240-245 static int sc_handshake(void) Link Here
240
	curl_easy_setopt(curl, CURLOPT_URL, buf);
316
	curl_easy_setopt(curl, CURLOPT_URL, buf);
241
	curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, 
317
	curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, 
242
			sc_store_res);
318
			sc_store_res);
319
	curl_easy_setopt(curl, CURLOPT_PROXY, proxy_server);
320
	
243
	memset(sc_curl_errbuf, 0, sizeof(sc_curl_errbuf));
321
	memset(sc_curl_errbuf, 0, sizeof(sc_curl_errbuf));
244
	curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, sc_curl_errbuf);
322
	curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, sc_curl_errbuf);
245
	curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
323
	curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
Lines 399-405 static int sc_generateentry(GString *sub Link Here
399
	i = 0;
477
	i = 0;
400
#ifdef ALLOW_MULTIPLE
478
#ifdef ALLOW_MULTIPLE
401
	q_peekall(1);
479
	q_peekall(1);
402
	while ((item = q_peekall(0)) && i < 10) {
480
	while ((item = q_peekall(0)) /* && i < 10 */ ) {
403
#else
481
#else
404
		item = q_peek();
482
		item = q_peek();
405
#endif
483
#endif
Lines 427-432 static int sc_generateentry(GString *sub Link Here
427
505
428
static int sc_submitentry(gchar *entry)
506
static int sc_submitentry(gchar *entry)
429
{
507
{
508
	pdebug("Submitting directly", DEBUG);
509
	CURL *curl;
510
	/* struct HttpPost *post = NULL , *last = NULL; */
511
	int status;
512
        GString *submission;
513
514
	curl = curl_easy_init();
515
	curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1);
516
	curl_easy_setopt(curl, CURLOPT_URL, sc_submit_url);
517
	curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,
518
			sc_store_res);
519
	curl_easy_setopt(curl, CURLOPT_USERAGENT, USER_AGENT);
520
	curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
521
	/*cfa(&post, &last, "debug", "failed");*/
522
523
	/*pdebug(fmt_vastr("Username: %s", sc_username), DEBUG);*/
524
        submission = g_string_new("u=");
525
        g_string_append(submission,(gchar *)sc_username);
526
527
	/*pdebug(fmt_vastr("Response Hash: %s", sc_response_hash), DEBUG);*/
528
        g_string_append(submission,"&s=");
529
        g_string_append(submission,(gchar *)sc_response_hash);
530
531
	g_string_append(submission, entry);
532
533
	curl_easy_setopt(curl, CURLOPT_POSTFIELDS, (char *)submission->str);
534
	memset(sc_curl_errbuf, 0, sizeof(sc_curl_errbuf));
535
	curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, sc_curl_errbuf);
536
537
	/*
538
	curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
539
	curl_easy_setopt(curl, CURLOPT_TIMEOUT, SCROBBLER_SB_WAIT);
540
	*/
541
542
	status = curl_easy_perform(curl);
543
544
	curl_easy_cleanup(curl);
545
546
        g_string_free(submission,TRUE);
547
548
	if (status) {
549
		pdebug(sc_curl_errbuf, DEBUG);
550
		sc_sb_errors++;
551
		sc_free_res();
552
		return -1;
553
	}
554
555
	if (sc_parse_sb_res()) {
556
		sc_sb_errors++;
557
		sc_free_res();
558
		pdebug(fmt_vastr("Retrying in %d secs, %d elements in queue",
559
					sc_submit_interval, q_len()), DEBUG);
560
		return -1;
561
	}
562
	sc_free_res();
563
	return 0;
564
}
565
566
static int sc_submitentry_proxy(gchar *entry)
567
{
568
	pdebug("Submitting through proxy", DEBUG);
569
	if (!proxy_server)
570
	{
571
		pdebug("No proxy specified", DEBUG);
572
		sc_sb_errors++;
573
		sc_free_res();
574
		return -1;		
575
	}
576
	pdebug(proxy_server, DEBUG);
577
430
	CURL *curl;
578
	CURL *curl;
431
	/* struct HttpPost *post = NULL , *last = NULL; */
579
	/* struct HttpPost *post = NULL , *last = NULL; */
432
	int status;
580
	int status;
Lines 439-444 static int sc_submitentry(gchar *entry) Link Here
439
			sc_store_res);
587
			sc_store_res);
440
	curl_easy_setopt(curl, CURLOPT_USERAGENT, USER_AGENT);
588
	curl_easy_setopt(curl, CURLOPT_USERAGENT, USER_AGENT);
441
	curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
589
	curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
590
	curl_easy_setopt(curl, CURLOPT_PROXY, proxy_server);
442
	/*cfa(&post, &last, "debug", "failed");*/
591
	/*cfa(&post, &last, "debug", "failed");*/
443
592
444
	/*pdebug(fmt_vastr("Username: %s", sc_username), DEBUG);*/
593
	/*pdebug(fmt_vastr("Username: %s", sc_username), DEBUG);*/
Lines 527-532 static void sc_handlequeue(pthread_mutex Link Here
527
676
528
				sc_sb_errors = 0;
677
				sc_sb_errors = 0;
529
			}
678
			}
679
			else
680
			{
681
				if(!sc_submitentry_proxy(submitentry->str))
682
				{
683
					pthread_mutex_lock(&mutex);
684
	
685
#ifdef ALLOW_MULTIPLE
686
					q_free();
687
#else
688
					q_get();
689
#endif
690
					/*
691
					* This should make sure that the queue doesn't
692
					* get submitted multiple times on a nasty
693
					* segfault...
694
					*/
695
					dump_queue();
696
	
697
					pthread_mutex_unlock(&mutex);
698
	
699
					sc_sb_errors = 0;
700
				}
701
702
			}
530
			if(sc_sb_errors)
703
			if(sc_sb_errors)
531
			{
704
			{
532
				if(sc_sb_errors < 5)
705
				if(sc_sb_errors < 5)
Lines 707-713 static void sc_checkhandshake(void) Link Here
707
		return;
880
		return;
708
	if (sc_hs_timeout < time(NULL))
881
	if (sc_hs_timeout < time(NULL))
709
	{
882
	{
710
		sc_handshake();
883
		if (sc_handshake())
884
			sc_handshake_proxy();
885
		
711
886
712
		if(sc_hs_errors)
887
		if(sc_hs_errors)
713
		{
888
		{
(-)xmms-scrobbler-0.3.8.1/scrobbler.h (+2 lines)
Lines 7-10 void sc_cleaner(void); Link Here
7
int sc_catch_error(void);
7
int sc_catch_error(void);
8
char *sc_fetch_error(void);
8
char *sc_fetch_error(void);
9
void sc_clear_error(void);
9
void sc_clear_error(void);
10
11
extern char* proxy_server;
10
#endif
12
#endif
(-)xmms-scrobbler-0.3.8.1/tags/include/unicode.h (+2 lines)
Lines 26-29 void iso88591_to_utf8(unsigned char *, s Link Here
26
void utf16bom_to_utf8(unsigned char *, size_t, unsigned char **);
26
void utf16bom_to_utf8(unsigned char *, size_t, unsigned char **);
27
void utf16be_to_utf8(unsigned char *, size_t, unsigned char **);
27
void utf16be_to_utf8(unsigned char *, size_t, unsigned char **);
28
void utf16le_to_utf8(unsigned char *, size_t, unsigned char **);
28
void utf16le_to_utf8(unsigned char *, size_t, unsigned char **);
29
30
extern char *tags_encoding;
29
#endif
31
#endif
(-)xmms-scrobbler-0.3.8.1/tags/unicode.c (+81 lines)
Lines 21-29 Link Here
21
#include <stdlib.h>
21
#include <stdlib.h>
22
#include <wchar.h>
22
#include <wchar.h>
23
#include <string.h>
23
#include <string.h>
24
#include <iconv.h>
25
#include <glib.h>
26
#include <errno.h>
24
#include "include/endian.h"
27
#include "include/endian.h"
25
#include "include/unicode.h"
28
#include "include/unicode.h"
26
29
30
char *tags_encoding = NULL;
31
32
/*
33
 * generic iconv function
34
 * taken from gentoo libxmms - looks nice and works
35
 *
36
 * Tue Dec 13 22:15:06 CET 2005 - Kosma Moczek <kosmam@op.pl>
37
 */
38
static char* generic_iconv(const unsigned char *string, size_t insize, char *from, char *to)
39
{
40
	size_t outleft, outsize;
41
	iconv_t cd;
42
	char *out, *outptr;
43
	char *input = (char *) string;
44
45
	if (!string) return NULL;
46
47
// 	g_message("converting %s from %s to %s (%u)", string, from, to, insize);
48
49
	/* check if the conversion is needed */
50
	if (!strcmp(from,to)) return g_strdup(string);
51
52
	if ((cd = iconv_open(to, from)) == (iconv_t)-1)
53
	{
54
		g_warning("convert_string(): Conversion not supported. "
55
		          "Charsets: %s -> %s", from, to);
56
		return g_strdup(string);
57
	}
58
59
	/* Due to a GLIBC bug, round outbuf_size up to a multiple of 4 */
60
	/* + 1 for nul in case len == 1 */
61
	outsize = ((insize + 3) & ~3) + 1;
62
	out = g_malloc(outsize);
63
	outleft = outsize - 1;
64
	outptr = out;
65
66
 retry:
67
	if (iconv(cd, &input, &insize, &outptr, &outleft) == -1)
68
	{
69
		int used;
70
		switch (errno)
71
		{
72
			case E2BIG:
73
				used = outptr - out;
74
				outsize = (outsize - 1) * 2 + 1;
75
				out = g_realloc(out, outsize);
76
				outptr = out + used;
77
				outleft = outsize - 1 - used;
78
				goto retry;
79
			case EINVAL:
80
				/* incomplete multibyte sequence (at the end of string)
81
				 * - just quit, nothing to do here */
82
				break;
83
			case EILSEQ:
84
				/* Invalid sequence, try to get the
85
                                   rest of the string */
86
				input++;
87
				insize--;
88
				goto retry;
89
			default:
90
				g_warning("convert_string(): Conversion failed. "
91
					  "Inputstring: %s; Error: %s",
92
					  string, strerror(errno));
93
				break;
94
		}
95
	}
96
	*outptr = '\0';
97
98
	iconv_close(cd);
99
	return out;
100
}
101
27
wchar_t *utf8_to_wchar(unsigned char *utf, size_t memsize)
102
wchar_t *utf8_to_wchar(unsigned char *utf, size_t memsize)
28
{
103
{
29
	int i, j = 0;
104
	int i, j = 0;
Lines 141-146 unsigned char *wchar_to_utf8(wchar_t *wc Link Here
141
void iso88591_to_utf8(unsigned char *iso, size_t memsize,
216
void iso88591_to_utf8(unsigned char *iso, size_t memsize,
142
				unsigned char **utf)
217
				unsigned char **utf)
143
{
218
{
219
	/* don't run recoder of setting is incomplete */
220
	if (tags_encoding && *tags_encoding) {
221
		*utf = generic_iconv(iso, memsize, tags_encoding, "UTF-8");
222
		return;
223
	}
224
	
144
	int i;
225
	int i;
145
	wchar_t *wchar;
226
	wchar_t *wchar;
146
227
(-)xmms-scrobbler-0.3.8.1/xmms_scrobbler.c (-1 / +25 lines)
Lines 59-65 static GeneralPlugin xmms_scrobbler = Link Here
59
59
60
static void init(void)
60
static void init(void)
61
{
61
{
62
	char *username = NULL, *password = NULL;
62
	char *username = NULL, *password = NULL, *encoding = NULL, *proxy = NULL;
63
	ConfigFile *cfgfile;
63
	ConfigFile *cfgfile;
64
	going = 1;
64
	going = 1;
65
65
Lines 68-73 static void init(void) Link Here
68
				&username);
68
				&username);
69
		xmms_cfg_read_string(cfgfile, "audioscrobbler", "password",
69
		xmms_cfg_read_string(cfgfile, "audioscrobbler", "password",
70
				&password);
70
				&password);
71
		xmms_cfg_read_string(cfgfile, "audioscrobbler", "encoding",
72
				&encoding);
73
		xmms_cfg_read_string(cfgfile, "audioscrobbler", "proxy",
74
				&proxy);
71
		xmms_cfg_free(cfgfile);
75
		xmms_cfg_free(cfgfile);
72
	}
76
	}
73
	if ((!username || !password) || (!*username || !*password)) {
77
	if ((!username || !password) || (!*username || !*password)) {
Lines 76-81 static void init(void) Link Here
76
		going = 0;
80
		going = 0;
77
		return;
81
		return;
78
	}
82
	}
83
	if (encoding) {
84
		tags_encoding = g_strdup(encoding);
85
		g_free(encoding);
86
	}
87
	if (proxy) {
88
		proxy_server = g_strdup(proxy);
89
		g_free(proxy);
90
		pdebug(fmt_vastr("Got proxy %s from cfg", proxy_server), DEBUG);
91
	}
92
	else
93
	{
94
		proxy_server = getenv("HTTP_PROXY");
95
		if (proxy_server) {
96
			pdebug(fmt_vastr("Got proxy %s from getenv(\"HTTP_PROXY\")", 
97
				proxy_server), DEBUG);
98
		} else {
99
			pdebug("No proxy specified", DEBUG);
100
		}
101
	}
102
	
79
	sc_init(username, password);
103
	sc_init(username, password);
80
	g_free(username);
104
	g_free(username);
81
	g_free(password);
105
	g_free(password);

Return to bug 14017