/[svn]/ircd-hybrid-7.2/src/listener.c
ViewVC logotype

Diff of /ircd-hybrid-7.2/src/listener.c

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

revision 1000 by michael, Sun Nov 4 13:49:52 2007 UTC revision 1001 by michael, Sat Aug 29 22:44:44 2009 UTC
# Line 169  inetport(struct Listener *listener) Line 169  inetport(struct Listener *listener)
169     */     */
170    if (setsockopt(listener->fd.fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)))    if (setsockopt(listener->fd.fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)))
171    {    {
 #ifdef _WIN32  
     errno = WSAGetLastError();  
 #endif  
172      report_error(L_ALL, "setting SO_REUSEADDR for listener %s:%s",      report_error(L_ALL, "setting SO_REUSEADDR for listener %s:%s",
173                   get_listener_name(listener), errno);                   get_listener_name(listener), errno);
174      fd_close(&listener->fd);      fd_close(&listener->fd);
# Line 186  inetport(struct Listener *listener) Line 183  inetport(struct Listener *listener)
183    
184    if (bind(listener->fd.fd, (struct sockaddr *)&lsin, lsin.ss_len))    if (bind(listener->fd.fd, (struct sockaddr *)&lsin, lsin.ss_len))
185    {    {
 #ifdef _WIN32  
     errno = WSAGetLastError();  
 #endif  
186      report_error(L_ALL, "binding listener socket %s:%s",      report_error(L_ALL, "binding listener socket %s:%s",
187                   get_listener_name(listener), errno);                   get_listener_name(listener), errno);
188      fd_close(&listener->fd);      fd_close(&listener->fd);
# Line 197  inetport(struct Listener *listener) Line 191  inetport(struct Listener *listener)
191    
192    if (listen(listener->fd.fd, HYBRID_SOMAXCONN))    if (listen(listener->fd.fd, HYBRID_SOMAXCONN))
193    {    {
 #ifdef _WIN32  
     errno = WSAGetLastError();  
 #endif  
194      report_error(L_ALL, "listen failed for %s:%s",      report_error(L_ALL, "listen failed for %s:%s",
195                   get_listener_name(listener), errno);                   get_listener_name(listener), errno);
196      fd_close(&listener->fd);      fd_close(&listener->fd);
# Line 421  accept_connection(fde_t *pfd, void *data Line 412  accept_connection(fde_t *pfd, void *data
412    
413        if (!(listener->flags & LISTENER_SSL))        if (!(listener->flags & LISTENER_SSL))
414          send(fd, "ERROR :All connections in use\r\n", 32, 0);          send(fd, "ERROR :All connections in use\r\n", 32, 0);
415  #ifdef _WIN32  
       closesocket(fd);  
 #else  
416        close(fd);        close(fd);
 #endif  
417        break;    /* jump out and re-register a new io request */        break;    /* jump out and re-register a new io request */
418      }      }
419    
# Line 448  accept_connection(fde_t *pfd, void *data Line 436  accept_connection(fde_t *pfd, void *data
436              break;              break;
437          }          }
438    
 #ifdef _WIN32  
       closesocket(fd);  
 #else  
439        close(fd);        close(fd);
 #endif  
440        continue;    /* drop the one and keep on clearing the queue */        continue;    /* drop the one and keep on clearing the queue */
441      }      }
442    

Legend:
Removed from v.1000  
changed lines
  Added in v.1001

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28