Commit 5c4d7c66 authored by Sergei Golubchik's avatar Sergei Golubchik

portability fix: use SOCKET_SIZE_TYPE in the handlersocket plugin

parent 14c767ca
...@@ -63,7 +63,7 @@ struct hstcpsvr_conn : public dbcallback_i { ...@@ -63,7 +63,7 @@ struct hstcpsvr_conn : public dbcallback_i {
public: public:
auto_file fd; auto_file fd;
sockaddr_storage addr; sockaddr_storage addr;
socklen_t addr_len; size_socket addr_len;
dbconnstate cstate; dbconnstate cstate;
std::string err; std::string err;
size_t readsize; size_t readsize;
......
...@@ -9,12 +9,15 @@ ...@@ -9,12 +9,15 @@
#ifndef DENA_AUTO_ADDRINFO_HPP #ifndef DENA_AUTO_ADDRINFO_HPP
#define DENA_AUTO_ADDRINFO_HPP #define DENA_AUTO_ADDRINFO_HPP
#include <my_config.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <netdb.h> #include <netdb.h>
#include "util.hpp" #include "util.hpp"
typedef SOCKET_SIZE_TYPE size_socket;
namespace dena { namespace dena {
struct auto_addrinfo : private noncopyable { struct auto_addrinfo : private noncopyable {
......
...@@ -172,7 +172,7 @@ socket_bind(auto_file& fd, const socket_args& args, std::string& err_r) ...@@ -172,7 +172,7 @@ socket_bind(auto_file& fd, const socket_args& args, std::string& err_r)
int int
socket_accept(int listen_fd, auto_file& fd, const socket_args& args, socket_accept(int listen_fd, auto_file& fd, const socket_args& args,
sockaddr_storage& addr_r, socklen_t& addrlen_r, std::string& err_r) sockaddr_storage& addr_r, size_socket& addrlen_r, std::string& err_r)
{ {
fd.reset(accept(listen_fd, reinterpret_cast<sockaddr *>(&addr_r), fd.reset(accept(listen_fd, reinterpret_cast<sockaddr *>(&addr_r),
&addrlen_r)); &addrlen_r));
......
...@@ -19,7 +19,7 @@ namespace dena { ...@@ -19,7 +19,7 @@ namespace dena {
struct socket_args { struct socket_args {
sockaddr_storage addr; sockaddr_storage addr;
socklen_t addrlen; size_socket addrlen;
int family; int family;
int socktype; int socktype;
int protocol; int protocol;
...@@ -43,7 +43,7 @@ void ignore_sigpipe(); ...@@ -43,7 +43,7 @@ void ignore_sigpipe();
int socket_bind(auto_file& fd, const socket_args& args, std::string& err_r); int socket_bind(auto_file& fd, const socket_args& args, std::string& err_r);
int socket_connect(auto_file& fd, const socket_args& args, std::string& err_r); int socket_connect(auto_file& fd, const socket_args& args, std::string& err_r);
int socket_accept(int listen_fd, auto_file& fd, const socket_args& args, int socket_accept(int listen_fd, auto_file& fd, const socket_args& args,
sockaddr_storage& addr_r, socklen_t& addrlen_r, std::string& err_r); sockaddr_storage& addr_r, size_socket& addrlen_r, std::string& err_r);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment