event/SocketMonitor: use class SocketDescriptor

This commit is contained in:
Max Kellermann
2017-08-10 18:25:22 +02:00
parent fcfc8bacc0
commit 492b20a89d
21 changed files with 80 additions and 83 deletions

View File

@@ -185,7 +185,8 @@ HttpdClient::SendResponse()
return true;
}
HttpdClient::HttpdClient(HttpdOutput &_httpd, int _fd, EventLoop &_loop,
HttpdClient::HttpdClient(HttpdOutput &_httpd, SocketDescriptor _fd,
EventLoop &_loop,
bool _metadata_supported)
:BufferedSocket(_fd, _loop),
httpd(_httpd),

View File

@@ -131,7 +131,7 @@ public:
* @param httpd the HTTP output device
* @param _fd the socket file descriptor
*/
HttpdClient(HttpdOutput &httpd, int _fd, EventLoop &_loop,
HttpdClient(HttpdOutput &httpd, SocketDescriptor _fd, EventLoop &_loop,
bool _metadata_supported);
/**

View File

@@ -206,7 +206,7 @@ public:
return HasClients();
}
void AddClient(int fd);
void AddClient(SocketDescriptor fd);
/**
* Removes a client from the httpd_output.clients linked list.

View File

@@ -118,7 +118,7 @@ HttpdOutput::Unbind()
* HttpdOutput.clients linked list.
*/
inline void
HttpdOutput::AddClient(int fd)
HttpdOutput::AddClient(SocketDescriptor fd)
{
auto *client = new HttpdClient(*this, fd, GetEventLoop(),
!encoder->ImplementsTag());
@@ -184,7 +184,7 @@ HttpdOutput::OnAccept(int fd, SocketAddress address, gcc_unused int uid)
/* can we allow additional client */
if (open && (clients_max == 0 || clients.size() < clients_max))
AddClient(fd);
AddClient(SocketDescriptor(fd));
else
close_socket(fd);
}