Hopelijk laatste socket fix

This commit is contained in:
Thulinma 2011-04-18 16:08:55 +02:00
parent 7b811219bd
commit bf0b976999
3 changed files with 7 additions and 8 deletions

View file

@ -160,7 +160,7 @@ namespace Connector_HTTP{
while (conn.connected() && !FLV::Parse_Error){
//only parse input if available or not yet init'ed
if (HTTP_R.Read(conn)){
if (HTTP_R.Read(conn, ready4data)){
handler = HANDLER_PROGRESSIVE;
if ((HTTP_R.url.find("Seg") != std::string::npos) && (HTTP_R.url.find("Frag") != std::string::npos)){handler = HANDLER_FLASH;}
if (HTTP_R.url.find("f4m") != std::string::npos){handler = HANDLER_FLASH;}

View file

@ -128,12 +128,11 @@ void HTTP::Parser::SetVar(std::string i, std::string v){
}
/// Attempt to read a whole HTTP request or response from DDV::Socket sock.
/// \param sock The socket to use.
/// \param nonblock When true, will not block even if the socket is blocking.
/// \return True of a whole request or response was read, false otherwise.
bool HTTP::Parser::Read(DDV::Socket & sock){
//returned true als hele http packet gelezen is
int r = 0;
int b = 0;
char buffer[500];
bool HTTP::Parser::Read(DDV::Socket & sock, bool nonblock){
if (nonblock && (sock.ready() < 1)){return parse();}
sock.read(HTTPbuffer);
return parse();
}//HTTPReader::ReadSocket

View file

@ -14,7 +14,7 @@ namespace HTTP{
class Parser{
public:
Parser();
bool Read(DDV::Socket & sock);
bool Read(DDV::Socket & sock, bool nonblock = true);
bool Read(FILE * F);
std::string GetHeader(std::string i);
std::string GetVar(std::string i);