This commit is contained in:
Thulinma 2010-11-08 21:45:39 +01:00
parent 56f6a96ce0
commit c0e55f6b66
2 changed files with 24 additions and 9 deletions

View file

@ -34,13 +34,17 @@ bool FLV_Isheader(char * header){
bool ReadUntil(char * buffer, unsigned int count, unsigned int & sofar, int sock){
if (sofar >= count){return true;}
fprintf(stderr, "Reading %i/%i\n", sofar, count);
bool r = DDV_read(buffer + sofar,count-sofar,sock);
sofar = count;
if (!r){
All_Hell_Broke_Loose = true;
fprintf(stderr, "ReadUntil fail: %s. All Hell Broke Loose!\n", strerror(errno));
if (DDV_readycount(sock) >= count-sofar){
bool r = DDV_read(buffer + sofar,count-sofar,sock);
sofar = count;
if (!r){
All_Hell_Broke_Loose = true;
fprintf(stderr, "ReadUntil fail: %s. All Hell Broke Loose!\n", strerror(errno));
}
return r;
}else{
return false;
}
return r;
}
//gets a packet, storing in given FLV_Pack pointer.