ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.2.x/src/s_bsd.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/s_bsd.c (file contents):
Revision 2631 by michael, Sat Aug 17 20:38:00 2013 UTC vs.
Revision 2632 by michael, Sun Dec 8 18:33:48 2013 UTC

# Line 52 | Line 52 | static const char *comm_err_str[] = { "C
52    "Error during DNS lookup", "connect timeout", "Error during connect()",
53    "Comm Error" };
54  
55 struct Callback *setup_socket_cb = NULL;
56
55   static void comm_connect_callback(fde_t *, int);
56   static PF comm_connect_timeout;
57   static void comm_connect_dns_callback(void *, const struct irc_ssaddr *, const char *);
# Line 139 | Line 137 | report_error(int level, const char* text
137   *
138   * Set the socket non-blocking, and other wonderful bits.
139   */
140 < static void *
141 < setup_socket(va_list args)
140 > static void
141 > setup_socket(int fd)
142   {
145  int fd = va_arg(args, int);
143    int opt = 1;
144  
145    setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
# Line 153 | Line 150 | setup_socket(va_list args)
150   #endif
151  
152    fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK);
156
157  return NULL;
158 }
159
160 /*
161 * init_comm()
162 *
163 * Initializes comm subsystem.
164 */
165 void
166 init_comm(void)
167 {
168  setup_socket_cb = register_callback("setup_socket", setup_socket);
169  init_netio();
153   }
154  
155   /*
# Line 712 | Line 695 | comm_open(fde_t *F, int family, int sock
695    if (fd < 0)
696      return -1; /* errno will be passed through, yay.. */
697  
698 <  execute_callback(setup_socket_cb, fd);
698 >  setup_socket(fd);
699  
700    /* update things in our fd tracking */
701    fd_open(F, fd, 1, note);
# Line 753 | Line 736 | comm_accept(struct Listener *lptr, struc
736    pn->ss_len = addrlen;
737   #endif
738  
739 <  execute_callback(setup_socket_cb, newfd);
739 >  setup_socket(newfd);
740  
741    /* .. and return */
742    return newfd;

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)