1
0
Fork 0

Use h2c from x/net to handle h2c requests

Co-authored-by: Mathieu Lonjaret <mathieu.lonjaret@gmail.com>
This commit is contained in:
Julien Salleyron 2019-07-01 15:08:04 +02:00 committed by Traefiker Bot
parent c7d336f958
commit 4360ca14c1
224 changed files with 22414 additions and 11768 deletions

View file

@ -4,17 +4,15 @@
package ipv6
import "syscall"
// TrafficClass returns the traffic class field value for outgoing
// packets.
func (c *genericOpt) TrafficClass() (int, error) {
if !c.ok() {
return 0, syscall.EINVAL
return 0, errInvalidConn
}
so, ok := sockOpts[ssoTrafficClass]
if !ok {
return 0, errOpNoSupport
return 0, errNotImplemented
}
return so.GetInt(c.Conn)
}
@ -23,11 +21,11 @@ func (c *genericOpt) TrafficClass() (int, error) {
// outgoing packets.
func (c *genericOpt) SetTrafficClass(tclass int) error {
if !c.ok() {
return syscall.EINVAL
return errInvalidConn
}
so, ok := sockOpts[ssoTrafficClass]
if !ok {
return errOpNoSupport
return errNotImplemented
}
return so.SetInt(c.Conn, tclass)
}
@ -35,11 +33,11 @@ func (c *genericOpt) SetTrafficClass(tclass int) error {
// HopLimit returns the hop limit field value for outgoing packets.
func (c *genericOpt) HopLimit() (int, error) {
if !c.ok() {
return 0, syscall.EINVAL
return 0, errInvalidConn
}
so, ok := sockOpts[ssoHopLimit]
if !ok {
return 0, errOpNoSupport
return 0, errNotImplemented
}
return so.GetInt(c.Conn)
}
@ -48,11 +46,11 @@ func (c *genericOpt) HopLimit() (int, error) {
// packets.
func (c *genericOpt) SetHopLimit(hoplim int) error {
if !c.ok() {
return syscall.EINVAL
return errInvalidConn
}
so, ok := sockOpts[ssoHopLimit]
if !ok {
return errOpNoSupport
return errNotImplemented
}
return so.SetInt(c.Conn, hoplim)
}