mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-22 08:31:28 +00:00
parent
d51db9469e
commit
42284a757c
|
@ -5,7 +5,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ReadUint16 reads first two bytes from the reader, and then coverts them to an uint16 value.
|
// ReadUint16 reads first two bytes from the reader, and then converts them to an uint16 value.
|
||||||
func ReadUint16(reader io.Reader) (uint16, error) {
|
func ReadUint16(reader io.Reader) (uint16, error) {
|
||||||
var b [2]byte
|
var b [2]byte
|
||||||
if _, err := io.ReadFull(reader, b[:]); err != nil {
|
if _, err := io.ReadFull(reader, b[:]); err != nil {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ToString serialize an arbitrary value into string.
|
// ToString serializes an arbitrary value into string.
|
||||||
func ToString(v interface{}) string {
|
func ToString(v interface{}) string {
|
||||||
if v == nil {
|
if v == nil {
|
||||||
return ""
|
return ""
|
||||||
|
|
|
@ -86,7 +86,7 @@ type Sockopt struct {
|
||||||
Mark int32
|
Mark int32
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetAttribute attachs additional string attributes to content.
|
// SetAttribute attaches additional string attributes to content.
|
||||||
func (c *Content) SetAttribute(name string, value string) {
|
func (c *Content) SetAttribute(name string, value string) {
|
||||||
if c.Attributes == nil {
|
if c.Attributes == nil {
|
||||||
c.Attributes = make(map[string]string)
|
c.Attributes = make(map[string]string)
|
||||||
|
|
Loading…
Reference in a new issue