History log of /system/core/adb/adb_listeners.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
46b0b1c694bd873bd8130440d9ec1367dbe6da6e 08-Dec-2015 Erik Kline <ek@google.com> Merge "Switch from using sockaddr to sockaddr_storage."
7e16cc15b5e16ec35f4c9f0516a6cacf90326856 01-Dec-2015 Erik Kline <ek@google.com> Switch from using sockaddr to sockaddr_storage.

This is to ensure sufficient space is always available.

Change-Id: Ifa87b93ecdc90dcacbfb24446c872344da6703d3
/system/core/adb/adb_listeners.cpp
4f71319df011d796a60a43fc1bc68e16fbf7d321 05-Dec-2015 Elliott Hughes <enh@google.com> Track rename of base/ to android-base/.

Change-Id: Idf9444fece4aa89c93e15640de59a91f6e758ccf
/system/core/adb/adb_listeners.cpp
cc65c3b9f8edc6fb48ffe725376e65fac42851d6 21-Nov-2015 Elliott Hughes <enh@google.com> Fix "adb sync" (and "adb push") error reporting.

This patch ensures that we read any error response from the server if the
server closes the connection. Unfortunately, that's not sufficient to ensure
that we always see the server's error message --- sometimes the data just
gets thrown away because we keep writing without reading. Setting SO_LINGER
avoids this.

Bug: http://b/25230872
Change-Id: I96c019cc72bd139198de79bf29e6536cc462c20f
/system/core/adb/adb_listeners.cpp
b329824e6c5373ae303269dca285d835ce57e514 29-Aug-2015 Yabin Cui <yabinc@google.com> adb: clean up transport disconnect operations.

Move operations from global functions into member functions.
Add unit test.

Change-Id: Id4543d8e78541eb08c8e629f180c605c699737ec
/system/core/adb/adb_listeners.cpp
bf7c605d87f87c03066c384cecb0f0c91aa31403 12-Aug-2015 Spencer Low <CompareAndSwap@gmail.com> adb: improve network error info

- handle_forward_request
- Because we have detailed info about which syscall failed (at least
on Win32), use a more generic prefix of "cannot bind listener" followed
by the detailed info.

- install_listener
- Return string errors for a few errors even though I don't think any
callers actually output the string for those errors.

- Remove the printf since the callers print the message themselves.

- adb_main
- LOG(FATAL) calls abort() which on Windows calls the Windows Error
Reporting service which pops up a dialog asking if you want a
crashdump to be uploaded to Microsoft. So really, abort() is
designed for app bugs. Windows isn't the only one doing this, Chromium
also makes LOG(FATAL) crashdump-ready. Since an error here is not
necessarily an app-bug, use a 'normal' error output API like fatal()
which prints an error and just uses exit().

- sysdeps_win32.cpp
- When Winsock APIs fail, make the string clarify which API failed.
Use terse unix-style descriptions (like what you'd get from
cp/mv/dd/etc.).

- Don't trace WSAEWOULDBLOCK from recv() which is a normal occurrence.

- Add a comment about WSAEWOULDBLOCK => EAGAIN.

Change-Id: I58e47f49fa2f6c1b4b92a36d0c4bfe369b456f2a
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
/system/core/adb/adb_listeners.cpp
5200c6670f041550c23821fec8e8e49b30ef6d29 31-Jul-2015 Spencer Low <CompareAndSwap@gmail.com> adb: win32: initial IPv6 support and improved Winsock error reporting

Call getaddrinfo() for connecting to IPv6 destinations.

Winsock APIs do not set errno. WSAGetLastError() returns Winsock errors
that are more numerous than BSD sockets, so it really doesn't make sense
to map those to BSD socket errors. Plus, even if we did that, the
Windows C Runtime (that mingw binaries use) has a strerror() that does
not recognize BSD socket error codes.

The solution is to wrap the various libcutils socket_* APIs with
sysdeps.h network_* APIs. For POSIX, the network_* APIs just call
strerror(). For Windows, they call SystemErrorCodeToString() (adapted
from Chromium).

Also in this change:

- Various other code was modified to return errors in a std::string*
argument, to be able to surface the error string to the end-user.

- Improved error checking and use of D() to log Winsock errors for
improved debuggability.

- For sysdeps_win32.cpp, added unique_fh class that works like
std::unique_ptr, for calling _fh_close().

- Fix win32 adb_socketpair() setting of errno in error case.

- Improve _socket_set_errno() D() logging to reduce confusion. Map
a few extra error codes.

- Move adb_shutdown() lower in sysdeps_win32.cpp so it can call
_socket_set_errno().

- Move network_connect() from adb_utils.cpp to sysdeps.h.

- Merge socket_loopback_server() and socket_inaddr_any_server() into
_network_server() since most of the code was identical.

Change-Id: I945f36870f320578b3a11ba093852ba6f7b93400
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
/system/core/adb/adb_listeners.cpp
381cfa9a8bc262dcd823a8bb6adc189595a2fe7d 24-Jul-2015 Elliott Hughes <enh@google.com> Report getaddrinfo failures correctly.

Also move us off the "convenience" function because you can't get useful
error reporting from it.

Change-Id: I5fcc6a6d762f5f60906980a7835f01a35045be65
/system/core/adb/adb_listeners.cpp
34c20bbdfffe0475555d3028e6a441198c85cc62 22-Jul-2015 Elliott Hughes <enh@google.com> Show "(reverse)" in "adb reverse --list".

Bug: http://b/17788586
Change-Id: I250a1459295ed38e8d962da8bea2a8d2f83c7ef0
/system/core/adb/adb_listeners.cpp
095307ec4950f06539f460ad621e0e1d3b246e19 09-Jul-2015 Elliott Hughes <enh@google.com> Replace HAVE_WIN32_IPC with _WIN32.

Change-Id: Ie9dc064fb23a4e4bd4856c9668784dec0be9d2d6
/system/core/adb/adb_listeners.cpp
424af02f363a305a349ff99e1cc253ac5bc642c9 30-May-2015 Elliott Hughes <enh@google.com> Fix error handling/reporting for "adb forward" and "adb reverse".

We really need better infrastructure for parsing adb subcommands, but
in the meantime...

At least this cleans up a little more of the implementation too.

Bug: http://b/20736014
Change-Id: I76209847da3724906c71924017bcb69fa31e0b49
/system/core/adb/adb_listeners.cpp
3bd73c12c07dcefc965abeef535ac53c4754d682 05-May-2015 Elliott Hughes <enh@google.com> Give enum types CamelCase names for clarity.

Change-Id: I1c89f1cc155ee839f372fb14d972a288183b8bcd
/system/core/adb/adb_listeners.cpp
ab52c181fa4c1c9891644635dc5653cda5b90e2b 02-May-2015 Elliott Hughes <enh@google.com> Add WriteFdFmt and clean up more code.

Also say *which* device wasn't found.

Bug: http://b/20666660
Change-Id: I50e234ad89e39ae0a8995083c0b642c61275c5a3
/system/core/adb/adb_listeners.cpp
e67f1f87d9b1188ec8617035db7006c37ee7b21e 01-May-2015 Elliott Hughes <enh@google.com> More adb buffer fixes.

This patch factors out a lot of the basic protocol code: sending OKAY,
sending FAIL, and sending a length-prefixed string.

ADB_TRACE has been non-optional for a long time, so let's just remove
the #ifs.

Also actually build the device tracker test tool (and remove its duplicate).

Bug: http://b/20666660
Change-Id: I6c7d59f18707bdc62ca69dea45547617f9f31fc6
/system/core/adb/adb_listeners.cpp
7b506090e1ac51f4990f17621c6e33847b0632a2 20-Apr-2015 Elliott Hughes <enh@google.com> Always explain why bind(2) failed.

This has confused several people lately.

Bug: http://b/20219978
Change-Id: I2537ceb83bff0b3166c230c728d4389a983db858
/system/core/adb/adb_listeners.cpp
bac3474a8256cb32a29e8d46f78cad95a5502692 26-Feb-2015 Dan Albert <danalbert@google.com> Move adb to C++.

I keep trying to clean things up and needing std::strings. Might as
well just do this now.

usb_linux_client.c is going to stay as C because GCC isn't smart
enough to deal with the designated initializers it uses (though for
some reason it is in C mode).

The Darwin files are staying as C because I don't have a way to test
that they build.

The Windows files are staying as C because while I can actually build
for them, it's slow and painful.

Change-Id: I75367d29205a9049d34460032b3bb36384f43941
/system/core/adb/adb_listeners.cpp