summaryrefslogtreecommitdiffstats
path: root/adb/socket.h
Commit message (Collapse)AuthorAgeFilesLines
* adb: convert more stuff to unique_fd.Josh Gao2019-01-231-1/+2
| | | | | | | Test: adb_test Test: adbd_test Test: test_device.py Change-Id: Ie75f0b811d2c75d508e6ecffb40579308f5789d0
* adb: switch connect_to_remote to string_view.Josh Gao2018-12-261-1/+1
| | | | | | | | Test: test_adb.py Test: test_device.py Test: $ANDROID_HOST_OUT/nativetest64/adb_test/adb_test Test: adb shell /data/nativetest64/adbd_test/adbd_test Change-Id: Icce121a4c62bf0fa636a35bcae31d057cdff8fd2
* adb: switch skip_host_serial to string_view.Josh Gao2018-12-261-1/+2
| | | | | | | | | | Rename it to something more appropriate, while we're at it. Test: test_adb.py Test: test_device.py Test: $ANDROID_HOST_OUT/nativetest64/adb_test/adb_test Test: adb shell /data/nativetest64/adbd_test/adbd_test Change-Id: I0f95d348eeacb45a810696d748c8340d2068f666
* adb: finish switching service creation to string_view.Josh Gao2018-12-211-1/+1
| | | | | | | | Test: test_adb.py Test: test_device.py Test: $ANDROID_HOST_OUT/nativetest64/adb_test/adb_test Test: adb shell /data/nativetest64/adbd_test/adbd_test Change-Id: If4ea92aee1c0264d946de72483f8d715d96fcfd8
* adb: add IOVector.Josh Gao2018-05-231-1/+1
| | | | | | | | | | | | | | | | | | | An IOVector is a collection of immutable reference counted blocks which can have its head detached at an arbitrary index. This is extremely useful for implementing packet-framed protocols like adb on top of a stream protocol like TCP: a stream reader can read blocks, append them to the end of the IOVector, and then pull packets off of the front. This also lends itself naturally towards scatter/gather I/O, which will enable us to read data from disk and send it across the wire with a theoretical minimum number of copies in USB, and one extra copy over TCP. Since this is basically a generalization of std::deque<Range>, delete Range and replace its uses with IOVector. Test: adb_test Test: wine adb_test.exe Change-Id: I06561ad0bb25a3a51b378b61d257b5b04b41d9c4
* adb: remove fdevent_install, fdevent_remove.Josh Gao2018-05-221-2/+2
| | | | | | | | | | | Remove fdevent_install and fdevent_remove in favor of using fdevent_create and fdevent_destroy, so that we can put RAII types (i.e. unique_fd) into fdevent without worrying about -Wexit-time-destructors or structs that are freed instead of deleted. Bug: http://b/79786774 Test: python test_device.py Change-Id: I8471cc00574ed492fe1b196944976cdaae8b7cff
* adb: fix `adb reverse` when adbd has multiple transports.Josh Gao2018-04-131-2/+1
| | | | | | | | | | | | Plumb the transport that we received the adb reverse request on through to reverse_service, instead of trying to get a unique transport on devices that have multiple active transports (e.g. a device with USB (even unplugged) connected via TCP). Bug: http://b/37066218 Bug: http://b/71898863 Test: `echo foo | nc -l 12345 & adb reverse tcp:12345 tcp:12345; adb shell nc localhost 12345` on a device connected via TCP Change-Id: Iae199ae787f2e344126bbcacca8544cfc9844a4c
* adb: switch apacket payload to a type that doesn't initialize its contents.Josh Gao2018-04-111-3/+2
| | | | | | | | | | Switch from using std::string as the type we use to hold our payload in apacket to a custom reimplementation that doesn't zero initialize. This improves bulk transfer throughput in the adb_benchmark microbenchmark on walleye by ~20%. Test: adb shell taskset f0 /data/benchmarktest64/adb_benchmark/adb_benchmark Change-Id: Ibad797701eb1460c9321b0400c5b167b89b2b4d0
* adb: fix build breakage.Josh Gao2018-02-121-1/+1
| | | | | Test: mma Change-Id: Id8e7ffd2212449bbac5b64b50e7b3aef7e97d649
* adb: use delete on objects with destructors.Josh Gao2018-02-121-12/+12
| | | | | | | | | asocket has a destructor now, so we have to delete it, or leak the data pointed to by its std::string. Bug: http://b/73257049 Test: manual testing with asan Change-Id: Ia88199292cc74e10032a9a16226d3afc61c3e0be
* adb: switch asocket::enqueue to std::string.Josh Gao2018-02-061-4/+8
| | | | | | | | | Switch asocket over to taking a std::string instead of apacket* for data. This allows us to remove asocket specific fields from apacket*. Test: python test_device.py with x86_64 emulator, walleye Test: adb_test on host Change-Id: I9d157ff331a75ba49a54fdd4194e3f6cdff722f4
* adb: switch asocket's intrusive linked list to vectors.Josh Gao2018-02-061-6/+0
| | | | | Test: python test_device.py Change-Id: I24d7f5d0401de77d80c7a2dd5a7dcb551943342d
* adb: reformat comments.Josh Gao2017-09-131-59/+58
| | | | | Test: none Change-Id: Ib484f701f66cdb57f303dbd6d5eb2e5a15abdc0e
* Address const issues in preparation for libcxx rebase.Dan Austin2016-03-291-1/+1
| | | | Change-Id: I4eccc1b5a70da9dd325e1a7e10ab0a3fe588c03f
* adb: relax serial matching rules.David Pursell2016-03-021-0/+9
| | | | | | | | | | | | | | | | | | Currently targeting a device by serial requires matching the serial number exactly. This CL relaxes the matching rules for local transports to ignore protocol prefixes and make the port optional: [tcp:|udp:]<hostname>[:port] The purpose of this is to allow a user to set ANDROID_SERIAL to something like "tcp:100.100.100.100" and have it work for both fastboot and adb (assuming the device comes up at 100.100.100.100 in both modes). This CL also adds some unit tests for the modified functions to make sure they work as expected. Bug: 27340240 Change-Id: I006e0c70c84331ab44d05d0a0f462d06592eb879
* Add unit tests for local socket.Yabin Cui2015-09-161-0/+117
Add has_write_error flag in asocket, so it will not wait on local_socket_closing_list to write pending packets in local_socket_close(). Although it doesn't fix any problem, it helps to make the code more stable. Add a missing put_apacket() in error handling. Add a check when adding local socket in local_socket_closing_list. Bug: 23314034 Change-Id: I75b07ba8ee59b7f277fba2fb919db63065b291be