File tree Expand file tree Collapse file tree 2 files changed +1
-29
lines changed Expand file tree Collapse file tree 2 files changed +1
-29
lines changed Original file line number Diff line number Diff line change @@ -117,11 +117,7 @@ func (p *Conn) SetWriteDeadline(t time.Time) error {
117
117
}
118
118
119
119
func (p * Conn ) readHeader () error {
120
- hdr , err := Read (p .bufReader )
121
- if err != nil {
122
- return err
123
- }
124
- p .header = hdr
120
+ p .header , _ = Read (p .bufReader )
125
121
return nil
126
122
127
123
}
Original file line number Diff line number Diff line change @@ -26,18 +26,6 @@ func TestPassthrough(t *testing.T) {
26
26
}
27
27
defer conn .Close ()
28
28
29
- // Write out the header!
30
- header := & Header {
31
- Version : 2 ,
32
- Command : PROXY ,
33
- TransportProtocol : TCPv4 ,
34
- SourceAddress : net .ParseIP ("10.1.1.1" ),
35
- SourcePort : 1000 ,
36
- DestinationAddress : net .ParseIP ("20.2.2.2" ),
37
- DestinationPort : 2000 ,
38
- }
39
- header .WriteTo (conn )
40
-
41
29
conn .Write ([]byte ("ping" ))
42
30
recv := make ([]byte , 4 )
43
31
_ , err = conn .Read (recv )
@@ -89,18 +77,6 @@ func TestTimeout(t *testing.T) {
89
77
// Do not send data for a while
90
78
time .Sleep (clientWriteDelay )
91
79
92
- // Write out the header!
93
- header := & Header {
94
- Version : 1 ,
95
- //Command: PROXY, // not needed in v1
96
- TransportProtocol : TCPv4 ,
97
- SourceAddress : net .ParseIP ("127.0.0.1" ),
98
- SourcePort : 1000 ,
99
- DestinationAddress : net .ParseIP ("20.2.2.2" ),
100
- DestinationPort : 2000 ,
101
- }
102
- header .WriteTo (conn )
103
-
104
80
conn .Write ([]byte ("ping" ))
105
81
recv := make ([]byte , 4 )
106
82
_ , err = conn .Read (recv )
You can’t perform that action at this time.
0 commit comments