Loading adb/adb_io.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); } Loading adb/adb_io.h +3 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <sys/types.h> #include <string> #include <string_view> #include "adb_unique_fd.h" Loading @@ -27,10 +28,10 @@ bool SendOkay(int fd); // Sends the protocol "FAIL" message, with the given failure reason. bool SendFail(int fd, const std::string& reason); bool SendFail(int fd, std::string_view reason); // Writes a protocol-format string; a four hex digit length followed by the string data. bool SendProtocolString(int fd, const std::string& s); bool SendProtocolString(int fd, std::string_view s); // Reads a protocol-format string; a four hex digit length followed by the string data. bool ReadProtocolString(int fd, std::string* s, std::string* error); Loading Loading
adb/adb_io.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); } Loading
adb/adb_io.h +3 −2 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <sys/types.h> #include <string> #include <string_view> #include "adb_unique_fd.h" Loading @@ -27,10 +28,10 @@ bool SendOkay(int fd); // Sends the protocol "FAIL" message, with the given failure reason. bool SendFail(int fd, const std::string& reason); bool SendFail(int fd, std::string_view reason); // Writes a protocol-format string; a four hex digit length followed by the string data. bool SendProtocolString(int fd, const std::string& s); bool SendProtocolString(int fd, std::string_view s); // Reads a protocol-format string; a four hex digit length followed by the string data. bool ReadProtocolString(int fd, std::string* s, std::string* error); Loading