Update Csocket to e00323f9f18

This breaks API for Csock::SockError()!

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter
2012-01-14 11:33:38 +01:00
parent 02e42958f0
commit c87e7cf5ba
12 changed files with 975 additions and 870 deletions

View File

@@ -29,10 +29,11 @@ unsigned int CSockManager::GetAnonConnectionCount(const CString &sIP) const {
return ret;
}
CS_STRING CZNCSock::ConvertAddress(void *addr, bool ipv6) {
CString sRet = Csock::ConvertAddress(addr, ipv6);
sRet.TrimPrefix("::ffff:");
return sRet;
int CZNCSock::ConvertAddress(const struct sockaddr_storage * pAddr, socklen_t iAddrLen, CS_STRING & sIP, u_short * piPort) {
int ret = Csock::ConvertAddress(pAddr, iAddrLen, sIP, piPort);
if (ret == 0)
sIP.TrimPrefix("::ffff:");
return ret;
}
/////////////////// CSocket ///////////////////
@@ -74,8 +75,8 @@ void CSocket::ReachedMaxBuffer() {
Close();
}
void CSocket::SockError(int iErrno) {
DEBUG(GetSockName() << " == SockError(" << strerror(iErrno) << ")");
void CSocket::SockError(int iErrno, const CString& sDescription) {
DEBUG(GetSockName() << " == SockError(" << sDescription << ", " << strerror(iErrno) << ")");
if (iErrno == EMFILE) {
// We have too many open fds, this can cause a busy loop.
Close();