@@ -10,6 +10,7 @@ import (
10
10
testutil "github.com/ipfs/go-ipfs/p2p/test/util"
11
11
eventlog "github.com/ipfs/go-ipfs/thirdparty/eventlog"
12
12
13
+ msmux "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/whyrusleeping/go-multistream"
13
14
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
14
15
)
15
16
@@ -62,7 +63,7 @@ func TestRelaySimple(t *testing.T) {
62
63
63
64
// ok now the header's there, we can write the next protocol header.
64
65
log .Debug ("write testing header" )
65
- if err := protocol . WriteHeader ( s , protocol .TestingID ); err != nil {
66
+ if err := msmux . SelectProtoOrFail ( string ( protocol .TestingID ), s ); err != nil {
66
67
t .Fatal (err )
67
68
}
68
69
@@ -155,15 +156,15 @@ func TestRelayAcrossFour(t *testing.T) {
155
156
}
156
157
157
158
log .Debugf ("write relay header n1->n4 (%s -> %s)" , n1p , n4p )
158
- if err := protocol . WriteHeader ( s , relay .ID ); err != nil {
159
+ if err := msmux . SelectProtoOrFail ( string ( relay .ID ), s ); err != nil {
159
160
t .Fatal (err )
160
161
}
161
162
if err := relay .WriteHeader (s , n1p , n4p ); err != nil {
162
163
t .Fatal (err )
163
164
}
164
165
165
166
log .Debugf ("write relay header n1->n5 (%s -> %s)" , n1p , n5p )
166
- if err := protocol . WriteHeader ( s , relay .ID ); err != nil {
167
+ if err := msmux . SelectProtoOrFail ( string ( relay .ID ), s ); err != nil {
167
168
t .Fatal (err )
168
169
}
169
170
if err := relay .WriteHeader (s , n1p , n5p ); err != nil {
@@ -172,7 +173,7 @@ func TestRelayAcrossFour(t *testing.T) {
172
173
173
174
// ok now the header's there, we can write the next protocol header.
174
175
log .Debug ("write testing header" )
175
- if err := protocol . WriteHeader ( s , protocol .TestingID ); err != nil {
176
+ if err := msmux . SelectProtoOrFail ( string ( protocol .TestingID ), s ); err != nil {
176
177
t .Fatal (err )
177
178
}
178
179
@@ -257,7 +258,7 @@ func TestRelayStress(t *testing.T) {
257
258
258
259
// ok now the header's there, we can write the next protocol header.
259
260
log .Debug ("write testing header" )
260
- if err := protocol . WriteHeader ( s , protocol .TestingID ); err != nil {
261
+ if err := msmux . SelectProtoOrFail ( string ( protocol .TestingID ), s ); err != nil {
261
262
t .Fatal (err )
262
263
}
263
264
0 commit comments