LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2011 The Go Authors. All rights reserved. | 1 // Copyright 2011 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package ssh | 5 package ssh |
6 | 6 |
7 // Session tests. | 7 // Session tests. |
8 | 8 |
9 import ( | 9 import ( |
10 "bytes" | 10 "bytes" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 if ch.ChannelType() != "session" { | 55 if ch.ChannelType() != "session" { |
56 ch.Reject(UnknownChannelType, "unknown channel t
ype") | 56 ch.Reject(UnknownChannelType, "unknown channel t
ype") |
57 continue | 57 continue |
58 } | 58 } |
59 ch.Accept() | 59 ch.Accept() |
60 go func() { | 60 go func() { |
61 defer close(done) | 61 defer close(done) |
62 handler(ch.(*serverChan), t) | 62 handler(ch.(*serverChan), t) |
63 }() | 63 }() |
64 } | 64 } |
65 <-done | |
66 }() | 65 }() |
67 | 66 |
68 config := &ClientConfig{ | 67 config := &ClientConfig{ |
69 User: "testuser", | 68 User: "testuser", |
70 Auth: []ClientAuth{ | 69 Auth: []ClientAuth{ |
71 ClientAuthPassword(clientPassword), | 70 ClientAuthPassword(clientPassword), |
72 }, | 71 }, |
73 } | 72 } |
74 | 73 |
75 c, err := Dial("tcp", l.Addr().String(), config) | 74 c, err := Dial("tcp", l.Addr().String(), config) |
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 msg := channelRequestMsg{ | 779 msg := channelRequestMsg{ |
781 PeersId: ch.remoteId, | 780 PeersId: ch.remoteId, |
782 Request: "keepalive@openssh.com", | 781 Request: "keepalive@openssh.com", |
783 WantReply: true, | 782 WantReply: true, |
784 } | 783 } |
785 if err := ch.writePacket(marshal(msgChannelRequest, msg)); err != nil { | 784 if err := ch.writePacket(marshal(msgChannelRequest, msg)); err != nil { |
786 t.Errorf("unable to send channel keepalive request: %v", err) | 785 t.Errorf("unable to send channel keepalive request: %v", err) |
787 } | 786 } |
788 sendStatus(0, ch, t) | 787 sendStatus(0, ch, t) |
789 } | 788 } |
LEFT | RIGHT |