Skip to content

Commit 9556c72

Browse files
committed
Update event types and drop idea of global request
1 parent ee34970 commit 9556c72

File tree

3 files changed

+2
-15
lines changed

3 files changed

+2
-15
lines changed

pkg/cmd/codespace/ports.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ func (a *App) UpdatePortVisibility(ctx context.Context, codespaceName string, ar
273273
}
274274
defer safeClose(session, &err)
275275

276-
success := session.RegisterEvent("sharingSucceeded")
277-
failure := session.RegisterEvent("sharingFailed")
276+
success := session.RegisterEvent("serverSharing.sharingSucceeded")
277+
failure := session.RegisterEvent("serverSharing.sharingFailed")
278278

279279
// TODO: check if port visibility can be updated in parallel instead of sequentially
280280
for _, port := range ports {

pkg/liveshare/rpc.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ func (r *requestHandler) eventHandler(eventName string) chan []byte {
7373

7474
func (r *requestHandler) Handle(ctx context.Context, conn *jsonrpc2.Conn, req *jsonrpc2.Request) {
7575
fmt.Println(req.Method)
76-
if req.Params != nil {
77-
fmt.Println(string(*req.Params))
78-
}
7976
handler := r.eventHandler(req.Method)
8077
if handler == nil {
8178
return // noop

pkg/liveshare/ssh.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ func (s *sshSession) connect(ctx context.Context) error {
5050
return fmt.Errorf("error creating ssh client connection: %w", err)
5151
}
5252
s.conn = sshClientConn
53-
go s.handleGlobalRequests(reqs)
5453

5554
sshClient := ssh.NewClient(sshClientConn, chans, reqs)
5655
s.Session, err = sshClient.NewSession()
@@ -71,15 +70,6 @@ func (s *sshSession) connect(ctx context.Context) error {
7170
return nil
7271
}
7372

74-
func (s *sshSession) handleGlobalRequests(incoming <-chan *ssh.Request) {
75-
for r := range incoming {
76-
fmt.Println(r.Type)
77-
// This handles keepalive messages and matches
78-
// the behaviour of OpenSSH.
79-
r.Reply(false, nil)
80-
}
81-
}
82-
8373
func (s *sshSession) Read(p []byte) (n int, err error) {
8474
return s.reader.Read(p)
8575
}

0 commit comments

Comments
 (0)