fall through after getting header
This commit is contained in:
@@ -594,10 +594,16 @@ void ScreenPackages::HTTPUpdate()
|
|||||||
{
|
{
|
||||||
m_sStatus = "Waiting for header.";
|
m_sStatus = "Waiting for header.";
|
||||||
//We don't know if we are using unix-style or dos-style
|
//We don't know if we are using unix-style or dos-style
|
||||||
int HeaderEnd = m_sBUFFER.find("\n\n");
|
size_t iHeaderEnd = m_sBUFFER.find("\n\n");
|
||||||
if( HeaderEnd == m_sBUFFER.npos )
|
if( iHeaderEnd != m_sBUFFER.npos )
|
||||||
HeaderEnd = m_sBUFFER.find("\r\n\r\n");
|
iHeaderEnd += 2;
|
||||||
if( HeaderEnd == m_sBUFFER.npos )
|
else
|
||||||
|
{
|
||||||
|
iHeaderEnd = m_sBUFFER.find("\r\n\r\n");
|
||||||
|
if( iHeaderEnd != m_sBUFFER.npos )
|
||||||
|
iHeaderEnd += 4;
|
||||||
|
}
|
||||||
|
if( iHeaderEnd == m_sBUFFER.npos )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// "HTTP/1.1 200 OK"
|
// "HTTP/1.1 200 OK"
|
||||||
@@ -622,10 +628,9 @@ void ScreenPackages::HTTPUpdate()
|
|||||||
m_iTotalBytes = -1; //We don't know, so go until disconnect
|
m_iTotalBytes = -1; //We don't know, so go until disconnect
|
||||||
|
|
||||||
m_bGotHeader = true;
|
m_bGotHeader = true;
|
||||||
m_sBUFFER = m_sBUFFER.substr( HeaderEnd + 4 );
|
m_sBUFFER = m_sBUFFER.erase( 0, iHeaderEnd );
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if( m_bIsPackage )
|
if( m_bIsPackage )
|
||||||
{
|
{
|
||||||
m_iDownloaded += m_sBUFFER.length();
|
m_iDownloaded += m_sBUFFER.length();
|
||||||
@@ -666,7 +671,6 @@ void ScreenPackages::HTTPUpdate()
|
|||||||
HTMLParse();
|
HTMLParse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScreenPackages::ParseHTTPAddress( const CString & URL, CString & Proto, CString & Server, int & Port, CString & sAddress )
|
bool ScreenPackages::ParseHTTPAddress( const CString & URL, CString & Proto, CString & Server, int & Port, CString & sAddress )
|
||||||
|
|||||||
Reference in New Issue
Block a user