Use h2c from x/net to handle h2c requests
Co-authored-by: Mathieu Lonjaret <mathieu.lonjaret@gmail.com>
This commit is contained in:
parent
c7d336f958
commit
4360ca14c1
224 changed files with 22414 additions and 11768 deletions
17
vendor/golang.org/x/net/ipv4/batch.go
generated
vendored
17
vendor/golang.org/x/net/ipv4/batch.go
generated
vendored
|
@ -2,14 +2,11 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build go1.9
|
||||
|
||||
package ipv4
|
||||
|
||||
import (
|
||||
"net"
|
||||
"runtime"
|
||||
"syscall"
|
||||
|
||||
"golang.org/x/net/internal/socket"
|
||||
)
|
||||
|
@ -76,7 +73,7 @@ type Message = socket.Message
|
|||
// headers.
|
||||
func (c *payloadHandler) ReadBatch(ms []Message, flags int) (int, error) {
|
||||
if !c.ok() {
|
||||
return 0, syscall.EINVAL
|
||||
return 0, errInvalidConn
|
||||
}
|
||||
switch runtime.GOOS {
|
||||
case "linux":
|
||||
|
@ -92,6 +89,9 @@ func (c *payloadHandler) ReadBatch(ms []Message, flags int) (int, error) {
|
|||
n = 0
|
||||
err = &net.OpError{Op: "read", Net: c.PacketConn.LocalAddr().Network(), Source: c.PacketConn.LocalAddr(), Err: err}
|
||||
}
|
||||
if compatFreeBSD32 && ms[0].NN > 0 {
|
||||
adjustFreeBSD32(&ms[0])
|
||||
}
|
||||
return n, err
|
||||
}
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ func (c *payloadHandler) ReadBatch(ms []Message, flags int) (int, error) {
|
|||
// On other platforms, this method will write only a single message.
|
||||
func (c *payloadHandler) WriteBatch(ms []Message, flags int) (int, error) {
|
||||
if !c.ok() {
|
||||
return 0, syscall.EINVAL
|
||||
return 0, errInvalidConn
|
||||
}
|
||||
switch runtime.GOOS {
|
||||
case "linux":
|
||||
|
@ -139,7 +139,7 @@ func (c *payloadHandler) WriteBatch(ms []Message, flags int) (int, error) {
|
|||
// On other platforms, this method will read only a single message.
|
||||
func (c *packetHandler) ReadBatch(ms []Message, flags int) (int, error) {
|
||||
if !c.ok() {
|
||||
return 0, syscall.EINVAL
|
||||
return 0, errInvalidConn
|
||||
}
|
||||
switch runtime.GOOS {
|
||||
case "linux":
|
||||
|
@ -155,6 +155,9 @@ func (c *packetHandler) ReadBatch(ms []Message, flags int) (int, error) {
|
|||
n = 0
|
||||
err = &net.OpError{Op: "read", Net: c.IPConn.LocalAddr().Network(), Source: c.IPConn.LocalAddr(), Err: err}
|
||||
}
|
||||
if compatFreeBSD32 && ms[0].NN > 0 {
|
||||
adjustFreeBSD32(&ms[0])
|
||||
}
|
||||
return n, err
|
||||
}
|
||||
}
|
||||
|
@ -170,7 +173,7 @@ func (c *packetHandler) ReadBatch(ms []Message, flags int) (int, error) {
|
|||
// On other platforms, this method will write only a single message.
|
||||
func (c *packetHandler) WriteBatch(ms []Message, flags int) (int, error) {
|
||||
if !c.ok() {
|
||||
return 0, syscall.EINVAL
|
||||
return 0, errInvalidConn
|
||||
}
|
||||
switch runtime.GOOS {
|
||||
case "linux":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue