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

Comparing:
ircd-hybrid-7.2/src/s_auth.c (file contents), Revision 1000 by michael, Mon Aug 24 13:37:39 2009 UTC vs.
ircd-hybrid-8/src/s_auth.c (file contents), Revision 1247 by michael, Sat Oct 1 07:54:24 2011 UTC

# Line 33 | Line 33
33   *     --Bleep  Thomas Helvey <tomh@inxpress.net>
34   */
35   #include "stdinc.h"
36 #include "tools.h"
36   #include "list.h"
37 + #include "ircd_defs.h"
38 + #include "fdlist.h"
39   #include "s_auth.h"
40   #include "s_conf.h"
41   #include "balloc.h"
42   #include "client.h"
42 #include "common.h"
43   #include "event.h"
44 #include "fdlist.h"              /* fdlist_add */
44   #include "hook.h"
45   #include "irc_string.h"
47 #include "sprintf_irc.h"
46   #include "ircd.h"
49 #include "numeric.h"
47   #include "packet.h"
48   #include "irc_res.h"
49   #include "s_bsd.h"
50   #include "s_log.h"
51   #include "send.h"
52 < #include "memory.h"
52 >
53  
54   static const char *HeaderMessages[] = {
55    ":%s NOTICE AUTH :*** Looking up your hostname...",
# Line 143 | Line 140 | release_auth_client(struct AuthRequest *
140  
141    dlinkAdd(client, &client->node, &global_client_list);
142  
143 <  client->since  = client->lasttime = client->firsttime = CurrentTime;
143 >  client->localClient->since     = CurrentTime;
144 >  client->localClient->lasttime  = CurrentTime;
145 >  client->localClient->firsttime = CurrentTime;
146    client->flags |= FLAGS_FINISHED_AUTH;
147  
148    read_packet(&client->localClient->fd, client);
# Line 250 | Line 249 | start_auth_query(struct AuthRequest *aut
249    {
250      report_error(L_ALL, "creating auth stream socket %s:%s",
251          get_client_name(auth->client, SHOW_IP), errno);
252 <    ilog(L_ERROR, "Unable to create auth socket for %s",
252 >    ilog(LOG_TYPE_IRCD, "Unable to create auth socket for %s",
253          get_client_name(auth->client, SHOW_IP));
254      ++ServerStats.is_abad;
255      return 0;
# Line 419 | Line 418 | timeout_auth_queries_event(void *notused
418        sendheader(auth->client, REPORT_FAIL_DNS);
419      }
420  
421 <    ilog(L_INFO, "DNS/AUTH timeout %s",
421 >    ilog(LOG_TYPE_IRCD, "DNS/AUTH timeout %s",
422           get_client_name(auth->client, SHOW_IP));
423      release_auth_client(auth);
424    }
# Line 445 | Line 444 | auth_connect_callback(fde_t *fd, int err
444    char authbuf[32];
445    socklen_t ulen = sizeof(struct irc_ssaddr);
446    socklen_t tlen = sizeof(struct irc_ssaddr);
447 <  u_int16_t uport, tport;
447 >  uint16_t uport, tport;
448   #ifdef IPV6
449    struct sockaddr_in6 *v6;
450   #else
# Line 458 | Line 457 | auth_connect_callback(fde_t *fd, int err
457      return;
458    }
459  
460 <  if (getsockname(auth->client->localClient->fd.fd, (struct sockaddr *) &us,
461 <      (socklen_t *) &ulen) ||
462 <      getpeername(auth->client->localClient->fd.fd, (struct sockaddr *) &them,
463 <      (socklen_t *) &tlen))
460 >  if (getsockname(auth->client->localClient->fd.fd, (struct sockaddr *)&us,
461 >      &ulen) ||
462 >      getpeername(auth->client->localClient->fd.fd, (struct sockaddr *)&them,
463 >      &tlen))
464    {
465 <    ilog(L_INFO, "auth get{sock,peer}name error for %s",
465 >    ilog(LOG_TYPE_IRCD, "auth get{sock,peer}name error for %s",
466          get_client_name(auth->client, SHOW_IP));
467      auth_error(auth);
468      return;
# Line 485 | Line 484 | auth_connect_callback(fde_t *fd, int err
484    them.ss_len = tlen;
485   #endif
486    
487 <  ircsprintf(authbuf, "%u , %u\r\n", tport, uport);
487 >  snprintf(authbuf, sizeof(authbuf), "%u , %u\r\n", tport, uport);
488  
489    if (send(fd->fd, authbuf, strlen(authbuf), 0) == -1)
490    {
# Line 525 | Line 524 | read_auth_reply(fde_t *fd, void *data)
524     *
525     *    --nenolod
526     */
528 #ifndef _WIN32
527    len = read(fd->fd, buf, AUTH_BUFSIZ);
528 < #else
531 <  len = recv(fd->fd, buf, AUTH_BUFSIZ, 0);
532 < #endif
533 <  
528 >
529    if (len < 0)
530    {
536 #ifdef _WIN32
537    errno = WSAGetLastError();
538 #endif
531      if (ignoreErrno(errno))
532        comm_setselect(fd, COMM_SELECT_READ, read_auth_reply, auth, 0);
533      else

Diff Legend

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