Werkende RTMP connector! WHEEEE! Also, RTMPf weggegooit. Er is geen ruimte voor faal in dit bedrijf!
This commit is contained in:
parent
c1c4f30498
commit
be1b8068a4
2 changed files with 12 additions and 12 deletions
|
@ -46,12 +46,12 @@ int DDV_Listen(int port){
|
|||
if (ret == 0){
|
||||
return s;
|
||||
}else{
|
||||
printf("Listen failed! Error: %s\n", strerror(errno));
|
||||
fprintf(stderr, "Listen failed! Error: %s\n", strerror(errno));
|
||||
close(s);
|
||||
return 0;
|
||||
}
|
||||
}else{
|
||||
printf("Binding failed! Error: %s\n", strerror(errno));
|
||||
fprintf(stderr, "Binding failed! Error: %s\n", strerror(errno));
|
||||
close(s);
|
||||
return 0;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ bool DDV_write(void * buffer, int todo, int sock){
|
|||
case EWOULDBLOCK: socketBlocking = true; break;
|
||||
default:
|
||||
socketError = true;
|
||||
printf("Could not write! %s\n", strerror(errno));
|
||||
fprintf(stderr, "Could not write! %s\n", strerror(errno));
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
@ -87,14 +87,14 @@ bool DDV_write(void * buffer, int todo, int sock){
|
|||
return true;
|
||||
}
|
||||
|
||||
bool DDV_ready(int sock){
|
||||
signed int DDV_ready(int sock){
|
||||
char tmp;
|
||||
int preflags = fcntl(sock, F_GETFL, 0);
|
||||
int postflags = preflags | O_NONBLOCK;
|
||||
fcntl(sock, F_SETFL, postflags);
|
||||
int r = recv(sock, &tmp, 1, MSG_PEEK);
|
||||
fcntl(sock, F_SETFL, preflags);
|
||||
return (r == 1);
|
||||
return r;
|
||||
}
|
||||
|
||||
bool DDV_read(void * buffer, int todo, int sock){
|
||||
|
@ -107,7 +107,7 @@ bool DDV_read(void * buffer, int todo, int sock){
|
|||
case EWOULDBLOCK: socketBlocking = true; break;
|
||||
default:
|
||||
socketError = true;
|
||||
printf("Could not read! %s\n", strerror(errno));
|
||||
fprintf(stderr, "Could not read! %s\n", strerror(errno));
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ int DDV_iwrite(void * buffer, int todo, int sock){
|
|||
case EWOULDBLOCK: break;
|
||||
default:
|
||||
socketError = true;
|
||||
printf("Could not write! %s\n", strerror(errno));
|
||||
fprintf(stderr, "Could not write! %s\n", strerror(errno));
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ int DDV_iread(void * buffer, int todo, int sock){
|
|||
case EWOULDBLOCK: break;
|
||||
default:
|
||||
socketError = true;
|
||||
printf("Could not read! %s\n", strerror(errno));
|
||||
fprintf(stderr, "Could not read! %s\n", strerror(errno));
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -69,6 +69,7 @@ bool FLV_GetPacket(FLV_Pack *& p, int sock){
|
|||
if (FLV_Checkheader(p->data)){
|
||||
sofar = 0;
|
||||
memcpy(FLVHeader, p->data, 13);
|
||||
//fwrite(p->data, 13, 1, stdout);//output raw stream
|
||||
}else{
|
||||
All_Hell_Broke_Loose = true;
|
||||
fprintf(stderr, "Invalid FLV header. All Hell Broke Loose!\n");
|
||||
|
@ -94,12 +95,11 @@ bool FLV_GetPacket(FLV_Pack *& p, int sock){
|
|||
testlen += (p->data[p->len-2] << 8);
|
||||
testlen += (p->data[p->len-3] << 16);
|
||||
testlen += (p->data[p->len-4] << 24);
|
||||
if (p->len == testlen){
|
||||
fprintf(stderr, "Correct length tag...\n");
|
||||
}else{
|
||||
//fwrite(p->data, p->len, 1, stdout);//output raw stream
|
||||
if (p->len != testlen){
|
||||
fprintf(stderr, "Len: %i, testlen: %i\n", p->len, testlen);
|
||||
All_Hell_Broke_Loose = true;
|
||||
fprintf(stderr, "ReadUntil fail: > 500kb tag? All Hell Broke Loose!\n", strerror(errno));
|
||||
fprintf(stderr, "ReadUntil fail: Wrong size tag? All Hell Broke Loose!\n");
|
||||
return false;
|
||||
}
|
||||
done = true;
|
||||
|
|
Loading…
Add table
Reference in a new issue