aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/go/_std_1.21/src/net
diff options
context:
space:
mode:
authorpg <pg@yandex-team.com>2024-02-08 10:32:03 +0300
committerAlexander Smirnov <alex@ydb.tech>2024-02-09 19:18:51 +0300
commit0cffe4e1b7a558e696fe88f520cc636f8ae81bfe (patch)
treefb32cc17a2ee8b6764fc257c53e55a1538e1f85f /contrib/go/_std_1.21/src/net
parent84dc6b2fba247c7b3df7a468b443fa44aa80f57f (diff)
downloadydb-0cffe4e1b7a558e696fe88f520cc636f8ae81bfe.tar.gz
Diffstat (limited to 'contrib/go/_std_1.21/src/net')
-rw-r--r--contrib/go/_std_1.21/src/net/http/httptest/ya.make2
-rw-r--r--contrib/go/_std_1.21/src/net/http/httptrace/ya.make2
-rw-r--r--contrib/go/_std_1.21/src/net/http/httputil/ya.make2
-rw-r--r--contrib/go/_std_1.21/src/net/http/internal/ascii/ya.make2
-rw-r--r--contrib/go/_std_1.21/src/net/http/internal/testcert/ya.make2
-rw-r--r--contrib/go/_std_1.21/src/net/http/internal/ya.make2
-rw-r--r--contrib/go/_std_1.21/src/net/http/pprof/ya.make2
-rw-r--r--contrib/go/_std_1.21/src/net/http/ya.make2
-rw-r--r--contrib/go/_std_1.21/src/net/internal/ya.make0
-rw-r--r--contrib/go/_std_1.21/src/net/mail/ya.make2
-rw-r--r--contrib/go/_std_1.21/src/net/netip/ya.make2
-rw-r--r--contrib/go/_std_1.21/src/net/rpc/client.go323
-rw-r--r--contrib/go/_std_1.21/src/net/rpc/debug.go90
-rw-r--r--contrib/go/_std_1.21/src/net/rpc/server.go725
-rw-r--r--contrib/go/_std_1.21/src/net/rpc/ya.make9
-rw-r--r--contrib/go/_std_1.21/src/net/smtp/auth.go109
-rw-r--r--contrib/go/_std_1.21/src/net/smtp/smtp.go432
-rw-r--r--contrib/go/_std_1.21/src/net/smtp/ya.make8
-rw-r--r--contrib/go/_std_1.21/src/net/textproto/ya.make2
-rw-r--r--contrib/go/_std_1.21/src/net/url/ya.make2
-rw-r--r--contrib/go/_std_1.21/src/net/ya.make449
21 files changed, 317 insertions, 1852 deletions
diff --git a/contrib/go/_std_1.21/src/net/http/httptest/ya.make b/contrib/go/_std_1.21/src/net/http/httptest/ya.make
index 3f5fe630c7..1b03020158 100644
--- a/contrib/go/_std_1.21/src/net/http/httptest/ya.make
+++ b/contrib/go/_std_1.21/src/net/http/httptest/ya.make
@@ -1,5 +1,5 @@
GO_LIBRARY()
-IF (OS_DARWIN AND ARCH_ARM64 AND RACE OR OS_DARWIN AND ARCH_ARM64 AND NOT RACE OR OS_DARWIN AND ARCH_X86_64 AND RACE OR OS_DARWIN AND ARCH_X86_64 AND NOT RACE OR OS_LINUX AND ARCH_AARCH64 AND RACE OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE OR OS_LINUX AND ARCH_X86_64 AND RACE OR OS_LINUX AND ARCH_X86_64 AND NOT RACE OR OS_WINDOWS AND ARCH_X86_64 AND RACE OR OS_WINDOWS AND ARCH_X86_64 AND NOT RACE)
+IF (TRUE)
SRCS(
httptest.go
recorder.go
diff --git a/contrib/go/_std_1.21/src/net/http/httptrace/ya.make b/contrib/go/_std_1.21/src/net/http/httptrace/ya.make
index 527f7e13d6..aba871b46c 100644
--- a/contrib/go/_std_1.21/src/net/http/httptrace/ya.make
+++ b/contrib/go/_std_1.21/src/net/http/httptrace/ya.make
@@ -1,5 +1,5 @@
GO_LIBRARY()
-IF (OS_DARWIN AND ARCH_ARM64 AND RACE OR OS_DARWIN AND ARCH_ARM64 AND NOT RACE OR OS_DARWIN AND ARCH_X86_64 AND RACE OR OS_DARWIN AND ARCH_X86_64 AND NOT RACE OR OS_LINUX AND ARCH_AARCH64 AND RACE OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE OR OS_LINUX AND ARCH_X86_64 AND RACE OR OS_LINUX AND ARCH_X86_64 AND NOT RACE OR OS_WINDOWS AND ARCH_X86_64 AND RACE OR OS_WINDOWS AND ARCH_X86_64 AND NOT RACE)
+IF (TRUE)
SRCS(
trace.go
)
diff --git a/contrib/go/_std_1.21/src/net/http/httputil/ya.make b/contrib/go/_std_1.21/src/net/http/httputil/ya.make
index 1043128d45..5bbfec2fb4 100644
--- a/contrib/go/_std_1.21/src/net/http/httputil/ya.make
+++ b/contrib/go/_std_1.21/src/net/http/httputil/ya.make
@@ -1,5 +1,5 @@
GO_LIBRARY()
-IF (OS_DARWIN AND ARCH_ARM64 AND RACE OR OS_DARWIN AND ARCH_ARM64 AND NOT RACE OR OS_DARWIN AND ARCH_X86_64 AND RACE OR OS_DARWIN AND ARCH_X86_64 AND NOT RACE OR OS_LINUX AND ARCH_AARCH64 AND RACE OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE OR OS_LINUX AND ARCH_X86_64 AND RACE OR OS_LINUX AND ARCH_X86_64 AND NOT RACE OR OS_WINDOWS AND ARCH_X86_64 AND RACE OR OS_WINDOWS AND ARCH_X86_64 AND NOT RACE)
+IF (TRUE)
SRCS(
dump.go
httputil.go
diff --git a/contrib/go/_std_1.21/src/net/http/internal/ascii/ya.make b/contrib/go/_std_1.21/src/net/http/internal/ascii/ya.make
index 4bcdd7b285..0b8cb54c91 100644
--- a/contrib/go/_std_1.21/src/net/http/internal/ascii/ya.make
+++ b/contrib/go/_std_1.21/src/net/http/internal/ascii/ya.make
@@ -1,5 +1,5 @@
GO_LIBRARY()
-IF (OS_DARWIN AND ARCH_ARM64 AND RACE OR OS_DARWIN AND ARCH_ARM64 AND NOT RACE OR OS_DARWIN AND ARCH_X86_64 AND RACE OR OS_DARWIN AND ARCH_X86_64 AND NOT RACE OR OS_LINUX AND ARCH_AARCH64 AND RACE OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE OR OS_LINUX AND ARCH_X86_64 AND RACE OR OS_LINUX AND ARCH_X86_64 AND NOT RACE OR OS_WINDOWS AND ARCH_X86_64 AND RACE OR OS_WINDOWS AND ARCH_X86_64 AND NOT RACE)
+IF (TRUE)
SRCS(
print.go
)
diff --git a/contrib/go/_std_1.21/src/net/http/internal/testcert/ya.make b/contrib/go/_std_1.21/src/net/http/internal/testcert/ya.make
index b7d25f88ca..f55b3d8069 100644
--- a/contrib/go/_std_1.21/src/net/http/internal/testcert/ya.make
+++ b/contrib/go/_std_1.21/src/net/http/internal/testcert/ya.make
@@ -1,5 +1,5 @@
GO_LIBRARY()
-IF (OS_DARWIN AND ARCH_ARM64 AND RACE OR OS_DARWIN AND ARCH_ARM64 AND NOT RACE OR OS_DARWIN AND ARCH_X86_64 AND RACE OR OS_DARWIN AND ARCH_X86_64 AND NOT RACE OR OS_LINUX AND ARCH_AARCH64 AND RACE OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE OR OS_LINUX AND ARCH_X86_64 AND RACE OR OS_LINUX AND ARCH_X86_64 AND NOT RACE OR OS_WINDOWS AND ARCH_X86_64 AND RACE OR OS_WINDOWS AND ARCH_X86_64 AND NOT RACE)
+IF (TRUE)
SRCS(
testcert.go
)
diff --git a/contrib/go/_std_1.21/src/net/http/internal/ya.make b/contrib/go/_std_1.21/src/net/http/internal/ya.make
index 19176b191b..38798a92b0 100644
--- a/contrib/go/_std_1.21/src/net/http/internal/ya.make
+++ b/contrib/go/_std_1.21/src/net/http/internal/ya.make
@@ -1,5 +1,5 @@
GO_LIBRARY()
-IF (OS_DARWIN AND ARCH_ARM64 AND RACE OR OS_DARWIN AND ARCH_ARM64 AND NOT RACE OR OS_DARWIN AND ARCH_X86_64 AND RACE OR OS_DARWIN AND ARCH_X86_64 AND NOT RACE OR OS_LINUX AND ARCH_AARCH64 AND RACE OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE OR OS_LINUX AND ARCH_X86_64 AND RACE OR OS_LINUX AND ARCH_X86_64 AND NOT RACE OR OS_WINDOWS AND ARCH_X86_64 AND RACE OR OS_WINDOWS AND ARCH_X86_64 AND NOT RACE)
+IF (TRUE)
SRCS(
chunked.go
)
diff --git a/contrib/go/_std_1.21/src/net/http/pprof/ya.make b/contrib/go/_std_1.21/src/net/http/pprof/ya.make
index 557fa19a36..e4ecc197c8 100644
--- a/contrib/go/_std_1.21/src/net/http/pprof/ya.make
+++ b/contrib/go/_std_1.21/src/net/http/pprof/ya.make
@@ -1,5 +1,5 @@
GO_LIBRARY()
-IF (OS_DARWIN AND ARCH_ARM64 AND RACE OR OS_DARWIN AND ARCH_ARM64 AND NOT RACE OR OS_DARWIN AND ARCH_X86_64 AND RACE OR OS_DARWIN AND ARCH_X86_64 AND NOT RACE OR OS_LINUX AND ARCH_AARCH64 AND RACE OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE OR OS_LINUX AND ARCH_X86_64 AND RACE OR OS_LINUX AND ARCH_X86_64 AND NOT RACE OR OS_WINDOWS AND ARCH_X86_64 AND RACE OR OS_WINDOWS AND ARCH_X86_64 AND NOT RACE)
+IF (TRUE)
SRCS(
pprof.go
)
diff --git a/contrib/go/_std_1.21/src/net/http/ya.make b/contrib/go/_std_1.21/src/net/http/ya.make
index fd27fec7ff..9e23ac5d3e 100644
--- a/contrib/go/_std_1.21/src/net/http/ya.make
+++ b/contrib/go/_std_1.21/src/net/http/ya.make
@@ -1,5 +1,5 @@
GO_LIBRARY()
-IF (OS_DARWIN AND ARCH_ARM64 AND RACE OR OS_DARWIN AND ARCH_ARM64 AND NOT RACE OR OS_DARWIN AND ARCH_X86_64 AND RACE OR OS_DARWIN AND ARCH_X86_64 AND NOT RACE OR OS_LINUX AND ARCH_AARCH64 AND RACE OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE OR OS_LINUX AND ARCH_X86_64 AND RACE OR OS_LINUX AND ARCH_X86_64 AND NOT RACE OR OS_WINDOWS AND ARCH_X86_64 AND RACE OR OS_WINDOWS AND ARCH_X86_64 AND NOT RACE)
+IF (TRUE)
SRCS(
client.go
clone.go
diff --git a/contrib/go/_std_1.21/src/net/internal/ya.make b/contrib/go/_std_1.21/src/net/internal/ya.make
deleted file mode 100644
index e69de29bb2..0000000000
--- a/contrib/go/_std_1.21/src/net/internal/ya.make
+++ /dev/null
diff --git a/contrib/go/_std_1.21/src/net/mail/ya.make b/contrib/go/_std_1.21/src/net/mail/ya.make
index 5724ce854d..b772245d9a 100644
--- a/contrib/go/_std_1.21/src/net/mail/ya.make
+++ b/contrib/go/_std_1.21/src/net/mail/ya.make
@@ -1,5 +1,5 @@
GO_LIBRARY()
-IF (OS_DARWIN AND ARCH_ARM64 AND RACE OR OS_DARWIN AND ARCH_ARM64 AND NOT RACE OR OS_DARWIN AND ARCH_X86_64 AND RACE OR OS_DARWIN AND ARCH_X86_64 AND NOT RACE OR OS_LINUX AND ARCH_AARCH64 AND RACE OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE OR OS_LINUX AND ARCH_X86_64 AND RACE OR OS_LINUX AND ARCH_X86_64 AND NOT RACE OR OS_WINDOWS AND ARCH_X86_64 AND RACE OR OS_WINDOWS AND ARCH_X86_64 AND NOT RACE)
+IF (TRUE)
SRCS(
message.go
)
diff --git a/contrib/go/_std_1.21/src/net/netip/ya.make b/contrib/go/_std_1.21/src/net/netip/ya.make
index 27672b60ef..bb1de92df1 100644
--- a/contrib/go/_std_1.21/src/net/netip/ya.make
+++ b/contrib/go/_std_1.21/src/net/netip/ya.make
@@ -1,5 +1,5 @@
GO_LIBRARY()
-IF (OS_DARWIN AND ARCH_ARM64 AND RACE OR OS_DARWIN AND ARCH_ARM64 AND NOT RACE OR OS_DARWIN AND ARCH_X86_64 AND RACE OR OS_DARWIN AND ARCH_X86_64 AND NOT RACE OR OS_LINUX AND ARCH_AARCH64 AND RACE OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE OR OS_LINUX AND ARCH_X86_64 AND RACE OR OS_LINUX AND ARCH_X86_64 AND NOT RACE OR OS_WINDOWS AND ARCH_X86_64 AND RACE OR OS_WINDOWS AND ARCH_X86_64 AND NOT RACE)
+IF (TRUE)
SRCS(
leaf_alts.go
netip.go
diff --git a/contrib/go/_std_1.21/src/net/rpc/client.go b/contrib/go/_std_1.21/src/net/rpc/client.go
deleted file mode 100644
index 42d13519b1..0000000000
--- a/contrib/go/_std_1.21/src/net/rpc/client.go
+++ /dev/null
@@ -1,323 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package rpc
-
-import (
- "bufio"
- "encoding/gob"
- "errors"
- "io"
- "log"
- "net"
- "net/http"
- "sync"
-)
-
-// ServerError represents an error that has been returned from
-// the remote side of the RPC connection.
-type ServerError string
-
-func (e ServerError) Error() string {
- return string(e)
-}
-
-var ErrShutdown = errors.New("connection is shut down")
-
-// Call represents an active RPC.
-type Call struct {
- ServiceMethod string // The name of the service and method to call.
- Args any // The argument to the function (*struct).
- Reply any // The reply from the function (*struct).
- Error error // After completion, the error status.
- Done chan *Call // Receives *Call when Go is complete.
-}
-
-// Client represents an RPC Client.
-// There may be multiple outstanding Calls associated
-// with a single Client, and a Client may be used by
-// multiple goroutines simultaneously.
-type Client struct {
- codec ClientCodec
-
- reqMutex sync.Mutex // protects following
- request Request
-
- mutex sync.Mutex // protects following
- seq uint64
- pending map[uint64]*Call
- closing bool // user has called Close
- shutdown bool // server has told us to stop
-}
-
-// A ClientCodec implements writing of RPC requests and
-// reading of RPC responses for the client side of an RPC session.
-// The client calls WriteRequest to write a request to the connection
-// and calls ReadResponseHeader and ReadResponseBody in pairs
-// to read responses. The client calls Close when finished with the
-// connection. ReadResponseBody may be called with a nil
-// argument to force the body of the response to be read and then
-// discarded.
-// See NewClient's comment for information about concurrent access.
-type ClientCodec interface {
- WriteRequest(*Request, any) error
- ReadResponseHeader(*Response) error
- ReadResponseBody(any) error
-
- Close() error
-}
-
-func (client *Client) send(call *Call) {
- client.reqMutex.Lock()
- defer client.reqMutex.Unlock()
-
- // Register this call.
- client.mutex.Lock()
- if client.shutdown || client.closing {
- client.mutex.Unlock()
- call.Error = ErrShutdown
- call.done()
- return
- }
- seq := client.seq
- client.seq++
- client.pending[seq] = call
- client.mutex.Unlock()
-
- // Encode and send the request.
- client.request.Seq = seq
- client.request.ServiceMethod = call.ServiceMethod
- err := client.codec.WriteRequest(&client.request, call.Args)
- if err != nil {
- client.mutex.Lock()
- call = client.pending[seq]
- delete(client.pending, seq)
- client.mutex.Unlock()
- if call != nil {
- call.Error = err
- call.done()
- }
- }
-}
-
-func (client *Client) input() {
- var err error
- var response Response
- for err == nil {
- response = Response{}
- err = client.codec.ReadResponseHeader(&response)
- if err != nil {
- break
- }
- seq := response.Seq
- client.mutex.Lock()
- call := client.pending[seq]
- delete(client.pending, seq)
- client.mutex.Unlock()
-
- switch {
- case call == nil:
- // We've got no pending call. That usually means that
- // WriteRequest partially failed, and call was already
- // removed; response is a server telling us about an
- // error reading request body. We should still attempt
- // to read error body, but there's no one to give it to.
- err = client.codec.ReadResponseBody(nil)
- if err != nil {
- err = errors.New("reading error body: " + err.Error())
- }
- case response.Error != "":
- // We've got an error response. Give this to the request;
- // any subsequent requests will get the ReadResponseBody
- // error if there is one.
- call.Error = ServerError(response.Error)
- err = client.codec.ReadResponseBody(nil)
- if err != nil {
- err = errors.New("reading error body: " + err.Error())
- }
- call.done()
- default:
- err = client.codec.ReadResponseBody(call.Reply)
- if err != nil {
- call.Error = errors.New("reading body " + err.Error())
- }
- call.done()
- }
- }
- // Terminate pending calls.
- client.reqMutex.Lock()
- client.mutex.Lock()
- client.shutdown = true
- closing := client.closing
- if err == io.EOF {
- if closing {
- err = ErrShutdown
- } else {
- err = io.ErrUnexpectedEOF
- }
- }
- for _, call := range client.pending {
- call.Error = err
- call.done()
- }
- client.mutex.Unlock()
- client.reqMutex.Unlock()
- if debugLog && err != io.EOF && !closing {
- log.Println("rpc: client protocol error:", err)
- }
-}
-
-func (call *Call) done() {
- select {
- case call.Done <- call:
- // ok
- default:
- // We don't want to block here. It is the caller's responsibility to make
- // sure the channel has enough buffer space. See comment in Go().
- if debugLog {
- log.Println("rpc: discarding Call reply due to insufficient Done chan capacity")
- }
- }
-}
-
-// NewClient returns a new Client to handle requests to the
-// set of services at the other end of the connection.
-// It adds a buffer to the write side of the connection so
-// the header and payload are sent as a unit.
-//
-// The read and write halves of the connection are serialized independently,
-// so no interlocking is required. However each half may be accessed
-// concurrently so the implementation of conn should protect against
-// concurrent reads or concurrent writes.
-func NewClient(conn io.ReadWriteCloser) *Client {
- encBuf := bufio.NewWriter(conn)
- client := &gobClientCodec{conn, gob.NewDecoder(conn), gob.NewEncoder(encBuf), encBuf}
- return NewClientWithCodec(client)
-}
-
-// NewClientWithCodec is like NewClient but uses the specified
-// codec to encode requests and decode responses.
-func NewClientWithCodec(codec ClientCodec) *Client {
- client := &Client{
- codec: codec,
- pending: make(map[uint64]*Call),
- }
- go client.input()
- return client
-}
-
-type gobClientCodec struct {
- rwc io.ReadWriteCloser
- dec *gob.Decoder
- enc *gob.Encoder
- encBuf *bufio.Writer
-}
-
-func (c *gobClientCodec) WriteRequest(r *Request, body any) (err error) {
- if err = c.enc.Encode(r); err != nil {
- return
- }
- if err = c.enc.Encode(body); err != nil {
- return
- }
- return c.encBuf.Flush()
-}
-
-func (c *gobClientCodec) ReadResponseHeader(r *Response) error {
- return c.dec.Decode(r)
-}
-
-func (c *gobClientCodec) ReadResponseBody(body any) error {
- return c.dec.Decode(body)
-}
-
-func (c *gobClientCodec) Close() error {
- return c.rwc.Close()
-}
-
-// DialHTTP connects to an HTTP RPC server at the specified network address
-// listening on the default HTTP RPC path.
-func DialHTTP(network, address string) (*Client, error) {
- return DialHTTPPath(network, address, DefaultRPCPath)
-}
-
-// DialHTTPPath connects to an HTTP RPC server
-// at the specified network address and path.
-func DialHTTPPath(network, address, path string) (*Client, error) {
- conn, err := net.Dial(network, address)
- if err != nil {
- return nil, err
- }
- io.WriteString(conn, "CONNECT "+path+" HTTP/1.0\n\n")
-
- // Require successful HTTP response
- // before switching to RPC protocol.
- resp, err := http.ReadResponse(bufio.NewReader(conn), &http.Request{Method: "CONNECT"})
- if err == nil && resp.Status == connected {
- return NewClient(conn), nil
- }
- if err == nil {
- err = errors.New("unexpected HTTP response: " + resp.Status)
- }
- conn.Close()
- return nil, &net.OpError{
- Op: "dial-http",
- Net: network + " " + address,
- Addr: nil,
- Err: err,
- }
-}
-
-// Dial connects to an RPC server at the specified network address.
-func Dial(network, address string) (*Client, error) {
- conn, err := net.Dial(network, address)
- if err != nil {
- return nil, err
- }
- return NewClient(conn), nil
-}
-
-// Close calls the underlying codec's Close method. If the connection is already
-// shutting down, ErrShutdown is returned.
-func (client *Client) Close() error {
- client.mutex.Lock()
- if client.closing {
- client.mutex.Unlock()
- return ErrShutdown
- }
- client.closing = true
- client.mutex.Unlock()
- return client.codec.Close()
-}
-
-// Go invokes the function asynchronously. It returns the Call structure representing
-// the invocation. The done channel will signal when the call is complete by returning
-// the same Call object. If done is nil, Go will allocate a new channel.
-// If non-nil, done must be buffered or Go will deliberately crash.
-func (client *Client) Go(serviceMethod string, args any, reply any, done chan *Call) *Call {
- call := new(Call)
- call.ServiceMethod = serviceMethod
- call.Args = args
- call.Reply = reply
- if done == nil {
- done = make(chan *Call, 10) // buffered.
- } else {
- // If caller passes done != nil, it must arrange that
- // done has enough buffer for the number of simultaneous
- // RPCs that will be using that channel. If the channel
- // is totally unbuffered, it's best not to run at all.
- if cap(done) == 0 {
- log.Panic("rpc: done channel is unbuffered")
- }
- }
- call.Done = done
- client.send(call)
- return call
-}
-
-// Call invokes the named function, waits for it to complete, and returns its error status.
-func (client *Client) Call(serviceMethod string, args any, reply any) error {
- call := <-client.Go(serviceMethod, args, reply, make(chan *Call, 1)).Done
- return call.Error
-}
diff --git a/contrib/go/_std_1.21/src/net/rpc/debug.go b/contrib/go/_std_1.21/src/net/rpc/debug.go
deleted file mode 100644
index 9e499fd984..0000000000
--- a/contrib/go/_std_1.21/src/net/rpc/debug.go
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package rpc
-
-/*
- Some HTML presented at http://machine:port/debug/rpc
- Lists services, their methods, and some statistics, still rudimentary.
-*/
-
-import (
- "fmt"
- "html/template"
- "net/http"
- "sort"
-)
-
-const debugText = `<html>
- <body>
- <title>Services</title>
- {{range .}}
- <hr>
- Service {{.Name}}
- <hr>
- <table>
- <th align=center>Method</th><th align=center>Calls</th>
- {{range .Method}}
- <tr>
- <td align=left font=fixed>{{.Name}}({{.Type.ArgType}}, {{.Type.ReplyType}}) error</td>
- <td align=center>{{.Type.NumCalls}}</td>
- </tr>
- {{end}}
- </table>
- {{end}}
- </body>
- </html>`
-
-var debug = template.Must(template.New("RPC debug").Parse(debugText))
-
-// If set, print log statements for internal and I/O errors.
-var debugLog = false
-
-type debugMethod struct {
- Type *methodType
- Name string
-}
-
-type methodArray []debugMethod
-
-type debugService struct {
- Service *service
- Name string
- Method methodArray
-}
-
-type serviceArray []debugService
-
-func (s serviceArray) Len() int { return len(s) }
-func (s serviceArray) Less(i, j int) bool { return s[i].Name < s[j].Name }
-func (s serviceArray) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
-
-func (m methodArray) Len() int { return len(m) }
-func (m methodArray) Less(i, j int) bool { return m[i].Name < m[j].Name }
-func (m methodArray) Swap(i, j int) { m[i], m[j] = m[j], m[i] }
-
-type debugHTTP struct {
- *Server
-}
-
-// Runs at /debug/rpc
-func (server debugHTTP) ServeHTTP(w http.ResponseWriter, req *http.Request) {
- // Build a sorted version of the data.
- var services serviceArray
- server.serviceMap.Range(func(snamei, svci any) bool {
- svc := svci.(*service)
- ds := debugService{svc, snamei.(string), make(methodArray, 0, len(svc.method))}
- for mname, method := range svc.method {
- ds.Method = append(ds.Method, debugMethod{method, mname})
- }
- sort.Sort(ds.Method)
- services = append(services, ds)
- return true
- })
- sort.Sort(services)
- err := debug.Execute(w, services)
- if err != nil {
- fmt.Fprintln(w, "rpc: error executing template:", err.Error())
- }
-}
diff --git a/contrib/go/_std_1.21/src/net/rpc/server.go b/contrib/go/_std_1.21/src/net/rpc/server.go
deleted file mode 100644
index 5cea2cc507..0000000000
--- a/contrib/go/_std_1.21/src/net/rpc/server.go
+++ /dev/null
@@ -1,725 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-/*
-Package rpc provides access to the exported methods of an object across a
-network or other I/O connection. A server registers an object, making it visible
-as a service with the name of the type of the object. After registration, exported
-methods of the object will be accessible remotely. A server may register multiple
-objects (services) of different types but it is an error to register multiple
-objects of the same type.
-
-Only methods that satisfy these criteria will be made available for remote access;
-other methods will be ignored:
-
- - the method's type is exported.
- - the method is exported.
- - the method has two arguments, both exported (or builtin) types.
- - the method's second argument is a pointer.
- - the method has return type error.
-
-In effect, the method must look schematically like
-
- func (t *T) MethodName(argType T1, replyType *T2) error
-
-where T1 and T2 can be marshaled by encoding/gob.
-These requirements apply even if a different codec is used.
-(In the future, these requirements may soften for custom codecs.)
-
-The method's first argument represents the arguments provided by the caller; the
-second argument represents the result parameters to be returned to the caller.
-The method's return value, if non-nil, is passed back as a string that the client
-sees as if created by errors.New. If an error is returned, the reply parameter
-will not be sent back to the client.
-
-The server may handle requests on a single connection by calling ServeConn. More
-typically it will create a network listener and call Accept or, for an HTTP
-listener, HandleHTTP and http.Serve.
-
-A client wishing to use the service establishes a connection and then invokes
-NewClient on the connection. The convenience function Dial (DialHTTP) performs
-both steps for a raw network connection (an HTTP connection). The resulting
-Client object has two methods, Call and Go, that specify the service and method to
-call, a pointer containing the arguments, and a pointer to receive the result
-parameters.
-
-The Call method waits for the remote call to complete while the Go method
-launches the call asynchronously and signals completion using the Call
-structure's Done channel.
-
-Unless an explicit codec is set up, package encoding/gob is used to
-transport the data.
-
-Here is a simple example. A server wishes to export an object of type Arith:
-
- package server
-
- import "errors"
-
- type Args struct {
- A, B int
- }
-
- type Quotient struct {
- Quo, Rem int
- }
-
- type Arith int
-
- func (t *Arith) Multiply(args *Args, reply *int) error {
- *reply = args.A * args.B
- return nil
- }
-
- func (t *Arith) Divide(args *Args, quo *Quotient) error {
- if args.B == 0 {
- return errors.New("divide by zero")
- }
- quo.Quo = args.A / args.B
- quo.Rem = args.A % args.B
- return nil
- }
-
-The server calls (for HTTP service):
-
- arith := new(Arith)
- rpc.Register(arith)
- rpc.HandleHTTP()
- l, err := net.Listen("tcp", ":1234")
- if err != nil {
- log.Fatal("listen error:", err)
- }
- go http.Serve(l, nil)
-
-At this point, clients can see a service "Arith" with methods "Arith.Multiply" and
-"Arith.Divide". To invoke one, a client first dials the server:
-
- client, err := rpc.DialHTTP("tcp", serverAddress + ":1234")
- if err != nil {
- log.Fatal("dialing:", err)
- }
-
-Then it can make a remote call:
-
- // Synchronous call
- args := &server.Args{7,8}
- var reply int
- err = client.Call("Arith.Multiply", args, &reply)
- if err != nil {
- log.Fatal("arith error:", err)
- }
- fmt.Printf("Arith: %d*%d=%d", args.A, args.B, reply)
-
-or
-
- // Asynchronous call
- quotient := new(Quotient)
- divCall := client.Go("Arith.Divide", args, quotient, nil)
- replyCall := <-divCall.Done // will be equal to divCall
- // check errors, print, etc.
-
-A server implementation will often provide a simple, type-safe wrapper for the
-client.
-
-The net/rpc package is frozen and is not accepting new features.
-*/
-package rpc
-
-import (
- "bufio"
- "encoding/gob"
- "errors"
- "go/token"
- "io"
- "log"
- "net"
- "net/http"
- "reflect"
- "strings"
- "sync"
-)
-
-const (
- // Defaults used by HandleHTTP
- DefaultRPCPath = "/_goRPC_"
- DefaultDebugPath = "/debug/rpc"
-)
-
-// Precompute the reflect type for error. Can't use error directly
-// because Typeof takes an empty interface value. This is annoying.
-var typeOfError = reflect.TypeOf((*error)(nil)).Elem()
-
-type methodType struct {
- sync.Mutex // protects counters
- method reflect.Method
- ArgType reflect.Type
- ReplyType reflect.Type
- numCalls uint
-}
-
-type service struct {
- name string // name of service
- rcvr reflect.Value // receiver of methods for the service
- typ reflect.Type // type of the receiver
- method map[string]*methodType // registered methods
-}
-
-// Request is a header written before every RPC call. It is used internally
-// but documented here as an aid to debugging, such as when analyzing
-// network traffic.
-type Request struct {
- ServiceMethod string // format: "Service.Method"
- Seq uint64 // sequence number chosen by client
- next *Request // for free list in Server
-}
-
-// Response is a header written before every RPC return. It is used internally
-// but documented here as an aid to debugging, such as when analyzing
-// network traffic.
-type Response struct {
- ServiceMethod string // echoes that of the Request
- Seq uint64 // echoes that of the request
- Error string // error, if any.
- next *Response // for free list in Server
-}
-
-// Server represents an RPC Server.
-type Server struct {
- serviceMap sync.Map // map[string]*service
- reqLock sync.Mutex // protects freeReq
- freeReq *Request
- respLock sync.Mutex // protects freeResp
- freeResp *Response
-}
-
-// NewServer returns a new Server.
-func NewServer() *Server {
- return &Server{}
-}
-
-// DefaultServer is the default instance of *Server.
-var DefaultServer = NewServer()
-
-// Is this type exported or a builtin?
-func isExportedOrBuiltinType(t reflect.Type) bool {
- for t.Kind() == reflect.Pointer {
- t = t.Elem()
- }
- // PkgPath will be non-empty even for an exported type,
- // so we need to check the type name as well.
- return token.IsExported(t.Name()) || t.PkgPath() == ""
-}
-
-// Register publishes in the server the set of methods of the
-// receiver value that satisfy the following conditions:
-// - exported method of exported type
-// - two arguments, both of exported type
-// - the second argument is a pointer
-// - one return value, of type error
-//
-// It returns an error if the receiver is not an exported type or has
-// no suitable methods. It also logs the error using package log.
-// The client accesses each method using a string of the form "Type.Method",
-// where Type is the receiver's concrete type.
-func (server *Server) Register(rcvr any) error {
- return server.register(rcvr, "", false)
-}
-
-// RegisterName is like Register but uses the provided name for the type
-// instead of the receiver's concrete type.
-func (server *Server) RegisterName(name string, rcvr any) error {
- return server.register(rcvr, name, true)
-}
-
-// logRegisterError specifies whether to log problems during method registration.
-// To debug registration, recompile the package with this set to true.
-const logRegisterError = false
-
-func (server *Server) register(rcvr any, name string, useName bool) error {
- s := new(service)
- s.typ = reflect.TypeOf(rcvr)
- s.rcvr = reflect.ValueOf(rcvr)
- sname := name
- if !useName {
- sname = reflect.Indirect(s.rcvr).Type().Name()
- }
- if sname == "" {
- s := "rpc.Register: no service name for type " + s.typ.String()
- log.Print(s)
- return errors.New(s)
- }
- if !useName && !token.IsExported(sname) {
- s := "rpc.Register: type " + sname + " is not exported"
- log.Print(s)
- return errors.New(s)
- }
- s.name = sname
-
- // Install the methods
- s.method = suitableMethods(s.typ, logRegisterError)
-
- if len(s.method) == 0 {
- str := ""
-
- // To help the user, see if a pointer receiver would work.
- method := suitableMethods(reflect.PointerTo(s.typ), false)
- if len(method) != 0 {
- str = "rpc.Register: type " + sname + " has no exported methods of suitable type (hint: pass a pointer to value of that type)"
- } else {
- str = "rpc.Register: type " + sname + " has no exported methods of suitable type"
- }
- log.Print(str)
- return errors.New(str)
- }
-
- if _, dup := server.serviceMap.LoadOrStore(sname, s); dup {
- return errors.New("rpc: service already defined: " + sname)
- }
- return nil
-}
-
-// suitableMethods returns suitable Rpc methods of typ. It will log
-// errors if logErr is true.
-func suitableMethods(typ reflect.Type, logErr bool) map[string]*methodType {
- methods := make(map[string]*methodType)
- for m := 0; m < typ.NumMethod(); m++ {
- method := typ.Method(m)
- mtype := method.Type
- mname := method.Name
- // Method must be exported.
- if !method.IsExported() {
- continue
- }
- // Method needs three ins: receiver, *args, *reply.
- if mtype.NumIn() != 3 {
- if logErr {
- log.Printf("rpc.Register: method %q has %d input parameters; needs exactly three\n", mname, mtype.NumIn())
- }
- continue
- }
- // First arg need not be a pointer.
- argType := mtype.In(1)
- if !isExportedOrBuiltinType(argType) {
- if logErr {
- log.Printf("rpc.Register: argument type of method %q is not exported: %q\n", mname, argType)
- }
- continue
- }
- // Second arg must be a pointer.
- replyType := mtype.In(2)
- if replyType.Kind() != reflect.Pointer {
- if logErr {
- log.Printf("rpc.Register: reply type of method %q is not a pointer: %q\n", mname, replyType)
- }
- continue
- }
- // Reply type must be exported.
- if !isExportedOrBuiltinType(replyType) {
- if logErr {
- log.Printf("rpc.Register: reply type of method %q is not exported: %q\n", mname, replyType)
- }
- continue
- }
- // Method needs one out.
- if mtype.NumOut() != 1 {
- if logErr {
- log.Printf("rpc.Register: method %q has %d output parameters; needs exactly one\n", mname, mtype.NumOut())
- }
- continue
- }
- // The return type of the method must be error.
- if returnType := mtype.Out(0); returnType != typeOfError {
- if logErr {
- log.Printf("rpc.Register: return type of method %q is %q, must be error\n", mname, returnType)
- }
- continue
- }
- methods[mname] = &methodType{method: method, ArgType: argType, ReplyType: replyType}
- }
- return methods
-}
-
-// A value sent as a placeholder for the server's response value when the server
-// receives an invalid request. It is never decoded by the client since the Response
-// contains an error when it is used.
-var invalidRequest = struct{}{}
-
-func (server *Server) sendResponse(sending *sync.Mutex, req *Request, reply any, codec ServerCodec, errmsg string) {
- resp := server.getResponse()
- // Encode the response header
- resp.ServiceMethod = req.ServiceMethod
- if errmsg != "" {
- resp.Error = errmsg
- reply = invalidRequest
- }
- resp.Seq = req.Seq
- sending.Lock()
- err := codec.WriteResponse(resp, reply)
- if debugLog && err != nil {
- log.Println("rpc: writing response:", err)
- }
- sending.Unlock()
- server.freeResponse(resp)
-}
-
-func (m *methodType) NumCalls() (n uint) {
- m.Lock()
- n = m.numCalls
- m.Unlock()
- return n
-}
-
-func (s *service) call(server *Server, sending *sync.Mutex, wg *sync.WaitGroup, mtype *methodType, req *Request, argv, replyv reflect.Value, codec ServerCodec) {
- if wg != nil {
- defer wg.Done()
- }
- mtype.Lock()
- mtype.numCalls++
- mtype.Unlock()
- function := mtype.method.Func
- // Invoke the method, providing a new value for the reply.
- returnValues := function.Call([]reflect.Value{s.rcvr, argv, replyv})
- // The return value for the method is an error.
- errInter := returnValues[0].Interface()
- errmsg := ""
- if errInter != nil {
- errmsg = errInter.(error).Error()
- }
- server.sendResponse(sending, req, replyv.Interface(), codec, errmsg)
- server.freeRequest(req)
-}
-
-type gobServerCodec struct {
- rwc io.ReadWriteCloser
- dec *gob.Decoder
- enc *gob.Encoder
- encBuf *bufio.Writer
- closed bool
-}
-
-func (c *gobServerCodec) ReadRequestHeader(r *Request) error {
- return c.dec.Decode(r)
-}
-
-func (c *gobServerCodec) ReadRequestBody(body any) error {
- return c.dec.Decode(body)
-}
-
-func (c *gobServerCodec) WriteResponse(r *Response, body any) (err error) {
- if err = c.enc.Encode(r); err != nil {
- if c.encBuf.Flush() == nil {
- // Gob couldn't encode the header. Should not happen, so if it does,
- // shut down the connection to signal that the connection is broken.
- log.Println("rpc: gob error encoding response:", err)
- c.Close()
- }
- return
- }
- if err = c.enc.Encode(body); err != nil {
- if c.encBuf.Flush() == nil {
- // Was a gob problem encoding the body but the header has been written.
- // Shut down the connection to signal that the connection is broken.
- log.Println("rpc: gob error encoding body:", err)
- c.Close()
- }
- return
- }
- return c.encBuf.Flush()
-}
-
-func (c *gobServerCodec) Close() error {
- if c.closed {
- // Only call c.rwc.Close once; otherwise the semantics are undefined.
- return nil
- }
- c.closed = true
- return c.rwc.Close()
-}
-
-// ServeConn runs the server on a single connection.
-// ServeConn blocks, serving the connection until the client hangs up.
-// The caller typically invokes ServeConn in a go statement.
-// ServeConn uses the gob wire format (see package gob) on the
-// connection. To use an alternate codec, use ServeCodec.
-// See NewClient's comment for information about concurrent access.
-func (server *Server) ServeConn(conn io.ReadWriteCloser) {
- buf := bufio.NewWriter(conn)
- srv := &gobServerCodec{
- rwc: conn,
- dec: gob.NewDecoder(conn),
- enc: gob.NewEncoder(buf),
- encBuf: buf,
- }
- server.ServeCodec(srv)
-}
-
-// ServeCodec is like ServeConn but uses the specified codec to
-// decode requests and encode responses.
-func (server *Server) ServeCodec(codec ServerCodec) {
- sending := new(sync.Mutex)
- wg := new(sync.WaitGroup)
- for {
- service, mtype, req, argv, replyv, keepReading, err := server.readRequest(codec)
- if err != nil {
- if debugLog && err != io.EOF {
- log.Println("rpc:", err)
- }
- if !keepReading {
- break
- }
- // send a response if we actually managed to read a header.
- if req != nil {
- server.sendResponse(sending, req, invalidRequest, codec, err.Error())
- server.freeRequest(req)
- }
- continue
- }
- wg.Add(1)
- go service.call(server, sending, wg, mtype, req, argv, replyv, codec)
- }
- // We've seen that there are no more requests.
- // Wait for responses to be sent before closing codec.
- wg.Wait()
- codec.Close()
-}
-
-// ServeRequest is like ServeCodec but synchronously serves a single request.
-// It does not close the codec upon completion.
-func (server *Server) ServeRequest(codec ServerCodec) error {
- sending := new(sync.Mutex)
- service, mtype, req, argv, replyv, keepReading, err := server.readRequest(codec)
- if err != nil {
- if !keepReading {
- return err
- }
- // send a response if we actually managed to read a header.
- if req != nil {
- server.sendResponse(sending, req, invalidRequest, codec, err.Error())
- server.freeRequest(req)
- }
- return err
- }
- service.call(server, sending, nil, mtype, req, argv, replyv, codec)
- return nil
-}
-
-func (server *Server) getRequest() *Request {
- server.reqLock.Lock()
- req := server.freeReq
- if req == nil {
- req = new(Request)
- } else {
- server.freeReq = req.next
- *req = Request{}
- }
- server.reqLock.Unlock()
- return req
-}
-
-func (server *Server) freeRequest(req *Request) {
- server.reqLock.Lock()
- req.next = server.freeReq
- server.freeReq = req
- server.reqLock.Unlock()
-}
-
-func (server *Server) getResponse() *Response {
- server.respLock.Lock()
- resp := server.freeResp
- if resp == nil {
- resp = new(Response)
- } else {
- server.freeResp = resp.next
- *resp = Response{}
- }
- server.respLock.Unlock()
- return resp
-}
-
-func (server *Server) freeResponse(resp *Response) {
- server.respLock.Lock()
- resp.next = server.freeResp
- server.freeResp = resp
- server.respLock.Unlock()
-}
-
-func (server *Server) readRequest(codec ServerCodec) (service *service, mtype *methodType, req *Request, argv, replyv reflect.Value, keepReading bool, err error) {
- service, mtype, req, keepReading, err = server.readRequestHeader(codec)
- if err != nil {
- if !keepReading {
- return
- }
- // discard body
- codec.ReadRequestBody(nil)
- return
- }
-
- // Decode the argument value.
- argIsValue := false // if true, need to indirect before calling.
- if mtype.ArgType.Kind() == reflect.Pointer {
- argv = reflect.New(mtype.ArgType.Elem())
- } else {
- argv = reflect.New(mtype.ArgType)
- argIsValue = true
- }
- // argv guaranteed to be a pointer now.
- if err = codec.ReadRequestBody(argv.Interface()); err != nil {
- return
- }
- if argIsValue {
- argv = argv.Elem()
- }
-
- replyv = reflect.New(mtype.ReplyType.Elem())
-
- switch mtype.ReplyType.Elem().Kind() {
- case reflect.Map:
- replyv.Elem().Set(reflect.MakeMap(mtype.ReplyType.Elem()))
- case reflect.Slice:
- replyv.Elem().Set(reflect.MakeSlice(mtype.ReplyType.Elem(), 0, 0))
- }
- return
-}
-
-func (server *Server) readRequestHeader(codec ServerCodec) (svc *service, mtype *methodType, req *Request, keepReading bool, err error) {
- // Grab the request header.
- req = server.getRequest()
- err = codec.ReadRequestHeader(req)
- if err != nil {
- req = nil
- if err == io.EOF || err == io.ErrUnexpectedEOF {
- return
- }
- err = errors.New("rpc: server cannot decode request: " + err.Error())
- return
- }
-
- // We read the header successfully. If we see an error now,
- // we can still recover and move on to the next request.
- keepReading = true
-
- dot := strings.LastIndex(req.ServiceMethod, ".")
- if dot < 0 {
- err = errors.New("rpc: service/method request ill-formed: " + req.ServiceMethod)
- return
- }
- serviceName := req.ServiceMethod[:dot]
- methodName := req.ServiceMethod[dot+1:]
-
- // Look up the request.
- svci, ok := server.serviceMap.Load(serviceName)
- if !ok {
- err = errors.New("rpc: can't find service " + req.ServiceMethod)
- return
- }
- svc = svci.(*service)
- mtype = svc.method[methodName]
- if mtype == nil {
- err = errors.New("rpc: can't find method " + req.ServiceMethod)
- }
- return
-}
-
-// Accept accepts connections on the listener and serves requests
-// for each incoming connection. Accept blocks until the listener
-// returns a non-nil error. The caller typically invokes Accept in a
-// go statement.
-func (server *Server) Accept(lis net.Listener) {
- for {
- conn, err := lis.Accept()
- if err != nil {
- log.Print("rpc.Serve: accept:", err.Error())
- return
- }
- go server.ServeConn(conn)
- }
-}
-
-// Register publishes the receiver's methods in the DefaultServer.
-func Register(rcvr any) error { return DefaultServer.Register(rcvr) }
-
-// RegisterName is like Register but uses the provided name for the type
-// instead of the receiver's concrete type.
-func RegisterName(name string, rcvr any) error {
- return DefaultServer.RegisterName(name, rcvr)
-}
-
-// A ServerCodec implements reading of RPC requests and writing of
-// RPC responses for the server side of an RPC session.
-// The server calls ReadRequestHeader and ReadRequestBody in pairs
-// to read requests from the connection, and it calls WriteResponse to
-// write a response back. The server calls Close when finished with the
-// connection. ReadRequestBody may be called with a nil
-// argument to force the body of the request to be read and discarded.
-// See NewClient's comment for information about concurrent access.
-type ServerCodec interface {
- ReadRequestHeader(*Request) error
- ReadRequestBody(any) error
- WriteResponse(*Response, any) error
-
- // Close can be called multiple times and must be idempotent.
- Close() error
-}
-
-// ServeConn runs the DefaultServer on a single connection.
-// ServeConn blocks, serving the connection until the client hangs up.
-// The caller typically invokes ServeConn in a go statement.
-// ServeConn uses the gob wire format (see package gob) on the
-// connection. To use an alternate codec, use ServeCodec.
-// See NewClient's comment for information about concurrent access.
-func ServeConn(conn io.ReadWriteCloser) {
- DefaultServer.ServeConn(conn)
-}
-
-// ServeCodec is like ServeConn but uses the specified codec to
-// decode requests and encode responses.
-func ServeCodec(codec ServerCodec) {
- DefaultServer.ServeCodec(codec)
-}
-
-// ServeRequest is like ServeCodec but synchronously serves a single request.
-// It does not close the codec upon completion.
-func ServeRequest(codec ServerCodec) error {
- return DefaultServer.ServeRequest(codec)
-}
-
-// Accept accepts connections on the listener and serves requests
-// to DefaultServer for each incoming connection.
-// Accept blocks; the caller typically invokes it in a go statement.
-func Accept(lis net.Listener) { DefaultServer.Accept(lis) }
-
-// Can connect to RPC service using HTTP CONNECT to rpcPath.
-var connected = "200 Connected to Go RPC"
-
-// ServeHTTP implements an http.Handler that answers RPC requests.
-func (server *Server) ServeHTTP(w http.ResponseWriter, req *http.Request) {
- if req.Method != "CONNECT" {
- w.Header().Set("Content-Type", "text/plain; charset=utf-8")
- w.WriteHeader(http.StatusMethodNotAllowed)
- io.WriteString(w, "405 must CONNECT\n")
- return
- }
- conn, _, err := w.(http.Hijacker).Hijack()
- if err != nil {
- log.Print("rpc hijacking ", req.RemoteAddr, ": ", err.Error())
- return
- }
- io.WriteString(conn, "HTTP/1.0 "+connected+"\n\n")
- server.ServeConn(conn)
-}
-
-// HandleHTTP registers an HTTP handler for RPC messages on rpcPath,
-// and a debugging handler on debugPath.
-// It is still necessary to invoke http.Serve(), typically in a go statement.
-func (server *Server) HandleHTTP(rpcPath, debugPath string) {
- http.Handle(rpcPath, server)
- http.Handle(debugPath, debugHTTP{server})
-}
-
-// HandleHTTP registers an HTTP handler for RPC messages to DefaultServer
-// on DefaultRPCPath and a debugging handler on DefaultDebugPath.
-// It is still necessary to invoke http.Serve(), typically in a go statement.
-func HandleHTTP() {
- DefaultServer.HandleHTTP(DefaultRPCPath, DefaultDebugPath)
-}
diff --git a/contrib/go/_std_1.21/src/net/rpc/ya.make b/contrib/go/_std_1.21/src/net/rpc/ya.make
deleted file mode 100644
index 3cbc2793c9..0000000000
--- a/contrib/go/_std_1.21/src/net/rpc/ya.make
+++ /dev/null
@@ -1,9 +0,0 @@
-GO_LIBRARY()
-IF (OS_DARWIN AND ARCH_ARM64 AND RACE OR OS_DARWIN AND ARCH_ARM64 AND NOT RACE OR OS_DARWIN AND ARCH_X86_64 AND RACE OR OS_DARWIN AND ARCH_X86_64 AND NOT RACE OR OS_LINUX AND ARCH_AARCH64 AND RACE OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE OR OS_LINUX AND ARCH_X86_64 AND RACE OR OS_LINUX AND ARCH_X86_64 AND NOT RACE OR OS_WINDOWS AND ARCH_X86_64 AND RACE OR OS_WINDOWS AND ARCH_X86_64 AND NOT RACE)
- SRCS(
- client.go
- debug.go
- server.go
- )
-ENDIF()
-END()
diff --git a/contrib/go/_std_1.21/src/net/smtp/auth.go b/contrib/go/_std_1.21/src/net/smtp/auth.go
deleted file mode 100644
index 72eb16671f..0000000000
--- a/contrib/go/_std_1.21/src/net/smtp/auth.go
+++ /dev/null
@@ -1,109 +0,0 @@
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package smtp
-
-import (
- "crypto/hmac"
- "crypto/md5"
- "errors"
- "fmt"
-)
-
-// Auth is implemented by an SMTP authentication mechanism.
-type Auth interface {
- // Start begins an authentication with a server.
- // It returns the name of the authentication protocol
- // and optionally data to include in the initial AUTH message
- // sent to the server.
- // If it returns a non-nil error, the SMTP client aborts
- // the authentication attempt and closes the connection.
- Start(server *ServerInfo) (proto string, toServer []byte, err error)
-
- // Next continues the authentication. The server has just sent
- // the fromServer data. If more is true, the server expects a
- // response, which Next should return as toServer; otherwise
- // Next should return toServer == nil.
- // If Next returns a non-nil error, the SMTP client aborts
- // the authentication attempt and closes the connection.
- Next(fromServer []byte, more bool) (toServer []byte, err error)
-}
-
-// ServerInfo records information about an SMTP server.
-type ServerInfo struct {
- Name string // SMTP server name
- TLS bool // using TLS, with valid certificate for Name
- Auth []string // advertised authentication mechanisms
-}
-
-type plainAuth struct {
- identity, username, password string
- host string
-}
-
-// PlainAuth returns an Auth that implements the PLAIN authentication
-// mechanism as defined in RFC 4616. The returned Auth uses the given
-// username and password to authenticate to host and act as identity.
-// Usually identity should be the empty string, to act as username.
-//
-// PlainAuth will only send the credentials if the connection is using TLS
-// or is connected to localhost. Otherwise authentication will fail with an
-// error, without sending the credentials.
-func PlainAuth(identity, username, password, host string) Auth {
- return &plainAuth{identity, username, password, host}
-}
-
-func isLocalhost(name string) bool {
- return name == "localhost" || name == "127.0.0.1" || name == "::1"
-}
-
-func (a *plainAuth) Start(server *ServerInfo) (string, []byte, error) {
- // Must have TLS, or else localhost server.
- // Note: If TLS is not true, then we can't trust ANYTHING in ServerInfo.
- // In particular, it doesn't matter if the server advertises PLAIN auth.
- // That might just be the attacker saying
- // "it's ok, you can trust me with your password."
- if !server.TLS && !isLocalhost(server.Name) {
- return "", nil, errors.New("unencrypted connection")
- }
- if server.Name != a.host {
- return "", nil, errors.New("wrong host name")
- }
- resp := []byte(a.identity + "\x00" + a.username + "\x00" + a.password)
- return "PLAIN", resp, nil
-}
-
-func (a *plainAuth) Next(fromServer []byte, more bool) ([]byte, error) {
- if more {
- // We've already sent everything.
- return nil, errors.New("unexpected server challenge")
- }
- return nil, nil
-}
-
-type cramMD5Auth struct {
- username, secret string
-}
-
-// CRAMMD5Auth returns an Auth that implements the CRAM-MD5 authentication
-// mechanism as defined in RFC 2195.
-// The returned Auth uses the given username and secret to authenticate
-// to the server using the challenge-response mechanism.
-func CRAMMD5Auth(username, secret string) Auth {
- return &cramMD5Auth{username, secret}
-}
-
-func (a *cramMD5Auth) Start(server *ServerInfo) (string, []byte, error) {
- return "CRAM-MD5", nil, nil
-}
-
-func (a *cramMD5Auth) Next(fromServer []byte, more bool) ([]byte, error) {
- if more {
- d := hmac.New(md5.New, []byte(a.secret))
- d.Write(fromServer)
- s := make([]byte, 0, d.Size())
- return fmt.Appendf(nil, "%s %x", a.username, d.Sum(s)), nil
- }
- return nil, nil
-}
diff --git a/contrib/go/_std_1.21/src/net/smtp/smtp.go b/contrib/go/_std_1.21/src/net/smtp/smtp.go
deleted file mode 100644
index b5a025ef2a..0000000000
--- a/contrib/go/_std_1.21/src/net/smtp/smtp.go
+++ /dev/null
@@ -1,432 +0,0 @@
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package smtp implements the Simple Mail Transfer Protocol as defined in RFC 5321.
-// It also implements the following extensions:
-//
-// 8BITMIME RFC 1652
-// AUTH RFC 2554
-// STARTTLS RFC 3207
-//
-// Additional extensions may be handled by clients.
-//
-// The smtp package is frozen and is not accepting new features.
-// Some external packages provide more functionality. See:
-//
-// https://godoc.org/?q=smtp
-package smtp
-
-import (
- "crypto/tls"
- "encoding/base64"
- "errors"
- "fmt"
- "io"
- "net"
- "net/textproto"
- "strings"
-)
-
-// A Client represents a client connection to an SMTP server.
-type Client struct {
- // Text is the textproto.Conn used by the Client. It is exported to allow for
- // clients to add extensions.
- Text *textproto.Conn
- // keep a reference to the connection so it can be used to create a TLS
- // connection later
- conn net.Conn
- // whether the Client is using TLS
- tls bool
- serverName string
- // map of supported extensions
- ext map[string]string
- // supported auth mechanisms
- auth []string
- localName string // the name to use in HELO/EHLO
- didHello bool // whether we've said HELO/EHLO
- helloError error // the error from the hello
-}
-
-// Dial returns a new Client connected to an SMTP server at addr.
-// The addr must include a port, as in "mail.example.com:smtp".
-func Dial(addr string) (*Client, error) {
- conn, err := net.Dial("tcp", addr)
- if err != nil {
- return nil, err
- }
- host, _, _ := net.SplitHostPort(addr)
- return NewClient(conn, host)
-}
-
-// NewClient returns a new Client using an existing connection and host as a
-// server name to be used when authenticating.
-func NewClient(conn net.Conn, host string) (*Client, error) {
- text := textproto.NewConn(conn)
- _, _, err := text.ReadResponse(220)
- if err != nil {
- text.Close()
- return nil, err
- }
- c := &Client{Text: text, conn: conn, serverName: host, localName: "localhost"}
- _, c.tls = conn.(*tls.Conn)
- return c, nil
-}
-
-// Close closes the connection.
-func (c *Client) Close() error {
- return c.Text.Close()
-}
-
-// hello runs a hello exchange if needed.
-func (c *Client) hello() error {
- if !c.didHello {
- c.didHello = true
- err := c.ehlo()
- if err != nil {
- c.helloError = c.helo()
- }
- }
- return c.helloError
-}
-
-// Hello sends a HELO or EHLO to the server as the given host name.
-// Calling this method is only necessary if the client needs control
-// over the host name used. The client will introduce itself as "localhost"
-// automatically otherwise. If Hello is called, it must be called before
-// any of the other methods.
-func (c *Client) Hello(localName string) error {
- if err := validateLine(localName); err != nil {
- return err
- }
- if c.didHello {
- return errors.New("smtp: Hello called after other methods")
- }
- c.localName = localName
- return c.hello()
-}
-
-// cmd is a convenience function that sends a command and returns the response
-func (c *Client) cmd(expectCode int, format string, args ...any) (int, string, error) {
- id, err := c.Text.Cmd(format, args...)
- if err != nil {
- return 0, "", err
- }
- c.Text.StartResponse(id)
- defer c.Text.EndResponse(id)
- code, msg, err := c.Text.ReadResponse(expectCode)
- return code, msg, err
-}
-
-// helo sends the HELO greeting to the server. It should be used only when the
-// server does not support ehlo.
-func (c *Client) helo() error {
- c.ext = nil
- _, _, err := c.cmd(250, "HELO %s", c.localName)
- return err
-}
-
-// ehlo sends the EHLO (extended hello) greeting to the server. It
-// should be the preferred greeting for servers that support it.
-func (c *Client) ehlo() error {
- _, msg, err := c.cmd(250, "EHLO %s", c.localName)
- if err != nil {
- return err
- }
- ext := make(map[string]string)
- extList := strings.Split(msg, "\n")
- if len(extList) > 1 {
- extList = extList[1:]
- for _, line := range extList {
- k, v, _ := strings.Cut(line, " ")
- ext[k] = v
- }
- }
- if mechs, ok := ext["AUTH"]; ok {
- c.auth = strings.Split(mechs, " ")
- }
- c.ext = ext
- return err
-}
-
-// StartTLS sends the STARTTLS command and encrypts all further communication.
-// Only servers that advertise the STARTTLS extension support this function.
-func (c *Client) StartTLS(config *tls.Config) error {
- if err := c.hello(); err != nil {
- return err
- }
- _, _, err := c.cmd(220, "STARTTLS")
- if err != nil {
- return err
- }
- c.conn = tls.Client(c.conn, config)
- c.Text = textproto.NewConn(c.conn)
- c.tls = true
- return c.ehlo()
-}
-
-// TLSConnectionState returns the client's TLS connection state.
-// The return values are their zero values if StartTLS did
-// not succeed.
-func (c *Client) TLSConnectionState() (state tls.ConnectionState, ok bool) {
- tc, ok := c.conn.(*tls.Conn)
- if !ok {
- return
- }
- return tc.ConnectionState(), true
-}
-
-// Verify checks the validity of an email address on the server.
-// If Verify returns nil, the address is valid. A non-nil return
-// does not necessarily indicate an invalid address. Many servers
-// will not verify addresses for security reasons.
-func (c *Client) Verify(addr string) error {
- if err := validateLine(addr); err != nil {
- return err
- }
- if err := c.hello(); err != nil {
- return err
- }
- _, _, err := c.cmd(250, "VRFY %s", addr)
- return err
-}
-
-// Auth authenticates a client using the provided authentication mechanism.
-// A failed authentication closes the connection.
-// Only servers that advertise the AUTH extension support this function.
-func (c *Client) Auth(a Auth) error {
- if err := c.hello(); err != nil {
- return err
- }
- encoding := base64.StdEncoding
- mech, resp, err := a.Start(&ServerInfo{c.serverName, c.tls, c.auth})
- if err != nil {
- c.Quit()
- return err
- }
- resp64 := make([]byte, encoding.EncodedLen(len(resp)))
- encoding.Encode(resp64, resp)
- code, msg64, err := c.cmd(0, strings.TrimSpace(fmt.Sprintf("AUTH %s %s", mech, resp64)))
- for err == nil {
- var msg []byte
- switch code {
- case 334:
- msg, err = encoding.DecodeString(msg64)
- case 235:
- // the last message isn't base64 because it isn't a challenge
- msg = []byte(msg64)
- default:
- err = &textproto.Error{Code: code, Msg: msg64}
- }
- if err == nil {
- resp, err = a.Next(msg, code == 334)
- }
- if err != nil {
- // abort the AUTH
- c.cmd(501, "*")
- c.Quit()
- break
- }
- if resp == nil {
- break
- }
- resp64 = make([]byte, encoding.EncodedLen(len(resp)))
- encoding.Encode(resp64, resp)
- code, msg64, err = c.cmd(0, string(resp64))
- }
- return err
-}
-
-// Mail issues a MAIL command to the server using the provided email address.
-// If the server supports the 8BITMIME extension, Mail adds the BODY=8BITMIME
-// parameter. If the server supports the SMTPUTF8 extension, Mail adds the
-// SMTPUTF8 parameter.
-// This initiates a mail transaction and is followed by one or more Rcpt calls.
-func (c *Client) Mail(from string) error {
- if err := validateLine(from); err != nil {
- return err
- }
- if err := c.hello(); err != nil {
- return err
- }
- cmdStr := "MAIL FROM:<%s>"
- if c.ext != nil {
- if _, ok := c.ext["8BITMIME"]; ok {
- cmdStr += " BODY=8BITMIME"
- }
- if _, ok := c.ext["SMTPUTF8"]; ok {
- cmdStr += " SMTPUTF8"
- }
- }
- _, _, err := c.cmd(250, cmdStr, from)
- return err
-}
-
-// Rcpt issues a RCPT command to the server using the provided email address.
-// A call to Rcpt must be preceded by a call to Mail and may be followed by
-// a Data call or another Rcpt call.
-func (c *Client) Rcpt(to string) error {
- if err := validateLine(to); err != nil {
- return err
- }
- _, _, err := c.cmd(25, "RCPT TO:<%s>", to)
- return err
-}
-
-type dataCloser struct {
- c *Client
- io.WriteCloser
-}
-
-func (d *dataCloser) Close() error {
- d.WriteCloser.Close()
- _, _, err := d.c.Text.ReadResponse(250)
- return err
-}
-
-// Data issues a DATA command to the server and returns a writer that
-// can be used to write the mail headers and body. The caller should
-// close the writer before calling any more methods on c. A call to
-// Data must be preceded by one or more calls to Rcpt.
-func (c *Client) Data() (io.WriteCloser, error) {
- _, _, err := c.cmd(354, "DATA")
- if err != nil {
- return nil, err
- }
- return &dataCloser{c, c.Text.DotWriter()}, nil
-}
-
-var testHookStartTLS func(*tls.Config) // nil, except for tests
-
-// SendMail connects to the server at addr, switches to TLS if
-// possible, authenticates with the optional mechanism a if possible,
-// and then sends an email from address from, to addresses to, with
-// message msg.
-// The addr must include a port, as in "mail.example.com:smtp".
-//
-// The addresses in the to parameter are the SMTP RCPT addresses.
-//
-// The msg parameter should be an RFC 822-style email with headers
-// first, a blank line, and then the message body. The lines of msg
-// should be CRLF terminated. The msg headers should usually include
-// fields such as "From", "To", "Subject", and "Cc". Sending "Bcc"
-// messages is accomplished by including an email address in the to
-// parameter but not including it in the msg headers.
-//
-// The SendMail function and the net/smtp package are low-level
-// mechanisms and provide no support for DKIM signing, MIME
-// attachments (see the mime/multipart package), or other mail
-// functionality. Higher-level packages exist outside of the standard
-// library.
-func SendMail(addr string, a Auth, from string, to []string, msg []byte) error {
- if err := validateLine(from); err != nil {
- return err
- }
- for _, recp := range to {
- if err := validateLine(recp); err != nil {
- return err
- }
- }
- c, err := Dial(addr)
- if err != nil {
- return err
- }
- defer c.Close()
- if err = c.hello(); err != nil {
- return err
- }
- if ok, _ := c.Extension("STARTTLS"); ok {
- config := &tls.Config{ServerName: c.serverName}
- if testHookStartTLS != nil {
- testHookStartTLS(config)
- }
- if err = c.StartTLS(config); err != nil {
- return err
- }
- }
- if a != nil && c.ext != nil {
- if _, ok := c.ext["AUTH"]; !ok {
- return errors.New("smtp: server doesn't support AUTH")
- }
- if err = c.Auth(a); err != nil {
- return err
- }
- }
- if err = c.Mail(from); err != nil {
- return err
- }
- for _, addr := range to {
- if err = c.Rcpt(addr); err != nil {
- return err
- }
- }
- w, err := c.Data()
- if err != nil {
- return err
- }
- _, err = w.Write(msg)
- if err != nil {
- return err
- }
- err = w.Close()
- if err != nil {
- return err
- }
- return c.Quit()
-}
-
-// Extension reports whether an extension is support by the server.
-// The extension name is case-insensitive. If the extension is supported,
-// Extension also returns a string that contains any parameters the
-// server specifies for the extension.
-func (c *Client) Extension(ext string) (bool, string) {
- if err := c.hello(); err != nil {
- return false, ""
- }
- if c.ext == nil {
- return false, ""
- }
- ext = strings.ToUpper(ext)
- param, ok := c.ext[ext]
- return ok, param
-}
-
-// Reset sends the RSET command to the server, aborting the current mail
-// transaction.
-func (c *Client) Reset() error {
- if err := c.hello(); err != nil {
- return err
- }
- _, _, err := c.cmd(250, "RSET")
- return err
-}
-
-// Noop sends the NOOP command to the server. It does nothing but check
-// that the connection to the server is okay.
-func (c *Client) Noop() error {
- if err := c.hello(); err != nil {
- return err
- }
- _, _, err := c.cmd(250, "NOOP")
- return err
-}
-
-// Quit sends the QUIT command and closes the connection to the server.
-func (c *Client) Quit() error {
- if err := c.hello(); err != nil {
- return err
- }
- _, _, err := c.cmd(221, "QUIT")
- if err != nil {
- return err
- }
- return c.Text.Close()
-}
-
-// validateLine checks to see if a line has CR or LF as per RFC 5321.
-func validateLine(line string) error {
- if strings.ContainsAny(line, "\n\r") {
- return errors.New("smtp: A line must not contain CR or LF")
- }
- return nil
-}
diff --git a/contrib/go/_std_1.21/src/net/smtp/ya.make b/contrib/go/_std_1.21/src/net/smtp/ya.make
deleted file mode 100644
index 744ebf917e..0000000000
--- a/contrib/go/_std_1.21/src/net/smtp/ya.make
+++ /dev/null
@@ -1,8 +0,0 @@
-GO_LIBRARY()
-IF (OS_DARWIN AND ARCH_ARM64 AND RACE OR OS_DARWIN AND ARCH_ARM64 AND NOT RACE OR OS_DARWIN AND ARCH_X86_64 AND RACE OR OS_DARWIN AND ARCH_X86_64 AND NOT RACE OR OS_LINUX AND ARCH_AARCH64 AND RACE OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE OR OS_LINUX AND ARCH_X86_64 AND RACE OR OS_LINUX AND ARCH_X86_64 AND NOT RACE OR OS_WINDOWS AND ARCH_X86_64 AND RACE OR OS_WINDOWS AND ARCH_X86_64 AND NOT RACE)
- SRCS(
- auth.go
- smtp.go
- )
-ENDIF()
-END()
diff --git a/contrib/go/_std_1.21/src/net/textproto/ya.make b/contrib/go/_std_1.21/src/net/textproto/ya.make
index cae0295fe3..9e2b5bee4a 100644
--- a/contrib/go/_std_1.21/src/net/textproto/ya.make
+++ b/contrib/go/_std_1.21/src/net/textproto/ya.make
@@ -1,5 +1,5 @@
GO_LIBRARY()
-IF (OS_DARWIN AND ARCH_ARM64 AND RACE OR OS_DARWIN AND ARCH_ARM64 AND NOT RACE OR OS_DARWIN AND ARCH_X86_64 AND RACE OR OS_DARWIN AND ARCH_X86_64 AND NOT RACE OR OS_LINUX AND ARCH_AARCH64 AND RACE OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE OR OS_LINUX AND ARCH_X86_64 AND RACE OR OS_LINUX AND ARCH_X86_64 AND NOT RACE OR OS_WINDOWS AND ARCH_X86_64 AND RACE OR OS_WINDOWS AND ARCH_X86_64 AND NOT RACE)
+IF (TRUE)
SRCS(
header.go
pipeline.go
diff --git a/contrib/go/_std_1.21/src/net/url/ya.make b/contrib/go/_std_1.21/src/net/url/ya.make
index c46dbe1615..e1064cc895 100644
--- a/contrib/go/_std_1.21/src/net/url/ya.make
+++ b/contrib/go/_std_1.21/src/net/url/ya.make
@@ -1,5 +1,5 @@
GO_LIBRARY()
-IF (OS_DARWIN AND ARCH_ARM64 AND RACE OR OS_DARWIN AND ARCH_ARM64 AND NOT RACE OR OS_DARWIN AND ARCH_X86_64 AND RACE OR OS_DARWIN AND ARCH_X86_64 AND NOT RACE OR OS_LINUX AND ARCH_AARCH64 AND RACE OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE OR OS_LINUX AND ARCH_X86_64 AND RACE OR OS_LINUX AND ARCH_X86_64 AND NOT RACE OR OS_WINDOWS AND ARCH_X86_64 AND RACE OR OS_WINDOWS AND ARCH_X86_64 AND NOT RACE)
+IF (TRUE)
SRCS(
url.go
)
diff --git a/contrib/go/_std_1.21/src/net/ya.make b/contrib/go/_std_1.21/src/net/ya.make
index d915aa7a25..886e048ff0 100644
--- a/contrib/go/_std_1.21/src/net/ya.make
+++ b/contrib/go/_std_1.21/src/net/ya.make
@@ -1,160 +1,321 @@
GO_LIBRARY()
-
-NO_COMPILER_WARNINGS()
-
+IF (OS_DARWIN AND ARCH_ARM64 AND RACE AND CGO_ENABLED OR OS_DARWIN AND ARCH_ARM64 AND NOT RACE AND CGO_ENABLED OR OS_DARWIN AND ARCH_X86_64 AND RACE AND CGO_ENABLED OR OS_DARWIN AND ARCH_X86_64 AND NOT RACE AND CGO_ENABLED)
+ SRCS(
+ addrselect.go
+ cgo_darwin.go
+ cgo_unix.go
+ cgo_unix_syscall.go
+ conf.go
+ dial.go
+ dnsclient.go
+ dnsclient_unix.go
+ dnsconfig.go
+ dnsconfig_unix.go
+ error_posix.go
+ error_unix.go
+ fd_posix.go
+ fd_unix.go
+ file.go
+ file_unix.go
+ hook.go
+ hook_unix.go
+ hosts.go
+ interface.go
+ interface_bsd.go
+ interface_darwin.go
+ ip.go
+ iprawsock.go
+ iprawsock_posix.go
+ ipsock.go
+ ipsock_posix.go
+ lookup.go
+ lookup_unix.go
+ mac.go
+ mptcpsock_stub.go
+ net.go
+ netcgo_off.go
+ netgo_off.go
+ nss.go
+ parse.go
+ pipe.go
+ port.go
+ port_unix.go
+ rawconn.go
+ sendfile_unix_alt.go
+ sock_bsd.go
+ sock_posix.go
+ sockaddr_posix.go
+ sockopt_bsd.go
+ sockopt_posix.go
+ sockoptip_bsdvar.go
+ sockoptip_posix.go
+ splice_stub.go
+ sys_cloexec.go
+ tcpsock.go
+ tcpsock_posix.go
+ tcpsockopt_darwin.go
+ tcpsockopt_posix.go
+ udpsock.go
+ udpsock_posix.go
+ unixsock.go
+ unixsock_posix.go
+ unixsock_readmsg_cloexec.go
+ writev_unix.go
+ )
+
IF (CGO_ENABLED)
- IF (OS_LINUX)
- CGO_LDFLAGS(-lresolv)
- ENDIF()
+ CGO_SRCS(
+ cgo_unix_cgo_darwin.go
+ )
ENDIF()
-
-SRCS(
- addrselect.go
- conf.go
- dial.go
- dnsclient.go
- dnsclient_unix.go
- dnsconfig.go
- error_posix.go
- fd_posix.go
- file.go
- hook.go
- hosts.go
- interface.go
- ip.go
- iprawsock.go
- iprawsock_posix.go
- ipsock.go
- ipsock_posix.go
- lookup.go
- mac.go
- net.go
- netcgo_off.go
- netgo_off.go
- nss.go
- parse.go
- pipe.go
- port.go
- rawconn.go
- sock_posix.go
- sockaddr_posix.go
- sockopt_posix.go
- sockoptip_posix.go
- tcpsock.go
- tcpsock_posix.go
- tcpsockopt_posix.go
- udpsock.go
- udpsock_posix.go
- unixsock.go
- unixsock_posix.go
-)
-
-IF (OS_LINUX)
+ELSEIF (OS_DARWIN AND ARCH_ARM64 AND RACE AND NOT CGO_ENABLED OR OS_DARWIN AND ARCH_ARM64 AND NOT RACE AND NOT CGO_ENABLED OR OS_DARWIN AND ARCH_X86_64 AND RACE AND NOT CGO_ENABLED OR OS_DARWIN AND ARCH_X86_64 AND NOT RACE AND NOT CGO_ENABLED)
SRCS(
- dnsconfig_unix.go
- error_unix.go
- fd_unix.go
- file_unix.go
- hook_unix.go
- interface_linux.go
- lookup_unix.go
- mptcpsock_linux.go
- port_unix.go
- sendfile_linux.go
- sock_cloexec.go
- sock_linux.go
- sockopt_linux.go
- sockoptip_linux.go
- splice_linux.go
- tcpsockopt_unix.go
- unixsock_readmsg_cmsg_cloexec.go
- writev_unix.go
+ addrselect.go
+ cgo_darwin.go
+ cgo_unix.go
+ cgo_unix_syscall.go
+ conf.go
+ dial.go
+ dnsclient.go
+ dnsclient_unix.go
+ dnsconfig.go
+ dnsconfig_unix.go
+ error_posix.go
+ error_unix.go
+ fd_posix.go
+ fd_unix.go
+ file.go
+ file_unix.go
+ hook.go
+ hook_unix.go
+ hosts.go
+ interface.go
+ interface_bsd.go
+ interface_darwin.go
+ ip.go
+ iprawsock.go
+ iprawsock_posix.go
+ ipsock.go
+ ipsock_posix.go
+ lookup.go
+ lookup_unix.go
+ mac.go
+ mptcpsock_stub.go
+ net.go
+ netcgo_off.go
+ netgo_off.go
+ nss.go
+ parse.go
+ pipe.go
+ port.go
+ port_unix.go
+ rawconn.go
+ sendfile_unix_alt.go
+ sock_bsd.go
+ sock_posix.go
+ sockaddr_posix.go
+ sockopt_bsd.go
+ sockopt_posix.go
+ sockoptip_bsdvar.go
+ sockoptip_posix.go
+ splice_stub.go
+ sys_cloexec.go
+ tcpsock.go
+ tcpsock_posix.go
+ tcpsockopt_darwin.go
+ tcpsockopt_posix.go
+ udpsock.go
+ udpsock_posix.go
+ unixsock.go
+ unixsock_posix.go
+ unixsock_readmsg_cloexec.go
+ writev_unix.go
)
-
-ENDIF()
-
-IF (OS_LINUX AND CGO_ENABLED)
+ELSEIF (OS_LINUX AND ARCH_AARCH64 AND RACE AND CGO_ENABLED OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE AND CGO_ENABLED OR OS_LINUX AND ARCH_X86_64 AND RACE AND CGO_ENABLED OR OS_LINUX AND ARCH_X86_64 AND NOT RACE AND CGO_ENABLED)
SRCS(
- cgo_unix.go
+ addrselect.go
+ cgo_unix.go
+ conf.go
+ dial.go
+ dnsclient.go
+ dnsclient_unix.go
+ dnsconfig.go
+ dnsconfig_unix.go
+ error_posix.go
+ error_unix.go
+ fd_posix.go
+ fd_unix.go
+ file.go
+ file_unix.go
+ hook.go
+ hook_unix.go
+ hosts.go
+ interface.go
+ interface_linux.go
+ ip.go
+ iprawsock.go
+ iprawsock_posix.go
+ ipsock.go
+ ipsock_posix.go
+ lookup.go
+ lookup_unix.go
+ mac.go
+ mptcpsock_linux.go
+ net.go
+ netcgo_off.go
+ netgo_off.go
+ nss.go
+ parse.go
+ pipe.go
+ port.go
+ port_unix.go
+ rawconn.go
+ sendfile_linux.go
+ sock_cloexec.go
+ sock_linux.go
+ sock_posix.go
+ sockaddr_posix.go
+ sockopt_linux.go
+ sockopt_posix.go
+ sockoptip_linux.go
+ sockoptip_posix.go
+ splice_linux.go
+ tcpsock.go
+ tcpsock_posix.go
+ tcpsockopt_posix.go
+ tcpsockopt_unix.go
+ udpsock.go
+ udpsock_posix.go
+ unixsock.go
+ unixsock_posix.go
+ unixsock_readmsg_cmsg_cloexec.go
+ writev_unix.go
)
-
+
+IF (CGO_ENABLED)
CGO_SRCS(
- cgo_linux.go
- cgo_resnew.go
- cgo_socknew.go
- cgo_unix_cgo.go
- cgo_unix_cgo_res.go
+ cgo_linux.go
+ cgo_resnew.go
+ cgo_socknew.go
+ cgo_unix_cgo.go
+ cgo_unix_cgo_res.go
)
-ELSE()
- IF(OS_LINUX)
- SRCS(
- cgo_stub.go
- )
- ENDIF()
ENDIF()
-
-IF (OS_DARWIN)
+ELSEIF (OS_LINUX AND ARCH_AARCH64 AND RACE AND NOT CGO_ENABLED OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE AND NOT CGO_ENABLED OR OS_LINUX AND ARCH_X86_64 AND RACE AND NOT CGO_ENABLED OR OS_LINUX AND ARCH_X86_64 AND NOT RACE AND NOT CGO_ENABLED)
SRCS(
- cgo_darwin.go
- cgo_unix.go
- cgo_unix_syscall.go
- dnsconfig_unix.go
- error_unix.go
- fd_unix.go
- file_unix.go
- hook_unix.go
- interface_bsd.go
- interface_darwin.go
- lookup_unix.go
- mptcpsock_stub.go
- port_unix.go
- sendfile_unix_alt.go
- sock_bsd.go
- sockopt_bsd.go
- sockoptip_bsdvar.go
- splice_stub.go
- sys_cloexec.go
- tcpsockopt_darwin.go
- unixsock_readmsg_cloexec.go
- writev_unix.go
+ addrselect.go
+ cgo_stub.go
+ conf.go
+ dial.go
+ dnsclient.go
+ dnsclient_unix.go
+ dnsconfig.go
+ dnsconfig_unix.go
+ error_posix.go
+ error_unix.go
+ fd_posix.go
+ fd_unix.go
+ file.go
+ file_unix.go
+ hook.go
+ hook_unix.go
+ hosts.go
+ interface.go
+ interface_linux.go
+ ip.go
+ iprawsock.go
+ iprawsock_posix.go
+ ipsock.go
+ ipsock_posix.go
+ lookup.go
+ lookup_unix.go
+ mac.go
+ mptcpsock_linux.go
+ net.go
+ netcgo_off.go
+ netgo_off.go
+ nss.go
+ parse.go
+ pipe.go
+ port.go
+ port_unix.go
+ rawconn.go
+ sendfile_linux.go
+ sock_cloexec.go
+ sock_linux.go
+ sock_posix.go
+ sockaddr_posix.go
+ sockopt_linux.go
+ sockopt_posix.go
+ sockoptip_linux.go
+ sockoptip_posix.go
+ splice_linux.go
+ tcpsock.go
+ tcpsock_posix.go
+ tcpsockopt_posix.go
+ tcpsockopt_unix.go
+ udpsock.go
+ udpsock_posix.go
+ unixsock.go
+ unixsock_posix.go
+ unixsock_readmsg_cmsg_cloexec.go
+ writev_unix.go
)
-
-ENDIF()
-
-IF (OS_DARWIN AND CGO_ENABLED)
- CGO_SRCS(cgo_unix_cgo_darwin.go)
-ENDIF()
-
-IF (OS_WINDOWS)
+ELSEIF (OS_WINDOWS AND ARCH_X86_64 AND RACE AND CGO_ENABLED OR OS_WINDOWS AND ARCH_X86_64 AND RACE AND NOT CGO_ENABLED OR OS_WINDOWS AND ARCH_X86_64 AND NOT RACE AND CGO_ENABLED OR OS_WINDOWS AND ARCH_X86_64 AND NOT RACE AND NOT CGO_ENABLED)
SRCS(
- dnsconfig_windows.go
- error_windows.go
- fd_windows.go
- file_windows.go
- hook_windows.go
- interface_windows.go
- lookup_windows.go
- mptcpsock_stub.go
- sendfile_windows.go
- sock_windows.go
- sockopt_windows.go
- sockoptip_windows.go
- splice_stub.go
- tcpsockopt_windows.go
- unixsock_readmsg_other.go
+ addrselect.go
+ conf.go
+ dial.go
+ dnsclient.go
+ dnsclient_unix.go
+ dnsconfig.go
+ dnsconfig_windows.go
+ error_posix.go
+ error_windows.go
+ fd_posix.go
+ fd_windows.go
+ file.go
+ file_windows.go
+ hook.go
+ hook_windows.go
+ hosts.go
+ interface.go
+ interface_windows.go
+ ip.go
+ iprawsock.go
+ iprawsock_posix.go
+ ipsock.go
+ ipsock_posix.go
+ lookup.go
+ lookup_windows.go
+ mac.go
+ mptcpsock_stub.go
+ net.go
+ netcgo_off.go
+ netgo_off.go
+ nss.go
+ parse.go
+ pipe.go
+ port.go
+ rawconn.go
+ sendfile_windows.go
+ sock_posix.go
+ sock_windows.go
+ sockaddr_posix.go
+ sockopt_posix.go
+ sockopt_windows.go
+ sockoptip_posix.go
+ sockoptip_windows.go
+ splice_stub.go
+ tcpsock.go
+ tcpsock_posix.go
+ tcpsockopt_posix.go
+ tcpsockopt_windows.go
+ udpsock.go
+ udpsock_posix.go
+ unixsock.go
+ unixsock_posix.go
+ unixsock_readmsg_other.go
)
-
ENDIF()
-
END()
-
-RECURSE(
- http
- internal
- mail
- netip
- rpc
- smtp
- textproto
- url
-) \ No newline at end of file