fix ws curl error message + some Windows warnings
This commit is contained in:
parent
2fac4bd9ef
commit
93ad709dfd
@ -31,7 +31,7 @@ namespace ix
|
|||||||
|
|
||||||
int getAnyFreePort()
|
int getAnyFreePort()
|
||||||
{
|
{
|
||||||
int sockfd;
|
socket_t sockfd;
|
||||||
if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
|
if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
|
||||||
{
|
{
|
||||||
return getAnyFreePortRandom();
|
return getAnyFreePortRandom();
|
||||||
|
@ -45,7 +45,7 @@ namespace ix
|
|||||||
int poll(struct pollfd* fds, nfds_t nfds, int timeout)
|
int poll(struct pollfd* fds, nfds_t nfds, int timeout)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
int maxfd = 0;
|
socket_t maxfd = 0;
|
||||||
fd_set readfds, writefds, errorfds;
|
fd_set readfds, writefds, errorfds;
|
||||||
FD_ZERO(&readfds);
|
FD_ZERO(&readfds);
|
||||||
FD_ZERO(&writefds);
|
FD_ZERO(&writefds);
|
||||||
|
@ -34,6 +34,12 @@ typedef unsigned long int nfds_t;
|
|||||||
|
|
||||||
namespace ix
|
namespace ix
|
||||||
{
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
typedef SOCKET socket_t;
|
||||||
|
#else
|
||||||
|
typedef int socket_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
bool initNetSystem();
|
bool initNetSystem();
|
||||||
bool uninitNetSystem();
|
bool uninitNetSystem();
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ namespace ix
|
|||||||
{
|
{
|
||||||
errMsg = "no error";
|
errMsg = "no error";
|
||||||
|
|
||||||
int fd = socket(address->ai_family, address->ai_socktype, address->ai_protocol);
|
socket_t fd = socket(address->ai_family, address->ai_socktype, address->ai_protocol);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
{
|
{
|
||||||
errMsg = "Cannot create a socket";
|
errMsg = "Cannot create a socket";
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include "IXConnectionState.h"
|
#include "IXConnectionState.h"
|
||||||
#include "IXSelectInterrupt.h"
|
#include "IXSelectInterrupt.h"
|
||||||
#include "IXSocketTLSOptions.h"
|
#include "IXSocketTLSOptions.h"
|
||||||
|
#include "IXNetSystem.h"
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@ -75,7 +76,7 @@ namespace ix
|
|||||||
int _addressFamily;
|
int _addressFamily;
|
||||||
|
|
||||||
// socket for accepting connections
|
// socket for accepting connections
|
||||||
int _serverFd;
|
socket_t _serverFd;
|
||||||
|
|
||||||
std::atomic<bool> _stop;
|
std::atomic<bool> _stop;
|
||||||
|
|
||||||
|
@ -1620,7 +1620,7 @@ namespace ix
|
|||||||
spdlog::info("Status: {}", response->statusCode);
|
spdlog::info("Status: {}", response->statusCode);
|
||||||
if (response->errorCode != HttpErrorCode::Ok)
|
if (response->errorCode != HttpErrorCode::Ok)
|
||||||
{
|
{
|
||||||
spdlog::info("error message: ", response->errorMsg);
|
spdlog::error("error message: {}", response->errorMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!headersOnly && response->errorCode == HttpErrorCode::Ok)
|
if (!headersOnly && response->errorCode == HttpErrorCode::Ok)
|
||||||
|
Loading…
Reference in New Issue
Block a user