if (http.isHeader(PCX_HS_POS))
streamPos = atoi(arg);
else
- Servent::readICYHeader(http, info, NULL);
+ Servent::readICYHeader(http, info, NULL, 0);
LOG_CHANNEL("Channel fetch: %s",http.cmdLine);
}
return 0;
}
//-----------------------------------------
-void HTTP::getAuthUserPass(char *user, char *pass)
+void HTTP::getAuthUserPass(char *user, char *pass, size_t szUser, size_t szPass)
{
if (arg)
{
{
*s = 0;
if (user)
- strcpy(user,str.cstr());
+ {
+ strncpy(user, str.cstr(), szUser);
+ user[szUser-1] = '\0';
+ }
if (pass)
- strcpy(pass,s+1);
+ {
+ strncpy(pass, s+1, szPass);
+ pass[szPass-1] = '\0';
+ }
}
}
}
char *getArgStr();
int getArgInt();
- void getAuthUserPass(char *, char *);
+ void getAuthUserPass(char *, char *, size_t, size_t);
char cmdLine[8192],*arg;
void sendPCPChannel();
void checkPCPComms(Channel *, AtomStream &);
- static void readICYHeader(HTTP &, ChanInfo &, char *);
+ static void readICYHeader(HTTP &, ChanInfo &, char *, size_t);
bool canStream(Channel *);
bool isConnected() {return status == S_CONNECTED;}
{
case ServMgr::AUTH_HTTPBASIC:
if (http.isHeader("Authorization"))
- http.getAuthUserPass(user,pass);
+ http.getAuthUserPass(user, pass, sizeof(user), sizeof(pass));
break;
case ServMgr::AUTH_COOKIE:
if (http.isHeader("Cookie"))
}
// -----------------------------------
-void Servent::readICYHeader(HTTP &http, ChanInfo &info, char *pwd)
+void Servent::readICYHeader(HTTP &http, ChanInfo &info, char *pwd, size_t szPwd)
{
char *arg = http.getArgStr();
if (!arg) return;
info.desc.convertTo(String::T_UNICODE);
}else if (http.isHeader("Authorization"))
- http.getAuthUserPass(NULL,pwd);
+ http.getAuthUserPass(NULL, pwd, 0, sizeof(pwd));
else if (http.isHeader(PCX_HS_CHANNELID))
info.id.fromStr(arg);
else if (http.isHeader("ice-password"))
while (http.nextHeader())
{
LOG_DEBUG("ICY %s",http.cmdLine);
- readICYHeader(http,info,loginPassword.cstr());
+ readICYHeader(http, info, loginPassword.cstr(), loginPassword.MAX_LEN);
}
LOG_CHANNEL("Fetch HTTP: %s",http.cmdLine);
ChanInfo tmpInfo = ch->info;
- Servent::readICYHeader(http,ch->info,NULL);
+ Servent::readICYHeader(http, ch->info, NULL, 0);
if (!tmpInfo.name.isEmpty())
ch->info.name = tmpInfo.name;
//#define VERSION_EX 1
static const char *PCP_CLIENT_VERSION_EX_PREFIX = "IM"; // 2bytes only
static const int PCP_CLIENT_VERSION_EX_NUMBER = 27;
-static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0027-3)";
-static const char *PCX_VERSTRING_EX = "v0.1218(IM0027-3)";
+static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0027-4)";
+static const char *PCX_VERSTRING_EX = "v0.1218(IM0027-4)";
#endif
// ------------------------------------------------
<?xml version="1.0" encoding="shift_jis"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="corelib"
ProjectGUID="{7BCFE65B-8757-45F3-8DFB-1E7D683950D1}"
RootNamespace="corelib"
SccProjectName=""$/PeerCast.root/PeerCast", JCAAAAAA"
SccLocalPath="..\..\.."
SccProvider="MSSCCI:Microsoft Visual SourceSafe"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
<Tool
Name="VCCLCompilerTool"
Optimization="2"
- InlineFunctionExpansion="1"
+ InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="1"
+ EnableFiberSafeOptimizations="true"
AdditionalIncludeDirectories="../../,../../common"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
StringPooling="true"
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{00D364AE-DB2F-4109-A925-31B4F129D613}"
+ ProjectSection(SolutionItems) = preProject
+ memo.txt = memo.txt
+ EndProjectSection
+EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "corelib", "..\..\core\win32\lib\corelib.vcproj", "{7BCFE65B-8757-45F3-8DFB-1E7D683950D1}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Simple", "simple\Simple.vcproj", "{7D4833CE-1286-4587-9470-52E098B29C12}"
{7BCFE65B-8757-45F3-8DFB-1E7D683950D1} = {7BCFE65B-8757-45F3-8DFB-1E7D683950D1}
EndProjectSection
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{00D364AE-DB2F-4109-A925-31B4F129D613}"
- ProjectSection(SolutionItems) = preProject
- memo.txt = memo.txt
- EndProjectSection
-EndProject
Global
GlobalSection(SourceCodeControl) = preSolution
SccNumberOfProjects = 3
<?xml version="1.0" encoding="shift_jis"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="Simple"
ProjectGUID="{7D4833CE-1286-4587-9470-52E098B29C12}"
RootNamespace="Simple"
SccProjectName=""$/PeerCast.root/PeerCast", JCAAAAAA"
SccLocalPath="..\..\.."
SccProvider="MSSCCI:Microsoft Visual SourceSafe"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Simple___Win32_Private_Debug/PeerCast.pdb"
SubSystem="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
Description="Copy exe to program files"
CommandLine="copy debug\peercast.exe "c:\program files\peercast""
InlineFunctionExpansion="1"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="0"
+ EnableFiberSafeOptimizations="true"
AdditionalIncludeDirectories="../../../core,../../../core/common"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
StringPooling="true"
AdditionalLibraryDirectories=""C:\Visual Studio Projects\PeCa-IMAS7651\core\win32\lib\Release""
ProgramDatabaseFile=".\Release/PeerCast.pdb"
SubSystem="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
Description="Copy exe to pimp"
CommandLine="copy release\peercast.exe ..\pimp\
"
SuppressStartupBanner="true"
ProgramDatabaseFile=".\Simple___Win32_Private_Release/PeerCast.pdb"
SubSystem="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
Description="Copy exe to pimp & program files"
CommandLine="copy release\peercast.exe "c:\program files\peercast"
copy release\peercast.exe ..\pimp\
"
ProgramDatabaseFile=".\Debug/PeerCast.pdb"
SubSystem="2"
HeapReserveSize="4194304"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
Description="Copy exe to program files"
CommandLine="copy debug\peercast.exe "c:\program files\peercast""
if (http.isHeader(PCX_HS_POS))
streamPos = atoi(arg);
else
- Servent::readICYHeader(http, info, NULL);
+ Servent::readICYHeader(http, info, NULL, 0);
LOG_CHANNEL("Channel fetch: %s",http.cmdLine);
}
return 0;
}
//-----------------------------------------
-void HTTP::getAuthUserPass(char *user, char *pass)
+void HTTP::getAuthUserPass(char *user, char *pass, size_t szUser, size_t szPass)
{
if (arg)
{
{
*s = 0;
if (user)
- strcpy(user,str.cstr());
+ {
+ strncpy(user, str.cstr(), szUser);
+ user[szUser-1] = '\0';
+ }
if (pass)
- strcpy(pass,s+1);
+ {
+ strncpy(pass, s+1, szPass);
+ pass[szPass-1] = '\0';
+ }
}
}
}
char *getArgStr();
int getArgInt();
- void getAuthUserPass(char *, char *);
+ void getAuthUserPass(char *, char *, size_t, size_t);
char cmdLine[8192],*arg;
void sendPCPChannel();
void checkPCPComms(Channel *, AtomStream &);
- static void readICYHeader(HTTP &, ChanInfo &, char *);
+ static void readICYHeader(HTTP &, ChanInfo &, char *, size_t);
bool canStream(Channel *);
bool isConnected() {return status == S_CONNECTED;}
{
case ServMgr::AUTH_HTTPBASIC:
if (http.isHeader("Authorization"))
- http.getAuthUserPass(user,pass);
+ http.getAuthUserPass(user, pass, sizeof(user), sizeof(pass));
break;
case ServMgr::AUTH_COOKIE:
if (http.isHeader("Cookie"))
}
// -----------------------------------
-void Servent::readICYHeader(HTTP &http, ChanInfo &info, char *pwd)
+void Servent::readICYHeader(HTTP &http, ChanInfo &info, char *pwd, size_t szPwd)
{
char *arg = http.getArgStr();
if (!arg) return;
info.desc.convertTo(String::T_UNICODE);
}else if (http.isHeader("Authorization"))
- http.getAuthUserPass(NULL,pwd);
+ http.getAuthUserPass(NULL, pwd, 0, sizeof(pwd));
else if (http.isHeader(PCX_HS_CHANNELID))
info.id.fromStr(arg);
else if (http.isHeader("ice-password"))
while (http.nextHeader())
{
LOG_DEBUG("ICY %s",http.cmdLine);
- readICYHeader(http,info,loginPassword.cstr());
+ readICYHeader(http, info, loginPassword.cstr(), loginPassword.MAX_LEN);
}
LOG_CHANNEL("Fetch HTTP: %s",http.cmdLine);
ChanInfo tmpInfo = ch->info;
- Servent::readICYHeader(http,ch->info,NULL);
+ Servent::readICYHeader(http, ch->info, NULL, 0);
if (!tmpInfo.name.isEmpty())
ch->info.name = tmpInfo.name;
//#define VERSION_EX 1
static const char *PCP_CLIENT_VERSION_EX_PREFIX = "IM"; // 2bytes only
static const int PCP_CLIENT_VERSION_EX_NUMBER = 27;
-static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0027-3)";
-static const char *PCX_VERSTRING_EX = "v0.1218(IM0027-3)";
+static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0027-4)";
+static const char *PCX_VERSTRING_EX = "v0.1218(IM0027-4)";
#endif
// ------------------------------------------------
<?xml version="1.0" encoding="shift_jis"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="corelib"
ProjectGUID="{7BCFE65B-8757-45F3-8DFB-1E7D683950D1}"
RootNamespace="corelib"
SccProjectName=""$/PeerCast.root/PeerCast", JCAAAAAA"
SccLocalPath="..\..\.."
SccProvider="MSSCCI:Microsoft Visual SourceSafe"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
<Tool
Name="VCCLCompilerTool"
Optimization="2"
- InlineFunctionExpansion="1"
+ InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
+ FavorSizeOrSpeed="1"
+ EnableFiberSafeOptimizations="true"
AdditionalIncludeDirectories="../../,../../common"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
StringPooling="true"
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{00D364AE-DB2F-4109-A925-31B4F129D613}"
+ ProjectSection(SolutionItems) = preProject
+ memo.txt = memo.txt
+ EndProjectSection
+EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "corelib", "..\..\core\win32\lib\corelib.vcproj", "{7BCFE65B-8757-45F3-8DFB-1E7D683950D1}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Simple", "simple\Simple.vcproj", "{7D4833CE-1286-4587-9470-52E098B29C12}"
{7BCFE65B-8757-45F3-8DFB-1E7D683950D1} = {7BCFE65B-8757-45F3-8DFB-1E7D683950D1}
EndProjectSection
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{00D364AE-DB2F-4109-A925-31B4F129D613}"
- ProjectSection(SolutionItems) = preProject
- memo.txt = memo.txt
- EndProjectSection
-EndProject
Global
GlobalSection(SourceCodeControl) = preSolution
SccNumberOfProjects = 3
<?xml version="1.0" encoding="shift_jis"?>
<VisualStudioProject
ProjectType="Visual C++"
- Version="8.00"
+ Version="9.00"
Name="Simple"
ProjectGUID="{7D4833CE-1286-4587-9470-52E098B29C12}"
RootNamespace="Simple"
SccProjectName=""$/PeerCast.root/PeerCast", JCAAAAAA"
SccLocalPath="..\..\.."
SccProvider="MSSCCI:Microsoft Visual SourceSafe"
+ TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Simple___Win32_Private_Debug/PeerCast.pdb"
SubSystem="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
Description="Copy exe to program files"
CommandLine="copy debug\peercast.exe "c:\program files\peercast""
InlineFunctionExpansion="1"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="0"
+ EnableFiberSafeOptimizations="true"
AdditionalIncludeDirectories="../../../core,../../../core/common"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
StringPooling="true"
AdditionalLibraryDirectories=""C:\Visual Studio Projects\PeCa-IMAS7651\core\win32\lib\Release""
ProgramDatabaseFile=".\Release/PeerCast.pdb"
SubSystem="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
Description="Copy exe to pimp"
CommandLine="copy release\peercast.exe ..\pimp\
"
SuppressStartupBanner="true"
ProgramDatabaseFile=".\Simple___Win32_Private_Release/PeerCast.pdb"
SubSystem="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
Description="Copy exe to pimp & program files"
CommandLine="copy release\peercast.exe "c:\program files\peercast"
copy release\peercast.exe ..\pimp\
"
ProgramDatabaseFile=".\Debug/PeerCast.pdb"
SubSystem="2"
HeapReserveSize="4194304"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
Name="VCPostBuildEventTool"
Description="Copy exe to program files"
CommandLine="copy debug\peercast.exe "c:\program files\peercast""