diff --git a/Buffer/main.cpp b/Buffer/main.cpp index 77376630..243205e2 100644 --- a/Buffer/main.cpp +++ b/Buffer/main.cpp @@ -13,7 +13,10 @@ #include void termination_handler (int signum){ - return; + switch (signum){ + case SIGPIPE: return; break; + default: return; break; + } } diff --git a/Connector_RTMP/handshake.cpp b/Connector_RTMP/handshake.cpp index b7ba2896..24095c3b 100644 --- a/Connector_RTMP/handshake.cpp +++ b/Connector_RTMP/handshake.cpp @@ -24,7 +24,7 @@ bool doHandshake(){ Server.Time[0] = 0; Server.Time[1] = 0; Server.Time[2] = 0; Server.Time[3] = 0; Server.Zero[0] = 0; Server.Zero[1] = 0; Server.Zero[2] = 0; Server.Zero[3] = 0; for (int i = 0; i < 1528; i++){ - Server.Random[i] = versionstring[i%13]; + Server.Random[i] = versionstring[i%sizeof(versionstring)]; } /** Send S0 **/ DDV_write(&(Version), 1, 1, CONN_fd); diff --git a/Connector_RTMP/main.cpp b/Connector_RTMP/main.cpp index ede667c4..0f9d5a90 100644 --- a/Connector_RTMP/main.cpp +++ b/Connector_RTMP/main.cpp @@ -225,12 +225,23 @@ int main(int argc, char ** argv){ if ((rec_cnt - rec_window_at > rec_window_size) || (getNowMS() - lastcheck > 1)){ rec_window_at = rec_cnt; SendCTL(3, rec_cnt);//send ack (msg 3) + lastcheck = getNowMS(); } } close(CONN_fd); + if (inited) close(ss); #if DEBUG >= 1 if (All_Hell_Broke_Loose){fprintf(stderr, "All Hell Broke Loose\n");} fprintf(stderr, "User %i disconnected.\n", CONN_fd); + if (inited){ + fprintf(stderr, "Status was: inited\n"); + }else{ + if (ready4data){ + fprintf(stderr, "Status was: ready4data\n"); + }else{ + fprintf(stderr, "Status was: connected\n"); + } + } #endif return 0; }//main