mirror of
git://sourceware.org/git/glibc.git
synced 2025-01-18 12:16:13 +08:00
[BZ #2498]
2006-04-01 Ulrich Drepper <drepper@redhat.com> [BZ #2498] * nscd/connections.c (main_loop_poll): If the connection cannot be accepted because of user-imposed limits close the descriptor.
This commit is contained in:
parent
1329b60176
commit
9388dcbb84
@ -1,3 +1,9 @@
|
|||||||
|
2006-04-01 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
[BZ #2498]
|
||||||
|
* nscd/connections.c (main_loop_poll): If the connection cannot be
|
||||||
|
accepted because of user-imposed limits close the descriptor.
|
||||||
|
|
||||||
2006-03-31 Ulrich Drepper <drepper@redhat.com>
|
2006-03-31 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/Versions: Export sync_file_range with
|
* sysdeps/unix/sysv/linux/Versions: Export sync_file_range with
|
||||||
|
@ -1556,18 +1556,24 @@ main_loop_poll (void)
|
|||||||
/* We have a new incoming connection. Accept the connection. */
|
/* We have a new incoming connection. Accept the connection. */
|
||||||
int fd = TEMP_FAILURE_RETRY (accept (sock, NULL, NULL));
|
int fd = TEMP_FAILURE_RETRY (accept (sock, NULL, NULL));
|
||||||
|
|
||||||
/* use the descriptor if we have not reached the limit. */
|
/* Use the descriptor if we have not reached the limit. */
|
||||||
if (fd >= 0 && firstfree < nconns)
|
if (fd >= 0)
|
||||||
{
|
{
|
||||||
conns[firstfree].fd = fd;
|
if (firstfree < nconns)
|
||||||
conns[firstfree].events = POLLRDNORM;
|
{
|
||||||
starttime[firstfree] = now;
|
conns[firstfree].fd = fd;
|
||||||
if (firstfree >= nused)
|
conns[firstfree].events = POLLRDNORM;
|
||||||
nused = firstfree + 1;
|
starttime[firstfree] = now;
|
||||||
|
if (firstfree >= nused)
|
||||||
|
nused = firstfree + 1;
|
||||||
|
|
||||||
do
|
do
|
||||||
++firstfree;
|
++firstfree;
|
||||||
while (firstfree < nused && conns[firstfree].fd != -1);
|
while (firstfree < nused && conns[firstfree].fd != -1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
/* We cannot use the connection so close it. */
|
||||||
|
close (fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
--n;
|
--n;
|
||||||
|
Loading…
Reference in New Issue
Block a user