mirror of
https://github.com/tinygo-org/net.git
synced 2026-08-21 12:59:00 +00:00
move IPPROTO_TLS to netdev to avoid src/syscall dependency
This commit is contained in:
committed by
deadprogram
parent
693edae782
commit
331151cafe
@@ -4,6 +4,12 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
// Made up, not a real IP protocol number. This is used to create a
|
||||||
|
// TLS socket on the device, assuming the device supports mbed TLS.
|
||||||
|
IPPROTO_TLS = 0xFE
|
||||||
|
)
|
||||||
|
|
||||||
// netdev is the current netdev, set by the application with useNetdev()
|
// netdev is the current netdev, set by the application with useNetdev()
|
||||||
var netdev netdever
|
var netdev netdever
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -31,7 +31,7 @@ func DialTLS(addr string) (*TLSConn, error) {
|
|||||||
port = 443
|
port = 443
|
||||||
}
|
}
|
||||||
|
|
||||||
fd, err := netdev.Socket(syscall.AF_INET, syscall.SOCK_STREAM, syscall.IPPROTO_TLS)
|
fd, err := netdev.Socket(syscall.AF_INET, syscall.SOCK_STREAM, IPPROTO_TLS)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user