mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-30 05:56:54 -05:00
fix some typo (#1482)
This commit is contained in:
parent
423d566024
commit
b057a37fd6
@ -64,7 +64,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
return loadJSONPB(bytes.NewReader(data))
|
return loadJSONPB(bytes.NewReader(data))
|
||||||
default:
|
default:
|
||||||
return nil, newError("unknow type")
|
return nil, newError("unknown type")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Package merge provides the capbility to merge multiple
|
Package merge provides the capability to merge multiple
|
||||||
JSON files or contents into one output.
|
JSON files or contents into one output.
|
||||||
|
|
||||||
Merge Rules:
|
Merge Rules:
|
||||||
|
@ -58,7 +58,7 @@ func Merge(input interface{}, m map[string]interface{}) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return newError("unknow merge input type")
|
return newError("unknown merge input type")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ func makeToJSONMergeFunc(converter func(v []byte) ([]byte, error)) MergeFunc {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return newError("unknow merge input type")
|
return newError("unknown merge input type")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ type strategyLeastLoadConfig struct {
|
|||||||
Baselines []duration.Duration `json:"baselines,omitempty"`
|
Baselines []duration.Duration `json:"baselines,omitempty"`
|
||||||
// expected nodes count to select
|
// expected nodes count to select
|
||||||
Expected int32 `json:"expected,omitempty"`
|
Expected int32 `json:"expected,omitempty"`
|
||||||
// max acceptable rtt, filter away high delay nodes. defalut 0
|
// max acceptable rtt, filter away high delay nodes. default 0
|
||||||
MaxRTT duration.Duration `json:"maxRTT,omitempty"`
|
MaxRTT duration.Duration `json:"maxRTT,omitempty"`
|
||||||
// acceptable failure rate
|
// acceptable failure rate
|
||||||
Tolerance float64 `json:"tolerance,omitempty"`
|
Tolerance float64 `json:"tolerance,omitempty"`
|
||||||
|
@ -63,7 +63,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
return loadV2JsonPb(data)
|
return loadV2JsonPb(data)
|
||||||
default:
|
default:
|
||||||
return nil, newError("unknow type")
|
return nil, newError("unknown type")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
|
@ -260,7 +260,7 @@ func (s *Server) handlePlainHTTP(ctx context.Context, request *http.Request, wri
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Plain HTTP request is not a stream. The request always finishes before response. Hense request has to be closed later.
|
// Plain HTTP request is not a stream. The request always finishes before response. Hence, request has to be closed later.
|
||||||
defer common.Close(link.Writer)
|
defer common.Close(link.Writer)
|
||||||
var result error = errWaitAnother
|
var result error = errWaitAnother
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ import (
|
|||||||
"github.com/v2fly/v2ray-core/v4/transport/internet"
|
"github.com/v2fly/v2ray-core/v4/transport/internet"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Client is a inbound handler for Shadowsocks protocol
|
// Client is an inbound handler for Shadowsocks protocol
|
||||||
type Client struct {
|
type Client struct {
|
||||||
serverPicker protocol.ServerPicker
|
serverPicker protocol.ServerPicker
|
||||||
policyManager policy.Manager
|
policyManager policy.Manager
|
||||||
|
@ -17,7 +17,7 @@ message Account {
|
|||||||
|
|
||||||
// AuthType is the authentication type of Socks proxy.
|
// AuthType is the authentication type of Socks proxy.
|
||||||
enum AuthType {
|
enum AuthType {
|
||||||
// NO_AUTH is for anounymous authentication.
|
// NO_AUTH is for anonymous authentication.
|
||||||
NO_AUTH = 0;
|
NO_AUTH = 0;
|
||||||
// PASSWORD is for username/password authentication.
|
// PASSWORD is for username/password authentication.
|
||||||
PASSWORD = 1;
|
PASSWORD = 1;
|
||||||
|
@ -69,7 +69,7 @@ func TestReadUsernamePassword(t *testing.T) {
|
|||||||
t.Error("for input: ", testCase.Input, " expect username ", testCase.Username, " but actually ", username)
|
t.Error("for input: ", testCase.Input, " expect username ", testCase.Username, " but actually ", username)
|
||||||
}
|
}
|
||||||
if testCase.Password != password {
|
if testCase.Password != password {
|
||||||
t.Error("for input: ", testCase.Input, " expect passowrd ", testCase.Password, " but actually ", password)
|
t.Error("for input: ", testCase.Input, " expect password ", testCase.Password, " but actually ", password)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ import (
|
|||||||
"github.com/v2fly/v2ray-core/v4/transport/internet"
|
"github.com/v2fly/v2ray-core/v4/transport/internet"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Client is a inbound handler for trojan protocol
|
// Client is an inbound handler for trojan protocol
|
||||||
type Client struct {
|
type Client struct {
|
||||||
serverPicker protocol.ServerPicker
|
serverPicker protocol.ServerPicker
|
||||||
policyManager policy.Manager
|
policyManager policy.Manager
|
||||||
@ -103,7 +103,7 @@ func (c *Client) Process(ctx context.Context, link *transport.Link, dialer inter
|
|||||||
return newError("failed to write A request payload").Base(err).AtWarning()
|
return newError("failed to write A request payload").Base(err).AtWarning()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flush; bufferWriter.WriteMultiBufer now is bufferWriter.writer.WriteMultiBuffer
|
// Flush; bufferWriter.WriteMultiBuffer now is bufferWriter.writer.WriteMultiBuffer
|
||||||
if err = bufferWriter.SetBuffered(false); err != nil {
|
if err = bufferWriter.SetBuffered(false); err != nil {
|
||||||
return newError("failed to flush payload").Base(err).AtWarning()
|
return newError("failed to flush payload").Base(err).AtWarning()
|
||||||
}
|
}
|
||||||
|
@ -400,7 +400,7 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection i
|
|||||||
// default: clientReader := reader
|
// default: clientReader := reader
|
||||||
clientReader := encoding.DecodeBodyAddons(reader, request, requestAddons)
|
clientReader := encoding.DecodeBodyAddons(reader, request, requestAddons)
|
||||||
|
|
||||||
// from clientReader.ReadMultiBuffer to serverWriter.WriteMultiBufer
|
// from clientReader.ReadMultiBuffer to serverWriter.WriteMultiBuffer
|
||||||
if err := buf.Copy(clientReader, serverWriter, buf.UpdateActivity(timer)); err != nil {
|
if err := buf.Copy(clientReader, serverWriter, buf.UpdateActivity(timer)); err != nil {
|
||||||
return newError("failed to transfer request payload").Base(err).AtInfo()
|
return newError("failed to transfer request payload").Base(err).AtInfo()
|
||||||
}
|
}
|
||||||
@ -428,12 +428,12 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection i
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flush; bufferWriter.WriteMultiBufer now is bufferWriter.writer.WriteMultiBuffer
|
// Flush; bufferWriter.WriteMultiBuffer now is bufferWriter.writer.WriteMultiBuffer
|
||||||
if err := bufferWriter.SetBuffered(false); err != nil {
|
if err := bufferWriter.SetBuffered(false); err != nil {
|
||||||
return newError("failed to write A response payload").Base(err).AtWarning()
|
return newError("failed to write A response payload").Base(err).AtWarning()
|
||||||
}
|
}
|
||||||
|
|
||||||
// from serverReader.ReadMultiBuffer to clientWriter.WriteMultiBufer
|
// from serverReader.ReadMultiBuffer to clientWriter.WriteMultiBuffer
|
||||||
if err := buf.Copy(serverReader, clientWriter, buf.UpdateActivity(timer)); err != nil {
|
if err := buf.Copy(serverReader, clientWriter, buf.UpdateActivity(timer)); err != nil {
|
||||||
return newError("failed to transfer response payload").Base(err).AtInfo()
|
return newError("failed to transfer response payload").Base(err).AtInfo()
|
||||||
}
|
}
|
||||||
|
@ -143,12 +143,12 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
|
|||||||
return err // ...
|
return err // ...
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flush; bufferWriter.WriteMultiBufer now is bufferWriter.writer.WriteMultiBuffer
|
// Flush; bufferWriter.WriteMultiBuffer now is bufferWriter.writer.WriteMultiBuffer
|
||||||
if err := bufferWriter.SetBuffered(false); err != nil {
|
if err := bufferWriter.SetBuffered(false); err != nil {
|
||||||
return newError("failed to write A request payload").Base(err).AtWarning()
|
return newError("failed to write A request payload").Base(err).AtWarning()
|
||||||
}
|
}
|
||||||
|
|
||||||
// from clientReader.ReadMultiBuffer to serverWriter.WriteMultiBufer
|
// from clientReader.ReadMultiBuffer to serverWriter.WriteMultiBuffer
|
||||||
if err := buf.Copy(clientReader, serverWriter, buf.UpdateActivity(timer)); err != nil {
|
if err := buf.Copy(clientReader, serverWriter, buf.UpdateActivity(timer)); err != nil {
|
||||||
return newError("failed to transfer request payload").Base(err).AtInfo()
|
return newError("failed to transfer request payload").Base(err).AtInfo()
|
||||||
}
|
}
|
||||||
@ -167,7 +167,7 @@ func (h *Handler) Process(ctx context.Context, link *transport.Link, dialer inte
|
|||||||
// default: serverReader := buf.NewReader(conn)
|
// default: serverReader := buf.NewReader(conn)
|
||||||
serverReader := encoding.DecodeBodyAddons(conn, request, responseAddons)
|
serverReader := encoding.DecodeBodyAddons(conn, request, responseAddons)
|
||||||
|
|
||||||
// from serverReader.ReadMultiBuffer to clientWriter.WriteMultiBufer
|
// from serverReader.ReadMultiBuffer to clientWriter.WriteMultiBuffer
|
||||||
if err := buf.Copy(serverReader, clientWriter, buf.UpdateActivity(timer)); err != nil {
|
if err := buf.Copy(serverReader, clientWriter, buf.UpdateActivity(timer)); err != nil {
|
||||||
return newError("failed to transfer response payload").Base(err).AtInfo()
|
return newError("failed to transfer response payload").Base(err).AtInfo()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user