mirror of https://github.com/v2ray/v2ray-core
update dependencies
parent
f1934a4ff2
commit
840c559490
|
@ -1,34 +0,0 @@
|
||||||
version: "{build}"
|
|
||||||
|
|
||||||
os: Windows Server 2012 R2
|
|
||||||
|
|
||||||
environment:
|
|
||||||
GOPATH: c:\gopath
|
|
||||||
CGO_ENABLED: 0
|
|
||||||
TIMESCALE_FACTOR: 20
|
|
||||||
matrix:
|
|
||||||
- GOARCH: 386
|
|
||||||
- GOARCH: amd64
|
|
||||||
|
|
||||||
clone_folder: c:\gopath\src\v2ray.com/core/external/github.com\lucas-clemente\quic-go
|
|
||||||
|
|
||||||
install:
|
|
||||||
- rmdir c:\go /s /q
|
|
||||||
- appveyor DownloadFile https://storage.googleapis.com/golang/go1.11.windows-amd64.zip
|
|
||||||
- 7z x go1.11.windows-amd64.zip -y -oC:\ > NUL
|
|
||||||
- set PATH=%PATH%;%GOPATH%\bin\windows_%GOARCH%;%GOPATH%\bin
|
|
||||||
- echo %PATH%
|
|
||||||
- echo %GOPATH%
|
|
||||||
- go get v2ray.com/core/external/github.com/onsi/ginkgo/ginkgo
|
|
||||||
- go get v2ray.com/core/external/github.com/onsi/gomega
|
|
||||||
- go version
|
|
||||||
- go env
|
|
||||||
- go get -v -t ./...
|
|
||||||
|
|
||||||
build_script:
|
|
||||||
- ginkgo -r -v -randomizeAllSpecs -randomizeSuites -trace -skipPackage benchmark,integrationtests
|
|
||||||
- ginkgo -randomizeAllSpecs -randomizeSuites -trace benchmark -- -samples=1
|
|
||||||
|
|
||||||
test: off
|
|
||||||
|
|
||||||
deploy: off
|
|
|
@ -1,18 +0,0 @@
|
||||||
coverage:
|
|
||||||
round: nearest
|
|
||||||
ignore:
|
|
||||||
- streams_map_incoming_bidi.go
|
|
||||||
- streams_map_incoming_uni.go
|
|
||||||
- streams_map_outgoing_bidi.go
|
|
||||||
- streams_map_outgoing_uni.go
|
|
||||||
- h2quic/gzipreader.go
|
|
||||||
- h2quic/response.go
|
|
||||||
- internal/ackhandler/packet_linkedlist.go
|
|
||||||
- internal/utils/byteinterval_linkedlist.go
|
|
||||||
- internal/utils/packetinterval_linkedlist.go
|
|
||||||
- internal/utils/linkedlist/linkedlist.go
|
|
||||||
status:
|
|
||||||
project:
|
|
||||||
default:
|
|
||||||
threshold: 0.5
|
|
||||||
patch: false
|
|
|
@ -53,6 +53,7 @@ var ErrOpenerNotYetAvailable = errors.New("CryptoSetup: opener at this encryptio
|
||||||
|
|
||||||
type cryptoSetup struct {
|
type cryptoSetup struct {
|
||||||
tlsConf *qtls.Config
|
tlsConf *qtls.Config
|
||||||
|
conn *qtls.Conn
|
||||||
|
|
||||||
messageChan chan []byte
|
messageChan chan []byte
|
||||||
|
|
||||||
|
@ -124,7 +125,7 @@ func NewCryptoSetupClient(
|
||||||
currentVersion,
|
currentVersion,
|
||||||
logger,
|
logger,
|
||||||
)
|
)
|
||||||
return newCryptoSetup(
|
cs, clientHelloWritten, err := newCryptoSetup(
|
||||||
initialStream,
|
initialStream,
|
||||||
handshakeStream,
|
handshakeStream,
|
||||||
connID,
|
connID,
|
||||||
|
@ -135,6 +136,11 @@ func NewCryptoSetupClient(
|
||||||
logger,
|
logger,
|
||||||
perspective,
|
perspective,
|
||||||
)
|
)
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
cs.conn = qtls.Client(nil, cs.tlsConf)
|
||||||
|
return cs, clientHelloWritten, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewCryptoSetupServer creates a new crypto setup for the server
|
// NewCryptoSetupServer creates a new crypto setup for the server
|
||||||
|
@ -167,7 +173,11 @@ func NewCryptoSetupServer(
|
||||||
logger,
|
logger,
|
||||||
perspective,
|
perspective,
|
||||||
)
|
)
|
||||||
return cs, err
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
cs.conn = qtls.Server(nil, cs.tlsConf)
|
||||||
|
return cs, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func newCryptoSetup(
|
func newCryptoSetup(
|
||||||
|
@ -180,7 +190,7 @@ func newCryptoSetup(
|
||||||
tlsConf *tls.Config,
|
tlsConf *tls.Config,
|
||||||
logger utils.Logger,
|
logger utils.Logger,
|
||||||
perspective protocol.Perspective,
|
perspective protocol.Perspective,
|
||||||
) (CryptoSetup, <-chan struct{} /* ClientHello written */, error) {
|
) (*cryptoSetup, <-chan struct{} /* ClientHello written */, error) {
|
||||||
initialSealer, initialOpener, err := NewInitialAEAD(connID, perspective)
|
initialSealer, initialOpener, err := NewInitialAEAD(connID, perspective)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
|
@ -214,19 +224,12 @@ func newCryptoSetup(
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *cryptoSetup) RunHandshake() error {
|
func (h *cryptoSetup) RunHandshake() error {
|
||||||
var conn *qtls.Conn
|
|
||||||
switch h.perspective {
|
|
||||||
case protocol.PerspectiveClient:
|
|
||||||
conn = qtls.Client(nil, h.tlsConf)
|
|
||||||
case protocol.PerspectiveServer:
|
|
||||||
conn = qtls.Server(nil, h.tlsConf)
|
|
||||||
}
|
|
||||||
// Handle errors that might occur when HandleData() is called.
|
// Handle errors that might occur when HandleData() is called.
|
||||||
handshakeErrChan := make(chan error, 1)
|
handshakeErrChan := make(chan error, 1)
|
||||||
handshakeComplete := make(chan struct{})
|
handshakeComplete := make(chan struct{})
|
||||||
go func() {
|
go func() {
|
||||||
defer close(h.handshakeDone)
|
defer close(h.handshakeDone)
|
||||||
if err := conn.Handshake(); err != nil {
|
if err := h.conn.Handshake(); err != nil {
|
||||||
handshakeErrChan <- err
|
handshakeErrChan <- err
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -327,7 +330,6 @@ func (h *cryptoSetup) handleMessageForServer(msgType messageType) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// get the handshake read key
|
// get the handshake read key
|
||||||
// TODO: check that the initial stream doesn't have any more data
|
|
||||||
select {
|
select {
|
||||||
case <-h.receivedReadKey:
|
case <-h.receivedReadKey:
|
||||||
case <-h.handshakeErrChan:
|
case <-h.handshakeErrChan:
|
||||||
|
@ -526,6 +528,10 @@ func (h *cryptoSetup) GetOpener(level protocol.EncryptionLevel) (Opener, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *cryptoSetup) ConnectionState() ConnectionState {
|
func (h *cryptoSetup) ConnectionState() ConnectionState {
|
||||||
// TODO: return the connection state
|
connState := h.conn.ConnectionState()
|
||||||
return ConnectionState{}
|
return ConnectionState{
|
||||||
|
HandshakeComplete: connState.HandshakeComplete,
|
||||||
|
ServerName: connState.ServerName,
|
||||||
|
PeerCertificates: connState.PeerCertificates,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,9 +17,22 @@ rsync -rv "./github.com/lucas-clemente/quic-go/vendor/github.com/cloudflare/" ".
|
||||||
rsync -rv "./github.com/lucas-clemente/quic-go/vendor/github.com/marten-seemann/" "./github.com/marten-seemann/"
|
rsync -rv "./github.com/lucas-clemente/quic-go/vendor/github.com/marten-seemann/" "./github.com/marten-seemann/"
|
||||||
rm -rf "./github.com/lucas-clemente/quic-go/vendor/"
|
rm -rf "./github.com/lucas-clemente/quic-go/vendor/"
|
||||||
|
|
||||||
rsync -rv "$GOPATH/src/github.com/gorilla/websocket/" "$GOPATH/src/v2ray.com/core/external/github.com/gorilla/websocket/"
|
rsync -rv "$GOPATH/src/github.com/gorilla/websocket/" "./github.com/gorilla/websocket/"
|
||||||
|
rm -rf ./github.com/gorilla/websocket/\.*
|
||||||
|
rm -rf ./github.com/gorilla/websocket/examples
|
||||||
|
rm "./github.com/gorilla/websocket/.gitignore"
|
||||||
|
rm "./github.com/gorilla/websocket/client_clone_legacy.go"
|
||||||
|
rm "./github.com/gorilla/websocket/compression.go"
|
||||||
|
rm "./github.com/gorilla/websocket/conn_write_legacy.go"
|
||||||
|
rm "./github.com/gorilla/websocket/json.go"
|
||||||
|
rm "./github.com/gorilla/websocket/prepared.go"
|
||||||
|
rm "./github.com/gorilla/websocket/proxy.go"
|
||||||
|
rm "./github.com/gorilla/websocket/trace_17.go"
|
||||||
|
rm "./github.com/gorilla/websocket/trace.go"
|
||||||
|
rm "./github.com/gorilla/websocket/x_net_proxy.go"
|
||||||
|
|
||||||
find . -name "*_test.go" -delete
|
find . -name "*_test.go" -delete
|
||||||
find . -type f -print0 | LC_ALL=C xargs -0 sed -i '' 's#github\.com#v2ray\.com/core/external/github\.com#g'
|
find . -name "*.yml" -delete
|
||||||
|
find . -name "*.go" -type f -print0 | LC_ALL=C xargs -0 sed -i '' 's#github\.com#v2ray\.com/core/external/github\.com#g'
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
Loading…
Reference in New Issue