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

Comparing:
ircd-hybrid/src/fdlist.c (file contents), Revision 31 by knight, Sun Oct 2 20:34:05 2005 UTC vs.
ircd-hybrid-7.2/src/fdlist.c (file contents), Revision 1001 by michael, Sat Aug 29 22:44:44 2009 UTC

# Line 74 | Line 74 | fdlist_init(void)
74   void
75   recalc_fdlimit(void *unused)
76   {
77 #ifdef _WIN32
78  /* this is what WSAStartup() usually returns. Even though they say
79   * the value is for compatibility reasons and should be ignored,
80   * we actually can create even more sockets... */
81  hard_fdlimit = 32767;
82 #else
77    int fdmax;
78    struct rlimit limit;
79  
# Line 101 | Line 95 | recalc_fdlimit(void *unused)
95  
96    if (fdmax != hard_fdlimit)
97      execute_callback(fdlimit_cb, fdmax);
104 #endif
98   }
99  
100   static inline unsigned int
101   hash_fd(int fd)
102   {
110 #ifdef _WIN32
111  return ((((unsigned) fd) >> 2) % FD_HASH_SIZE);
112 #else
103    return (((unsigned) fd) % FD_HASH_SIZE);
114 #endif
104   }
105  
106   fde_t *
# Line 162 | Line 151 | fd_close(fde_t *F)
151    if (F->flags.is_socket)
152      comm_setselect(F, COMM_SELECT_WRITE | COMM_SELECT_READ, NULL, NULL, 0);
153  
154 <  if (F->dns_query != NULL)
166 <  {
167 <    delete_resolver_queries(F->dns_query);
168 <    MyFree(F->dns_query);
169 <  }
154 >  delete_resolver_queries(F);
155  
156   #ifdef HAVE_LIBCRYPTO
157    if (F->ssl)
# Line 185 | Line 170 | fd_close(fde_t *F)
170    }
171  
172    /* Unlike squid, we're actually closing the FD here! -- adrian */
188 #ifdef _WIN32
189  if (F->flags.is_socket)
190    closesocket(F->fd);
191  else
192    CloseHandle((HANDLE)F->fd);
193 #else
173    close(F->fd);
195 #endif
174    number_fd--;
175 < #ifdef INVARIANTS
176 <  memset(F, '\0', sizeof(fde_t));
199 < #endif
175 >
176 >  memset(F, 0, sizeof(fde_t));
177   }
178  
179   /*
# Line 239 | Line 216 | fd_note(fde_t *F, const char *format, ..
216   /* Make sure stdio descriptors (0-2) and profiler descriptor (3)
217   * always go somewhere harmless.  Use -foreground for profiling
218   * or executing from gdb */
242 #ifndef _WIN32
219   void
220   close_standard_fds(void)
221   {
# Line 252 | Line 228 | close_standard_fds(void)
228        exit(-1); /* we're hosed if we can't even open /dev/null */
229    }
230   }
255 #endif
231  
232   void
233   close_fds(fde_t *one)
# Line 263 | Line 238 | close_fds(fde_t *one)
238    for (i = 0; i < FD_HASH_SIZE; i++)
239      for (F = fd_hash[i]; F != NULL; F = F->hnext)
240        if (F != one)
266      {
267 #ifdef _WIN32
268        if (F->flags.is_socket)
269          closesocket(F->fd);
270        else
271          CloseHandle((HANDLE)F->fd);
272 #else
241          close(F->fd);
274 #endif  
275      }
242   }

Comparing:
ircd-hybrid/src/fdlist.c (property svn:keywords), Revision 31 by knight, Sun Oct 2 20:34:05 2005 UTC vs.
ircd-hybrid-7.2/src/fdlist.c (property svn:keywords), Revision 1001 by michael, Sat Aug 29 22:44:44 2009 UTC

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

Diff Legend

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