Skip to content

Commit

Permalink
fix reverse close
Browse files Browse the repository at this point in the history
  • Loading branch information
codeskyblue committed Jan 12, 2019
1 parent 4aec3c6 commit a2ceff9
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions adb/tcpusb.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,19 @@ func (sess *Session) onOpen(pkt Packet) {
log.Infof("Calling #%s, remoteId: %d, localId: %d", name, remoteId, localId)

if strings.HasPrefix(name, "reverse:") {
failMessage := "reverse service not supported"
sess.writePacket(_OKAY, localId, remoteId, nil)
sess.writePacket(_WRTE, localId, remoteId, []byte("FAIL"+fmt.Sprintf(
"%04x%s", len(failMessage), failMessage,
)))
sess.writePacket(_CLSE, localId, remoteId, nil)
return
name = "xxxx" + name[4:]
// failMessage := "reverse service not supported"
// sess.writePacket(_OKAY, localId, remoteId, nil)
// sess.writePacket(_WRTE, localId, remoteId, []byte("FAIL"+fmt.Sprintf(
// "%04x%s", len(failMessage), failMessage,
// )))
// sess.writePacket(_CLSE, localId, remoteId, nil)
// return
}

// Session service
device := NewClient("").Device(AnyUsbDevice())
conn, err := device.OpenTransport()
// device := NewClient("").Device(AnyUsbDevice())
conn, err := sess.device.OpenTransport()
if err != nil {
sess.err = err
return
Expand Down

0 comments on commit a2ceff9

Please sign in to comment.