Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review 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
Christopher Ng
OpenLDAP
Commits
c10bb54b
Commit
c10bb54b
authored
26 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
Fix typo in write select. Fix errors in WINSOCK handling.
Add test listener no-thread_create experiment (behind ifdef).
parent
a3f1e5c4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
servers/slapd/daemon.c
+31
-18
31 additions, 18 deletions
servers/slapd/daemon.c
servers/slapd/result.c
+3
-2
3 additions, 2 deletions
servers/slapd/result.c
with
34 additions
and
20 deletions
servers/slapd/daemon.c
+
31
−
18
View file @
c10bb54b
...
...
@@ -485,18 +485,22 @@ slapd_daemon_task(
/* loop through the writers */
#ifdef HAVE_WINSOCK
for
(
i
=
0
;
i
<
writefds
.
fd_count
;
i
++
)
{
if
(
writefds
.
fd_array
[
i
]
==
tcps
)
{
int
wd
=
writefds
.
fd_array
[
i
];
if
(
wd
==
tcps
)
{
continue
;
}
Debug
(
LDAP_DEBUG_CONNS
,
"daemon: signalling write waiter on %d
\n
"
,
writefds
.
fd_array
[
i
],
0
,
0
);
assert
(
FD_ISSET
(
0
,
&
slap_daemon
.
sd_actives
)
);
wd
,
0
,
0
);
slapd_clr_write
(
writefds
.
fd_array
[
i
],
0
);
if
(
connection_write
(
writefds
.
fd_array
[
i
]
)
<
0
)
{
FD_CLR
(
writefds
.
fd_array
[
i
],
&
readfds
);
slapd_close
(
writefds
.
fd_array
[
i
]
);
assert
(
FD_ISSET
(
wd
,
&
slap_daemon
.
sd_actives
)
);
slapd_clr_write
(
wd
,
0
);
if
(
connection_write
(
wd
)
<
0
)
{
FD_CLR
(
wd
,
&
readfds
);
slapd_close
(
wd
);
}
}
#else
...
...
@@ -508,7 +512,7 @@ slapd_daemon_task(
Debug
(
LDAP_DEBUG_CONNS
,
"daemon: signaling write waiter on %d
\n
"
,
i
,
0
,
0
);
assert
(
FD_ISSET
(
0
,
&
slap_daemon
.
sd_actives
)
);
assert
(
FD_ISSET
(
i
,
&
slap_daemon
.
sd_actives
)
);
/* clear the write flag */
slapd_clr_write
(
i
,
0
);
...
...
@@ -523,15 +527,16 @@ slapd_daemon_task(
#ifdef HAVE_WINSOCK
for
(
i
=
0
;
i
<
readfds
.
fd_count
;
i
++
)
{
if
(
readfds
.
fd_array
[
i
]
==
tcps
)
{
int
rd
=
readfds
.
fd_array
[
i
];
if
(
rd
==
tcps
)
{
continue
;
}
Debug
(
LDAP_DEBUG_CONNS
,
"daemon: read activity on %d
\n
"
,
r
eadfds
.
fd_array
[
i
]
,
0
,
0
);
assert
(
FD_ISSET
(
r
eadfds
.
fd_array
[
i
]
,
&
slap_daemon
.
sd_actives
)
);
"daemon: read activity on %d
\n
"
,
r
d
,
0
,
0
);
assert
(
FD_ISSET
(
r
d
,
&
slap_daemon
.
sd_actives
)
);
if
(
connection_read
(
r
eadfds
.
fd_array
[
i
]
)
<
0
)
{
slapd_close
(
i
);
if
(
connection_read
(
r
d
)
<
0
)
{
slapd_close
(
rd
);
}
}
#else
...
...
@@ -593,18 +598,26 @@ int slapd_daemon( int inetd, int tcps )
args
[
0
]
=
inetd
;
args
[
1
]
=
tcps
;
status
=
ldap_pvt_thread_create
(
&
listener_tid
,
0
,
slapd_daemon_task
,
args
);
#define SLAPD_LISTENER_THREAD 1
#if SLAPD_LISTENER_THREAD
/* listener as a separate THREAD */
status
=
ldap_pvt_thread_create
(
&
listener_tid
,
0
,
slapd_daemon_task
,
args
);
if
(
status
!=
0
)
{
Debug
(
LDAP_DEBUG_ANY
,
"listener ldap_pvt_thread_create failed (%d)
\n
"
,
status
,
0
,
0
);
return
-
1
;
}
else
{
/* wait for the listener thread to complete */
ldap_pvt_thread_join
(
listener_tid
,
(
void
*
)
NULL
);
}
/* wait for the listener thread to complete */
ldap_pvt_thread_join
(
listener_tid
,
(
void
*
)
NULL
);
#else
/* expermimental code */
listener_tid
=
pthread_self
();
slapd_daemon_task
(
args
);
#endif
return
0
;
}
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/result.c
+
3
−
2
View file @
c10bb54b
...
...
@@ -34,8 +34,9 @@ send_ldap_result2(
if
(
err
==
LDAP_PARTIAL_RESULTS
&&
(
text
==
NULL
||
*
text
==
'\0'
)
)
err
=
LDAP_NO_SUCH_OBJECT
;
Debug
(
LDAP_DEBUG_TRACE
,
"send_ldap_result %d:%s:%s
\n
"
,
err
,
matched
?
matched
:
""
,
text
?
text
:
""
);
Debug
(
LDAP_DEBUG_TRACE
,
"send_ldap_result %d:%s:%s
\n
"
,
err
,
matched
?
matched
:
""
,
text
?
text
:
""
);
switch
(
op
->
o_tag
)
{
case
LBER_DEFAULT
:
...
...
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