fea: access for ceci.

This commit is contained in:
Daniel Ding
2025-04-13 15:33:35 +08:00
parent d7622bbc05
commit 754d933e68
859 changed files with 120670 additions and 145098 deletions

View File

@@ -6,10 +6,10 @@
// as specified in RFC 6455.
//
// This package currently lacks some features found in an alternative
// and more actively maintained WebSocket package:
//
// https://godoc.org/github.com/gorilla/websocket
// and more actively maintained WebSocket packages:
//
// - [github.com/gorilla/websocket]
// - [github.com/coder/websocket]
package websocket // import "golang.org/x/net/websocket"
import (
@@ -18,7 +18,6 @@ import (
"encoding/json"
"errors"
"io"
"io/ioutil"
"net"
"net/http"
"net/url"
@@ -209,7 +208,7 @@ again:
n, err = ws.frameReader.Read(msg)
if err == io.EOF {
if trailer := ws.frameReader.TrailerReader(); trailer != nil {
io.Copy(ioutil.Discard, trailer)
io.Copy(io.Discard, trailer)
}
ws.frameReader = nil
goto again
@@ -331,7 +330,7 @@ func (cd Codec) Receive(ws *Conn, v interface{}) (err error) {
ws.rio.Lock()
defer ws.rio.Unlock()
if ws.frameReader != nil {
_, err = io.Copy(ioutil.Discard, ws.frameReader)
_, err = io.Copy(io.Discard, ws.frameReader)
if err != nil {
return err
}
@@ -363,7 +362,7 @@ again:
return ErrFrameTooLarge
}
payloadType := frame.PayloadType()
data, err := ioutil.ReadAll(frame)
data, err := io.ReadAll(frame)
if err != nil {
return err
}
@@ -416,7 +415,6 @@ Trivial usage:
// send binary frame
data = []byte{0, 1, 2}
websocket.Message.Send(ws, data)
*/
var Message = Codec{marshal, unmarshal}