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
Jaak Ristioja
OpenLDAP
Commits
2d1cf97a
Commit
2d1cf97a
authored
25 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
move connection_close call from connection_input to connection_resched
to avoid accessing c_conn_state after close.
parent
549dd296
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/connection.c
+16
-8
16 additions, 8 deletions
servers/slapd/connection.c
with
16 additions
and
8 deletions
servers/slapd/connection.c
+
16
−
8
View file @
2d1cf97a
...
...
@@ -125,8 +125,11 @@ int connections_shutdown(void)
}
ldap_pvt_thread_mutex_lock
(
&
connections
[
i
].
c_mutex
);
/* connections_mutex and c_mutex are locked */
connection_closing
(
&
connections
[
i
]
);
connection_close
(
&
connections
[
i
]
);
ldap_pvt_thread_mutex_unlock
(
&
connections
[
i
].
c_mutex
);
}
...
...
@@ -620,6 +623,7 @@ connection_operation( void *arg_v )
case
LDAP_REQ_UNBIND_30
:
#endif
case
LDAP_REQ_UNBIND
:
/* c_mutex is locked */
connection_closing
(
conn
);
break
;
...
...
@@ -629,14 +633,6 @@ connection_operation( void *arg_v )
}
}
if
(
conn
->
c_conn_state
==
SLAP_C_CLOSING
)
{
Debug
(
LDAP_DEBUG_TRACE
,
"connection_operation: attempting closing conn=%ld sd=%d.
\n
"
,
conn
->
c_connid
,
ber_pvt_sb_get_desc
(
conn
->
c_sb
),
0
);
connection_close
(
conn
);
}
ldap_pvt_thread_mutex_lock
(
&
active_threads_mutex
);
active_threads
--
;
if
(
active_threads
<
1
)
{
...
...
@@ -659,7 +655,9 @@ int connection_read(int s)
ldap_pvt_thread_mutex_lock
(
&
connections_mutex
);
/* get (locked) connection */
c
=
connection_get
(
s
);
if
(
c
==
NULL
)
{
Debug
(
LDAP_DEBUG_ANY
,
"connection_read(%d): no connection!
\n
"
,
...
...
@@ -698,6 +696,7 @@ int connection_read(int s)
"connection_read(%d): input error=%d id=%ld, closing.
\n
"
,
s
,
rc
,
c
->
c_connid
);
/* connections_mutex and c_mutex are locked */
connection_closing
(
c
);
connection_close
(
c
);
}
...
...
@@ -802,6 +801,15 @@ connection_resched( Connection *conn )
{
Operation
*
op
;
if
(
conn
->
c_conn_state
==
SLAP_C_CLOSING
)
{
Debug
(
LDAP_DEBUG_TRACE
,
"connection_resched: attempting closing conn=%ld sd=%d.
\n
"
,
conn
->
c_connid
,
ber_pvt_sb_get_desc
(
conn
->
c_sb
),
0
);
connection_close
(
conn
);
return
0
;
}
if
(
conn
->
c_conn_state
!=
SLAP_C_ACTIVE
)
{
/* other states need different handling */
return
0
;
...
...
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