clang-format core/test files
[ Merge of http://go/wvgerrit/88006 ] Certain test files have yet to be formatted since we introduced clang-formatting. Test: android unit/integration tests Bug: 134365840 Change-Id: I2d30ad367d76a9dfbf389614e1b31ed39fa17c72
This commit is contained in:
@@ -4,22 +4,22 @@
|
||||
|
||||
#include "http_socket.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <cstring>
|
||||
|
||||
#ifdef _WIN32
|
||||
# include "winsock2.h"
|
||||
# include "ws2tcpip.h"
|
||||
# define ERROR_ASYNC_COMPLETE WSAEWOULDBLOCK
|
||||
# include "winsock2.h"
|
||||
# include "ws2tcpip.h"
|
||||
# define ERROR_ASYNC_COMPLETE WSAEWOULDBLOCK
|
||||
#else
|
||||
# include <netdb.h>
|
||||
# include <netinet/in.h>
|
||||
# include <sys/socket.h>
|
||||
# include <unistd.h>
|
||||
# define ERROR_ASYNC_COMPLETE EINPROGRESS
|
||||
# include <netdb.h>
|
||||
# include <netinet/in.h>
|
||||
# include <sys/socket.h>
|
||||
# include <unistd.h>
|
||||
# define ERROR_ASYNC_COMPLETE EINPROGRESS
|
||||
#endif
|
||||
|
||||
#include <openssl/bio.h>
|
||||
@@ -60,16 +60,15 @@ SSL_CTX* InitSslContext() {
|
||||
return ctx;
|
||||
}
|
||||
|
||||
static int LogBoringSslError(
|
||||
const char* message, size_t length, void* /* user_data */) {
|
||||
static int LogBoringSslError(const char* message, size_t length,
|
||||
void* /* user_data */) {
|
||||
LOGE(" BoringSSL Error: %s", message);
|
||||
return length;
|
||||
}
|
||||
|
||||
bool IsRetryableSslError(int ssl_error) {
|
||||
return ssl_error != SSL_ERROR_ZERO_RETURN &&
|
||||
ssl_error != SSL_ERROR_SYSCALL &&
|
||||
ssl_error != SSL_ERROR_SSL;
|
||||
return ssl_error != SSL_ERROR_ZERO_RETURN && ssl_error != SSL_ERROR_SYSCALL &&
|
||||
ssl_error != SSL_ERROR_SSL;
|
||||
}
|
||||
|
||||
#if 0
|
||||
@@ -262,8 +261,8 @@ bool HttpSocket::Connect(int timeout_in_ms) {
|
||||
hints.ai_flags = AI_NUMERICSERV | AI_ADDRCONFIG;
|
||||
|
||||
struct addrinfo* addr_info = nullptr;
|
||||
int ret = getaddrinfo(domain_name_.c_str(), port_.c_str(), &hints,
|
||||
&addr_info);
|
||||
int ret =
|
||||
getaddrinfo(domain_name_.c_str(), port_.c_str(), &hints, &addr_info);
|
||||
if (ret != 0) {
|
||||
LOGE("getaddrinfo failed, errno = %d", ret);
|
||||
return false;
|
||||
@@ -308,7 +307,8 @@ bool HttpSocket::Connect(int timeout_in_ms) {
|
||||
} else {
|
||||
if (GetError() != ERROR_ASYNC_COMPLETE) {
|
||||
// failed right away.
|
||||
LOGE("cannot connect to %s, errno = %d", domain_name_.c_str(), GetError());
|
||||
LOGE("cannot connect to %s, errno = %d", domain_name_.c_str(),
|
||||
GetError());
|
||||
CloseSocket();
|
||||
return false;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user