Skip to content

Commit 8ebdad5

Browse files
authored
Merge pull request #29 from cheftako/master
Fix error on DIAL_RSP for http-connect.
2 parents a3b4aa9 + 4345241 commit 8ebdad5

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

pkg/agent/agentserver/server.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ func (c *ProxyClientConnection) send(pkt *agent.Packet) error {
4444
} else if pkt.Type == agent.PacketType_DATA {
4545
_, err := c.Http.Write(pkt.GetData().Data)
4646
return err
47+
} else if pkt.Type == agent.PacketType_DIAL_RSP {
48+
return nil
4749
} else {
4850
return fmt.Errorf("attempt to send via unrecognized connection type %v", pkt.Type)
4951
}

pkg/agent/agentserver/tunnel.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ func (t *Tunnel) ServeHTTP(w http.ResponseWriter, r *http.Request) {
7575
t.Server.PendingDial[random] = connection
7676
if t.Server.Backend == nil {
7777
http.Error(w, "currently no tunnels available", http.StatusInternalServerError)
78+
return
7879
}
7980
if err := t.Server.Backend.Send(dialRequest); err != nil {
8081
klog.Errorf("failed to tunnel dial request %v", err)

0 commit comments

Comments
 (0)