mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-05-01 01:44:15 +00:00
XHTTP client: Refactor "packet-up" mode, chasing "stream-up" (#4150)
* Add wroteRequest (waiting for new quic-go) * Use XTLS/quic-go instead * Client doesn't need `scMaxConcurrentPosts` anymore * GotConn is available in H3 * `scMaxConcurrentPosts` -> `scMaxBufferedPosts` (server only, 30 by default) Fixes https://github.com/XTLS/Xray-core/issues/4100
This commit is contained in:
parent
6be3c35db8
commit
8cd9a74376
10 changed files with 235 additions and 250 deletions
|
@ -141,14 +141,7 @@ func (c *DefaultDialerClient) OpenDownload(ctx context.Context, baseURL string)
|
|||
gotDownResponse.Close()
|
||||
}()
|
||||
|
||||
if !c.isH3 {
|
||||
// in quic-go, sometimes gotConn is never closed for the lifetime of
|
||||
// the entire connection, and the download locks up
|
||||
// https://github.com/quic-go/quic-go/issues/3342
|
||||
// for other HTTP versions, we want to block Dial until we know the
|
||||
// remote address of the server, for logging purposes
|
||||
<-gotConn.Wait()
|
||||
}
|
||||
<-gotConn.Wait()
|
||||
|
||||
lazyDownload := &LazyReader{
|
||||
CreateReader: func() (io.Reader, error) {
|
||||
|
@ -172,7 +165,7 @@ func (c *DefaultDialerClient) OpenDownload(ctx context.Context, baseURL string)
|
|||
}
|
||||
|
||||
func (c *DefaultDialerClient) SendUploadRequest(ctx context.Context, url string, payload io.ReadWriteCloser, contentLength int64) error {
|
||||
req, err := http.NewRequest("POST", url, payload)
|
||||
req, err := http.NewRequestWithContext(ctx, "POST", url, payload)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue