/[cvs]/eggdrop1.8/src/net.c
ViewVC logotype

Diff of /eggdrop1.8/src/net.c

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.6 by pseudo, Wed Oct 20 13:07:13 2010 UTC revision 1.6.2.1 by pseudo, Mon Nov 8 10:02:30 2010 UTC
# Line 331  void setsock(int sock, int options) Line 331  void setsock(int sock, int options)
331    struct threaddata *td = threaddata();    struct threaddata *td = threaddata();
332    
333    if (i == -1) {    if (i == -1) {
334      putlog(LOG_MISC, "*", "Sockettable full.");      putlog(LOG_MISC, "*", _("Socket table full."));
335      return;      return;
336    }    }
337    if (((sock != STDOUT) || backgrd) && !(td->socklist[i].flags & SOCK_NONSOCK)) {    if (((sock != STDOUT) || backgrd) && !(td->socklist[i].flags & SOCK_NONSOCK)) {
# Line 357  int getsock(int af, int options) Line 357  int getsock(int af, int options)
357    if (sock >= 0)    if (sock >= 0)
358      setsock(sock, options);      setsock(sock, options);
359    else    else
360      putlog(LOG_MISC, "*", "Warning: Can't create new socket: %s!",      putlog(LOG_MISC, "*", _("Warning: Can't create new socket: %s!"),
361             strerror(errno));             strerror(errno));
362    return sock;    return sock;
363  }  }
# Line 399  void killsock(register int sock) Line 399  void killsock(register int sock)
399        return;        return;
400      }      }
401    }    }
402    putlog(LOG_MISC, "*", "Warning: Attempt to kill un-allocated socket %d!", sock);    putlog(LOG_MISC, "*", _("Warning: Attempt to kill un-allocated socket %d!"),
403             sock);
404  }  }
405    
406  /* Done with a tcl socket  /* Done with a tcl socket
# Line 434  static int proxy_connect(int sock, sockn Line 435  static int proxy_connect(int sock, sockn
435      return -2;      return -2;
436  #ifdef IPV6  #ifdef IPV6
437    if (addr->family == AF_INET6) {    if (addr->family == AF_INET6) {
438      putlog(LOG_MISC, "*", "Eggdrop doesn't support IPv6 connections "      putlog(LOG_MISC, "*", _("Eggdrop doesn't support IPv6 connections "
439             "through proxies yet.");             "through proxies yet."));
440      return -1;      return -1;
441    }    }
442  #endif  #endif
# Line 773  int sockread(char *s, int *len, sock_lis Line 774  int sockread(char *s, int *len, sock_lis
774            if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE)            if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE)
775              errno = EAGAIN;              errno = EAGAIN;
776                else                else
777                  debug1("SSL error: %s", ERR_error_string(ERR_get_error(), 0));                  debug1(_("SSL error: %s"), ERR_error_string(ERR_get_error(), 0));
778                x = -1;                x = -1;
779              }              }
780            } else            } else
# Line 1097  void tputs(register int z, char *s, unsi Line 1098  void tputs(register int z, char *s, unsi
1098              errno = EAGAIN;              errno = EAGAIN;
1099            else if (!inhere) { /* Out there, somewhere */            else if (!inhere) { /* Out there, somewhere */
1100              inhere = 1;              inhere = 1;
1101              debug1("SSL error: %s", ERR_error_string(ERR_get_error(), 0));              debug1(_("SSL error: %s"), ERR_error_string(ERR_get_error(), 0));
1102              inhere = 0;              inhere = 0;
1103            }            }
1104            x = -1;            x = -1;
# Line 1121  void tputs(register int z, char *s, unsi Line 1122  void tputs(register int z, char *s, unsi
1122    if (!inhere) {    if (!inhere) {
1123      inhere = 1;      inhere = 1;
1124    
1125      putlog(LOG_MISC, "*", "!!! writing to nonexistent socket: %d", z);      putlog(LOG_MISC, "*", _("!!! writing to nonexistent socket: %d"), z);
1126      s[strlen(s) - 1] = 0;      s[strlen(s) - 1] = 0;
1127      putlog(LOG_MISC, "*", "!-> '%s'", s);      putlog(LOG_MISC, "*", "!-> '%s'", s);
1128    
# Line 1180  void dequeue_sockets() Line 1181  void dequeue_sockets()
1181            if (err == SSL_ERROR_WANT_WRITE || err == SSL_ERROR_WANT_READ)            if (err == SSL_ERROR_WANT_WRITE || err == SSL_ERROR_WANT_READ)
1182              errno = EAGAIN;              errno = EAGAIN;
1183            else            else
1184              debug1("SSL error: %s", ERR_error_string(ERR_get_error(), 0));              debug1(_("SSL error: %s"), ERR_error_string(ERR_get_error(), 0));
1185            x = -1;            x = -1;
1186          }          }
1187        } else        } else
# Line 1303  int sanitycheck_dcc(char *nick, char *fr Line 1304  int sanitycheck_dcc(char *nick, char *fr
1304      return 1;      return 1;
1305    
1306    if (prt < 1) {    if (prt < 1) {
1307      putlog(LOG_MISC, "*", "ALERT: (%s!%s) specified an impossible port of %u!",      putlog(LOG_MISC, "*", _("ALERT: (%s!%s) specified an impossible port "
1308             nick, from, prt);             "of %u!"), nick, from, from, prt);
1309      return 0;      return 0;
1310    }    }
1311  #ifdef IPV6  #ifdef IPV6
1312    if (strchr(ipaddy, ':')) {    if (strchr(ipaddy, ':')) {
1313      if (inet_pton(AF_INET6, ipaddy, &name.addr.s6.sin6_addr) != 1) {      if (inet_pton(AF_INET6, ipaddy, &name.addr.s6.sin6_addr) != 1) {
1314        putlog(LOG_MISC, "*", "ALERT: (%s!%s) specified an invalid IPv6 "        putlog(LOG_MISC, "*", _("ALERT: (%s!%s) specified an invalid IPv6 "
1315               "address of %s!", nick, from, ipaddy);               "address of %s!"), nick, from, ipaddy);
1316        return 0;        return 0;
1317      }      }
1318      if (IN6_IS_ADDR_V4MAPPED(&name.addr.s6.sin6_addr))      if (IN6_IS_ADDR_V4MAPPED(&name.addr.s6.sin6_addr))
# Line 1320  int sanitycheck_dcc(char *nick, char *fr Line 1321  int sanitycheck_dcc(char *nick, char *fr
1321  #endif  #endif
1322    if (ip && inet_ntop(AF_INET, &ip, badaddress, sizeof badaddress) &&    if (ip && inet_ntop(AF_INET, &ip, badaddress, sizeof badaddress) &&
1323        (ip < (1 << 24))) {        (ip < (1 << 24))) {
1324      putlog(LOG_MISC, "*", "ALERT: (%s!%s) specified an impossible IP of %s!",      putlog(LOG_MISC, "*", _("ALERT: (%s!%s) specified an impossible IP of %s!"),
1325             nick, from, badaddress);             nick, from, badaddress);
1326      return 0;      return 0;
1327    }    }
# Line 1347  int hostsanitycheck_dcc(char *nick, char Line 1348  int hostsanitycheck_dcc(char *nick, char
1348     */     */
1349    strncpyz(hostn, extracthostname(from), sizeof hostn);    strncpyz(hostn, extracthostname(from), sizeof hostn);
1350    if (!egg_strcasecmp(hostn, dnsname)) {    if (!egg_strcasecmp(hostn, dnsname)) {
1351      putlog(LOG_DEBUG, "*", "DNS information for submitted IP checks out.");      putlog(LOG_DEBUG, "*", _("DNS information for submitted IP checks out."));
1352      return 1;      return 1;
1353    }    }
1354    if (!strcmp(badaddress, dnsname))    if (!strcmp(badaddress, dnsname))
1355      putlog(LOG_MISC, "*", "ALERT: (%s!%s) sent a DCC request with bogus IP "      putlog(LOG_MISC, "*", _("ALERT: (%s!%s) sent a DCC request with bogus IP "
1356             "information of %s port %s. %s does not resolve to %s!", nick, from,             "information of %s port %s. %s does not resolve to %s!"), nick, from,
1357             badaddress, prt, from, badaddress);             badaddress, prt, from, badaddress);
1358    else    else
1359      return 1;                   /* <- usually happens when we have      return 1;                   /* <- usually happens when we have

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.6.2.1

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23