mirror of https://bitbucket.org/ausocean/av.git
Using my readN - tested and working
This commit is contained in:
parent
89e5f334da
commit
670e79f8f0
12
rtmp/rtmp.go
12
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue