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

Comparing:
ircd-hybrid/src/s_bsd.c (file contents), Revision 31 by knight, Sun Oct 2 20:34:05 2005 UTC vs.
ircd-hybrid-7.2/src/s_bsd.c (file contents), Revision 549 by michael, Thu Apr 20 12:46:18 2006 UTC

# Line 258 | Line 258 | close_connection(struct Client *client_p
258  
259   #ifdef HAVE_LIBCRYPTO
260    if (client_p->localClient->fd.ssl)
261 <    SSL_shutdown(client_p->localClient->fd.ssl);
261 >  {
262 >    SSL_set_shutdown(client_p->localClient->fd.ssl, SSL_RECEIVED_SHUTDOWN);
263 >
264 >    if (!SSL_shutdown(client_p->localClient->fd.ssl))
265 >      SSL_shutdown(client_p->localClient->fd.ssl);
266 >  }
267   #endif
268    if (client_p->localClient->fd.flags.open)
269      fd_close(&client_p->localClient->fd);
# Line 317 | Line 322 | ssl_handshake(int fd, struct Client *cli
322   * any client list yet.
323   */
324   void
325 < add_connection(struct Listener* listener, int fd)
325 > add_connection(struct Listener *listener, struct irc_ssaddr *irn, int fd)
326   {
327    struct Client *new_client;
323  socklen_t len = sizeof(struct irc_ssaddr);
324  struct irc_ssaddr irn;
325  assert(NULL != listener);
328  
329 <  /*
328 <   * get the client socket name from the socket
329 <   * the client has already been checked out in accept_connection
330 <   */
331 <
332 <  memset(&irn, 0, sizeof(irn));
333 <  if (getpeername(fd, (struct sockaddr *)&irn, (socklen_t *)&len))
334 <  {
335 < #ifdef _WIN32
336 <    errno = WSAGetLastError();
337 < #endif
338 <    report_error(L_ALL, "Failed in adding new connection %s :%s",
339 <            get_listener_name(listener), errno);
340 <    ServerStats->is_ref++;
341 < #ifdef _WIN32
342 <    closesocket(fd);
343 < #else
344 <    close(fd);
345 < #endif
346 <    return;
347 <  }
329 >  assert(NULL != listener);
330  
349 #ifdef IPV6
350  remove_ipv6_mapping(&irn);
351 #else
352  irn.ss_len = len;
353 #endif
331    new_client = make_client(NULL);
332 +
333    fd_open(&new_client->localClient->fd, fd, 1,
334            (listener->flags & LISTENER_SSL) ?
335            "Incoming SSL connection" : "Incoming connection");
358  memset(&new_client->localClient->ip, 0, sizeof(struct irc_ssaddr));
336  
337    /*
338     * copy address to 'sockhost' as a string, copy it to host too
339     * so we have something valid to put into error messages...
340     */
341 <  new_client->localClient->port = ntohs(irn.ss_port);
365 <  memcpy(&new_client->localClient->ip, &irn, sizeof(struct irc_ssaddr));
341 >  memcpy(&new_client->localClient->ip, irn, sizeof(struct irc_ssaddr));
342  
343    irc_getnameinfo((struct sockaddr*)&new_client->localClient->ip,
344          new_client->localClient->ip.ss_len,  new_client->sockhost,
345          HOSTIPLEN, NULL, 0, NI_NUMERICHOST);
346    new_client->localClient->aftype = new_client->localClient->ip.ss.ss_family;
371
372  *new_client->host = '\0';
347   #ifdef IPV6
348 <  if (*new_client->sockhost == ':')
348 >  if (new_client->sockhost[0] == ':')
349      strlcat(new_client->host, "0", HOSTLEN+1);
350  
351    if (new_client->localClient->aftype == AF_INET6 &&
# Line 379 | Line 353 | add_connection(struct Listener* listener
353    {
354      strlcat(new_client->host, new_client->sockhost,HOSTLEN+1);
355      strlcat(new_client->host, ".", HOSTLEN+1);
356 <  } else
356 >  }
357 >  else
358   #endif
359      strlcat(new_client->host, new_client->sockhost,HOSTLEN+1);
360  
361 +  new_client->connect_id = ++connect_id;
362    new_client->localClient->listener = listener;
363    ++listener->ref_count;
364  
389  connect_id++;
390  new_client->connect_id = connect_id;
391
365   #ifdef HAVE_LIBCRYPTO
366 <  if ((listener->flags & LISTENER_SSL))
366 >  if (listener->flags & LISTENER_SSL)
367    {
368      if ((new_client->localClient->fd.ssl = SSL_new(ServerInfo.ctx)) == NULL)
369      {

Comparing:
ircd-hybrid/src/s_bsd.c (property svn:keywords), Revision 31 by knight, Sun Oct 2 20:34:05 2005 UTC vs.
ircd-hybrid-7.2/src/s_bsd.c (property svn:keywords), Revision 549 by michael, Thu Apr 20 12:46:18 2006 UTC

# Line 1 | Line 1
1 < "Id Revision"
1 > Id Revision

Diff Legend

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