Commit graph

7 commits

Author SHA1 Message Date
Josh Gao
e0361d1e90 adb: use delete on objects with destructors.
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
2018-02-12 17:31:39 -08:00
Josh Gao
27cb7dca77 adb: switch asocket::enqueue to std::string.
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
2018-02-06 12:59:06 -08:00
Josh Gao
5e5076404a adb: switch asocket's intrusive linked list to vectors.
Test: python test_device.py
Change-Id: I24d7f5d0401de77d80c7a2dd5a7dcb551943342d
2018-02-06 12:59:06 -08:00
Josh Gao
55c8b34f14 adb: reformat comments.
Test: none
Change-Id: Ib484f701f66cdb57f303dbd6d5eb2e5a15abdc0e
2017-09-13 14:05:21 -07:00
Dan Austin
b4cff495a1 Address const issues in preparation for libcxx rebase.
Change-Id: I4eccc1b5a70da9dd325e1a7e10ab0a3fe588c03f
2016-03-29 17:17:51 +00:00
David Pursell
3f902aad5b adb: relax serial matching rules.
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
2016-03-02 12:54:58 -08:00
Yabin Cui
c1b1f6ff5d Add unit tests for local socket.
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
2015-09-16 15:00:59 -07:00