diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:48:32 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:48:32 +0000 |
commit | 06e0d5c7f0f78c489090fe5f0c18a91e8cb41ae8 (patch) | |
tree | b05cf1bb463a9fd986768357c717709049f0caa6 /src/socket.cpp | |
parent | c4cb1f9477b1fbf8662bedb1c36f84ff6f87e1f3 (diff) |
Use a set to mark client SSL ports rather than going by textual IP/port pairs
This theoretically speeds up accepting connections. Visible changes are proper
IPv6 port text in 005 output and no possibility of incorrect SSL on addresses
that mismatch an incoming port (possible with IPv4 wildcard SSL and IPv6
plaintext on the same port, not that anyone would do such a thing). Bind ports
also now tell which SSL module they use in /stats p.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11629 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/socket.cpp')
-rw-r--r-- | src/socket.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/socket.cpp b/src/socket.cpp index 2eb8aeb7e..e32bda901 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -126,7 +126,7 @@ int irc::sockets::OpenTCPSocket(const char* addr, int socktype) // XXX: it would be VERY nice to genericize this so all listen stuff (server/client) could use the one function. -- w00t int InspIRCd::BindPorts(FailedPortList &failed_ports) { - char configToken[MAXBUF], Addr[MAXBUF], Type[MAXBUF]; + char configToken[MAXBUF], Addr[MAXBUF], Type[MAXBUF], Desc[MAXBUF]; int bound = 0; bool started_with_nothing = (ports.size() == 0); std::vector<std::pair<std::string, int> > old_ports; @@ -140,6 +140,7 @@ int InspIRCd::BindPorts(FailedPortList &failed_ports) Config->ConfValue("bind", "port", count, configToken, MAXBUF); Config->ConfValue("bind", "address", count, Addr, MAXBUF); Config->ConfValue("bind", "type", count, Type, MAXBUF); + Config->ConfValue("bind", "ssl", count, Desc, MAXBUF); if (strncmp(Addr, "::ffff:", 7) == 0) this->Logs->Log("SOCKET",DEFAULT, "Using 4in6 (::ffff:) isn't recommended. You should bind IPv4 addresses directly instead."); @@ -176,6 +177,7 @@ int InspIRCd::BindPorts(FailedPortList &failed_ports) if (ll->GetFd() > -1) { bound++; + ll->SetDescription(*Desc ? Desc : "plaintext"); ports.push_back(ll); } else |