mirror of
https://github.com/Drop-OSS/libtailscale.git
synced 2026-01-30 20:55:18 +01:00
libtailscale: call hostinfo.SetApp
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
This commit is contained in:
committed by
David Crawshaw
parent
843d93cb63
commit
56cb66829f
@@ -16,6 +16,7 @@ import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"tailscale.com/hostinfo"
|
||||
"tailscale.com/tsnet"
|
||||
"tailscale.com/types/logger"
|
||||
)
|
||||
@@ -85,6 +86,7 @@ func TsnetNewServer() C.int {
|
||||
|
||||
if servers.m == nil {
|
||||
servers.m = map[C.int]*server{}
|
||||
hostinfo.SetApp("libtailscale")
|
||||
}
|
||||
if servers.next == 0 {
|
||||
servers.next = 42<<16 + 1
|
||||
|
||||
@@ -132,6 +132,7 @@ int close_conn() {
|
||||
*/
|
||||
import "C"
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"io"
|
||||
"net/http"
|
||||
@@ -139,6 +140,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"tailscale.com/net/netns"
|
||||
"tailscale.com/tstest/integration"
|
||||
@@ -183,7 +185,12 @@ func RunTestConn(t *testing.T) {
|
||||
t.Fatal(C.GoString(C.err))
|
||||
}
|
||||
|
||||
req, err := http.NewRequest("GET", "http://"+C.GoString(C.addr)+"/localapi/v0/status", nil)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
||||
defer cancel()
|
||||
|
||||
localAPIStatus := "http://" + C.GoString(C.addr) + "/localapi/v0/status"
|
||||
t.Logf("fetching local API status from %q", localAPIStatus)
|
||||
req, err := http.NewRequestWithContext(ctx, "GET", localAPIStatus, nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user