diff options
author | Josh Gao <jmgao@google.com> | 2018-07-30 18:49:03 -0700 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2018-07-31 15:36:55 -0700 |
commit | dd655ec95fb929a5d78ac8d9ac5c3e8a459b92d3 (patch) | |
tree | 6c6de31287b65b8945c8bb0a84f01046cfb0f873 /adb.h | |
parent | e6dc1f2a8fdcc8bb4e8170e71ab3fe55a2d93524 (diff) | |
download | adb-dd655ec95fb929a5d78ac8d9ac5c3e8a459b92d3.tar.gz |
adb: move list-forward, kill-forward back into handle_forward_request.
The daemon-side reverse functions depended on handle_forward_request:
move them back instead of duplicating the logic we had in
handle_host_request. Accomplish what we originally wanted to do in this
change by changing the transport argument of handle_forward_request to a
std::function that acquires a transport, either via
acquire_one_transport or immediately returning a value that we already
have.
As a side effect, fix a bug where we would emit spurious errors for host
service requests.
Bug: http://b/112009742
Test: echo "001chost:connect:127.0.0.1:5555" | nc localhost 5037
Test: python test_device.py
Test: python test_adb.py
Change-Id: Iccc555575df6dbd7de10382854c4ea2c6f4beeaa
Diffstat (limited to 'adb.h')
-rw-r--r-- | adb.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -158,7 +158,10 @@ asocket* create_jdwp_tracker_service_socket(); unique_fd create_jdwp_connection_fd(int jdwp_pid); #endif -int handle_forward_request(const char* service, atransport* transport, int reply_fd); +bool handle_forward_request(const char* service, atransport* transport, int reply_fd); +bool handle_forward_request(const char* service, + std::function<atransport*(std::string* error)> transport_acquirer, + int reply_fd); /* packet allocator */ apacket* get_apacket(void); |