diff options
author | Josh Gao <jmgao@google.com> | 2019-02-26 20:55:19 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-02-26 20:55:19 +0000 |
commit | 216d158daf88edfd954dc03c65b339698319f63d (patch) | |
tree | f925f4c4dec9a8e1c25943920c0ad882dd8e5b47 /adb/adb_io.cpp | |
parent | 1706eb08fe8a7600d4698566b3d779b97bd1e279 (diff) | |
parent | 43f3805950d69f9da87664ada214d5af0e02753f (diff) |
Merge changes I86c3ec0f,I57d1a30a,Ib50d289b,I791a4f82,I316a8799, ...
* changes:
adb: switch sockets.cpp to ConsumePrefix.
adbd: switch abb to ConsumePrefix.
adb: increment server version.
adb: wait for device to disconnect upon `adb root`.
adb: implement wait-for-disconnect.
adb: tell the client what transport it received.
adbd: switch daemon/services to ConsumePrefix.
adb: switch host_service_to_socket to string_view.
adb: switch handle_host_request to string_view.
adb: switch adb_io.h to string_view.
adb: add helper to consume a prefix on a string_view.
adb: make ParseUint reject garbage at the end by default.
Diffstat (limited to 'adb/adb_io.cpp')
-rw-r--r-- | adb/adb_io.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/adb/adb_io.cpp b/adb/adb_io.cpp index 91b0d1f629..f5cdcb558d 100644 --- a/adb/adb_io.cpp +++ b/adb/adb_io.cpp @@ -34,7 +34,7 @@ #include "adb_utils.h" #include "sysdeps.h" -bool SendProtocolString(int fd, const std::string& s) { +bool SendProtocolString(int fd, std::string_view s) { unsigned int length = s.size(); if (length > MAX_PAYLOAD - 4) { errno = EMSGSIZE; @@ -69,7 +69,7 @@ bool SendOkay(int fd) { return WriteFdExactly(fd, "OKAY", 4); } -bool SendFail(int fd, const std::string& reason) { +bool SendFail(int fd, std::string_view reason) { return WriteFdExactly(fd, "FAIL", 4) && SendProtocolString(fd, reason); } |