mirror of https://bitbucket.org/ausocean/av.git
rtmp: clean up C_SocksNegotiate
This commit is contained in:
parent
d1f870223c
commit
5f3f50373b
|
@ -455,12 +455,9 @@ func C_SocksNegotiate(r *C_RTMP) (ok bool) {
|
||||||
var addr int32
|
var addr int32
|
||||||
var service C.sockaddr_in
|
var service C.sockaddr_in
|
||||||
|
|
||||||
memset((*byte)(unsafe.Pointer(&service)), 0, int(unsafe.Sizeof(service)))
|
|
||||||
|
|
||||||
C_add_addr_info(&service, r.Link.hostname, r.Link.port)
|
C_add_addr_info(&service, r.Link.hostname, r.Link.port)
|
||||||
addr = int32(inet.Htonl(uint32(service.sin_addr.s_addr)))
|
addr = int32(inet.Htonl(uint32(service.sin_addr.s_addr)))
|
||||||
|
|
||||||
{
|
|
||||||
packet := []byte{
|
packet := []byte{
|
||||||
4, 1,
|
4, 1,
|
||||||
byte((r.Link.port >> 8) & 0xFF),
|
byte((r.Link.port >> 8) & 0xFF),
|
||||||
|
@ -478,13 +475,11 @@ func C_SocksNegotiate(r *C_RTMP) (ok bool) {
|
||||||
|
|
||||||
if packet[0] == 0 && packet[1] == 90 {
|
if packet[0] == 0 && packet[1] == 90 {
|
||||||
return true
|
return true
|
||||||
} else {
|
}
|
||||||
// TODO: use new logger here
|
// TODO: use new logger here
|
||||||
log.Println("C_SocksNegotitate: SOCKS returned error code!")
|
log.Println("C_SocksNegotitate: SOCKS returned error code!")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// int RTMP_ConnectStream(RTMP* r, int seekTime);
|
// int RTMP_ConnectStream(RTMP* r, int seekTime);
|
||||||
// rtmp.c +1099
|
// rtmp.c +1099
|
||||||
|
|
Loading…
Reference in New Issue