/[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.5 by pseudo, Tue Oct 19 12:13:33 2010 UTC revision 1.6 by pseudo, Wed Oct 20 13:07:13 2010 UTC
# Line 504  int open_telnet_raw(int sock, sockname_t Line 504  int open_telnet_raw(int sock, sockname_t
504   *   >=0: connect successful, returned is the socket number   *   >=0: connect successful, returned is the socket number
505   *    -1: look at errno or use strerror()   *    -1: look at errno or use strerror()
506   *    -2: lookup failed or server is not a valid IP string   *    -2: lookup failed or server is not a valid IP string
507     *    -3: could not allocate socket
508   */   */
509  int open_telnet(char *server, int port)  int open_telnet(int idx, char *server, int port)
510  {  {
511    int ret, sock;    int ret;
   sockname_t name;  
512        
513    ret = setsockname(&name, server, port, 1);    ret = setsockname(&dcc[idx].sockname, server, port, 1);
514    if (ret == AF_UNSPEC)    if (ret == AF_UNSPEC)
515      return -2;      return -2;
516    sock = getsock(ret, 0);    dcc[idx].port = port;
517    if (sock < 0)    dcc[idx].sock = getsock(ret, 0);
518      return -1;    if (dcc[idx].sock < 0)
519    ret = open_telnet_raw(sock, &name);      return -3;
520      ret = open_telnet_raw(dcc[idx].sock, &dcc[idx].sockname);
521    if (ret < 0)    if (ret < 0)
522      killsock(sock);      killsock(dcc[idx].sock);
523    return ret;    return ret;
524  }  }
525    

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

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23