Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dragoș Haiduc
OpenLDAP
Commits
2165de59
Commit
2165de59
authored
23 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
Suck in enfile/emfile patch from HEAD.
parent
92281da3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
servers/slapd/daemon.c
+35
-7
35 additions, 7 deletions
servers/slapd/daemon.c
with
35 additions
and
7 deletions
servers/slapd/daemon.c
+
35
−
7
View file @
2165de59
...
...
@@ -717,6 +717,7 @@ slapd_daemon_task(
ber_socket_t
nfds
;
#define SLAPD_EBADF_LIMIT 16
int
ebadf
=
0
;
int
emfile
=
0
;
#define SLAPD_IDLE_CHECK_LIMIT 4
time_t
now
=
slap_get_time
();
...
...
@@ -727,14 +728,14 @@ slapd_daemon_task(
Sockaddr
from
;
#if defined(SLAPD_RLOOKUPS)
struct
hostent
*
hp
;
struct
hostent
*
hp
;
#endif
struct
timeval
zero
;
struct
timeval
*
tvp
;
if
(
global_idletimeout
>
0
&&
difftime
(
if
(
emfile
||
(
global_idletimeout
>
0
&&
difftime
(
last_idle_check
+
global_idletimeout
/
SLAPD_IDLE_CHECK_LIMIT
,
now
)
<
0
)
now
)
<
0
)
)
{
connections_timeout_idle
(
now
);
}
...
...
@@ -881,13 +882,39 @@ slapd_daemon_task(
(
struct
sockaddr
*
)
&
from
,
&
len
);
if
(
s
==
AC_SOCKET_INVALID
)
{
int
err
=
sock_errno
();
Debug
(
LDAP_DEBUG_ANY
,
"daemon: accept(%ld) failed errno=%d (%s)
\n
"
,
(
long
)
slap_listeners
[
l
]
->
sl_sd
,
err
,
sock_errstr
(
err
)
);
#ifdef EMFILE
if
(
err
==
EMFILE
)
{
emfile
++
;
}
else
#endif
#ifdef ENFILE
if
(
err
==
ENFILE
)
{
emfile
++
;
}
else
#endif
{
emfile
=
0
;
}
if
(
emfile
<
3
)
{
Debug
(
LDAP_DEBUG_ANY
,
"daemon: accept(%ld) failed errno=%d (%s)
\n
"
,
(
long
)
slap_listeners
[
l
]
->
sl_sd
,
err
,
sock_errstr
(
err
)
);
}
else
{
/* prevent busy loop */
# ifdef HAVE_USLEEP
if
(
emfile
%
4
==
3
)
usleep
(
250
);
# else
if
(
emfile
%
8
==
7
)
sleep
(
1
);
# endif
}
ldap_pvt_thread_yield
();
continue
;
}
emfile
=
0
;
#ifndef HAVE_WINSOCK
/* make sure descriptor number isn't too great */
...
...
@@ -895,6 +922,7 @@ slapd_daemon_task(
Debug
(
LDAP_DEBUG_ANY
,
"daemon: %ld beyond descriptor table size %ld
\n
"
,
(
long
)
s
,
(
long
)
dtblsize
,
0
);
slapd_close
(
s
);
ldap_pvt_thread_yield
();
continue
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment