diff --git a/rtmp/rtmp.go b/rtmp/rtmp.go index 519a2c70..3f675515 100644 --- a/rtmp/rtmp.go +++ b/rtmp/rtmp.go @@ -762,9 +762,8 @@ func handShake(r *C.RTMP, FP9HandShake int32) int { return 0 } - // TODO: port this - if C.ReadN(r, (*C.char)(unsafe.Pointer(&typ)), 1) != 1 { - // if readN(r, (*byte)(unsafe.Pointer(&typ)), 1) != 1 { + //if C.ReadN(r, (*C.char)(unsafe.Pointer(&typ)), 1) != 1 { + if readN(r, (*byte)(unsafe.Pointer(&typ)), 1) != 1 { return 0 } @@ -775,8 +774,8 @@ func handShake(r *C.RTMP, FP9HandShake int32) int { log.Println("handShake: type mismatch: client sent %v, server sent: %v", clientbuf[0], typ) } - - if C.ReadN(r, (*C.char)(unsafe.Pointer(&serversig[0])), RTMP_SIG_SIZE) != RTMP_SIG_SIZE { + if readN(r, (*byte)(unsafe.Pointer(&serversig[0])), RTMP_SIG_SIZE) != RTMP_SIG_SIZE { + //if C.ReadN(r, (*C.char)(unsafe.Pointer(&serversig[0])), RTMP_SIG_SIZE) != RTMP_SIG_SIZE { return 0 } @@ -789,7 +788,8 @@ func handShake(r *C.RTMP, FP9HandShake int32) int { return 0 } - if C.ReadN(r, (*C.char)(unsafe.Pointer(&serversig[0])), RTMP_SIG_SIZE) != RTMP_SIG_SIZE { + if readN(r, (*byte)(unsafe.Pointer(&serversig[0])), RTMP_SIG_SIZE) != RTMP_SIG_SIZE { + // if C.ReadN(r, (*C.char)(unsafe.Pointer(&serversig[0])), RTMP_SIG_SIZE) != RTMP_SIG_SIZE { return 0 }