Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 220281
Collapse All | Expand All

(-)peercast-0.1218+svn20080104/core/common/channel.cpp (-1 / +1 lines)
Lines 440-446 Link Here
440
		if (http.isHeader(PCX_HS_POS))
440
		if (http.isHeader(PCX_HS_POS))
441
			streamPos = atoi(arg);
441
			streamPos = atoi(arg);
442
		else
442
		else
443
			Servent::readICYHeader(http, info, NULL);
443
			Servent::readICYHeader(http, info, NULL, 0);
444
444
445
		LOG_CHANNEL("Channel fetch: %s",http.cmdLine);
445
		LOG_CHANNEL("Channel fetch: %s",http.cmdLine);
446
	}
446
	}
(-)peercast-0.1218+svn20080104/core/common/http.cpp (-5 / +9 lines)
Lines 102-108 Link Here
102
		return 0;
102
		return 0;
103
}
103
}
104
//-----------------------------------------
104
//-----------------------------------------
105
void HTTP::getAuthUserPass(char *user, char *pass)
105
void HTTP::getAuthUserPass(char *user, char *pass, size_t ulen, size_t plen)
106
{
106
{
107
	if (arg)
107
	if (arg)
108
	{
108
	{
Lines 119-128 Link Here
119
			if (s)
119
			if (s)
120
			{
120
			{
121
				*s = 0;
121
				*s = 0;
122
				if (user)
122
				if (user){
123
					strcpy(user,str.cstr());
123
					strncpy(user,str.cstr(), ulen);
124
				if (pass)
124
					user[ulen - 1] = 0;
125
					strcpy(pass,s+1);
125
				}
126
				if (pass){
127
					strncpy(pass,s+1, plen);
128
					pass[plen - 1] = 0;
129
				}
126
			}			
130
			}			
127
		}
131
		}
128
	}
132
	}
(-)peercast-0.1218+svn20080104/core/common/http.h (-1 / +1 lines)
Lines 176-182 Link Here
176
	char	*getArgStr();
176
	char	*getArgStr();
177
	int		getArgInt();
177
	int		getArgInt();
178
178
179
	void	getAuthUserPass(char *, char *);
179
	void	getAuthUserPass(char *, char *, size_t, size_t);
180
180
181
	char	cmdLine[8192],*arg;
181
	char	cmdLine[8192],*arg;
182
182
(-)peercast-0.1218+svn20080104/core/common/servent.h (-1 / +1 lines)
Lines 206-212 Link Here
206
	void	sendPCPChannel();
206
	void	sendPCPChannel();
207
	void	checkPCPComms(Channel *, AtomStream &);
207
	void	checkPCPComms(Channel *, AtomStream &);
208
208
209
	static void	readICYHeader(HTTP &, ChanInfo &, char *);
209
	static void	readICYHeader(HTTP &, ChanInfo &, char *, size_t);
210
	bool	canStream(Channel *);
210
	bool	canStream(Channel *);
211
211
212
	bool	isConnected() {return status == S_CONNECTED;}
212
	bool	isConnected() {return status == S_CONNECTED;}
(-)peercast-0.1218+svn20080104/core/common/servhs.cpp (-5 / +7 lines)
Lines 587-593 Link Here
587
		{
587
		{
588
			case ServMgr::AUTH_HTTPBASIC:
588
			case ServMgr::AUTH_HTTPBASIC:
589
				if (http.isHeader("Authorization"))
589
				if (http.isHeader("Authorization"))
590
					http.getAuthUserPass(user,pass);
590
					http.getAuthUserPass(user,pass, sizeof(user), sizeof(pass));
591
				break;
591
				break;
592
			case ServMgr::AUTH_COOKIE:
592
			case ServMgr::AUTH_COOKIE:
593
				if (http.isHeader("Cookie"))
593
				if (http.isHeader("Cookie"))
Lines 1405-1411 Link Here
1405
1405
1406
}
1406
}
1407
// -----------------------------------
1407
// -----------------------------------
1408
void Servent::readICYHeader(HTTP &http, ChanInfo &info, char *pwd)
1408
void Servent::readICYHeader(HTTP &http, ChanInfo &info, char *pwd, size_t plen)
1409
{
1409
{
1410
	char *arg = http.getArgStr();
1410
	char *arg = http.getArgStr();
1411
	if (!arg) return;
1411
	if (!arg) return;
Lines 1429-1436 Link Here
1429
		info.desc.set(arg,String::T_ASCII);
1429
		info.desc.set(arg,String::T_ASCII);
1430
		info.desc.convertTo(String::T_UNICODE);
1430
		info.desc.convertTo(String::T_UNICODE);
1431
1431
1432
	}else if (http.isHeader("Authorization"))
1432
	}else if (http.isHeader("Authorization")){
1433
		http.getAuthUserPass(NULL,pwd);
1433
		if(pwd)
1434
			http.getAuthUserPass(NULL,pwd, 0, plen);
1435
    }
1434
	else if (http.isHeader(PCX_HS_CHANNELID))
1436
	else if (http.isHeader(PCX_HS_CHANNELID))
1435
		info.id.fromStr(arg);
1437
		info.id.fromStr(arg);
1436
	else if (http.isHeader("ice-password"))
1438
	else if (http.isHeader("ice-password"))
Lines 1501-1507 Link Here
1501
	while (http.nextHeader())
1503
	while (http.nextHeader())
1502
	{
1504
	{
1503
		LOG_DEBUG("ICY %s",http.cmdLine);
1505
		LOG_DEBUG("ICY %s",http.cmdLine);
1504
		readICYHeader(http,info,loginPassword.cstr());
1506
		readICYHeader(http,info,loginPassword.cstr(), String::MAX_LEN);
1505
	}
1507
	}
1506
1508
1507
1509
(-)peercast-0.1218+svn20080104/core/common/url.cpp (-1 / +1 lines)
Lines 171-177 Link Here
171
				LOG_CHANNEL("Fetch HTTP: %s",http.cmdLine);
171
				LOG_CHANNEL("Fetch HTTP: %s",http.cmdLine);
172
172
173
				ChanInfo tmpInfo = ch->info;
173
				ChanInfo tmpInfo = ch->info;
174
				Servent::readICYHeader(http,ch->info,NULL);
174
				Servent::readICYHeader(http,ch->info,NULL, 0);
175
175
176
				if (!tmpInfo.name.isEmpty())
176
				if (!tmpInfo.name.isEmpty())
177
					ch->info.name = tmpInfo.name;
177
					ch->info.name = tmpInfo.name;

Return to bug 220281