summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/fe.h
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2010-06-23 10:36:52 -0600
committerRich Megginson <rmeggins@redhat.com>2010-06-23 11:45:22 -0600
commitf70152942727368aa0ce378bdfd54c6bad32e69d (patch)
treec281e502023c121f996439c080cd4869d3896a75 /ldap/servers/slapd/fe.h
parentbeb23fe4b5cc15a692a2282b27a49deedb502eda (diff)
downloadds-f70152942727368aa0ce378bdfd54c6bad32e69d.tar.gz
ds-f70152942727368aa0ce378bdfd54c6bad32e69d.tar.xz
ds-f70152942727368aa0ce378bdfd54c6bad32e69d.zip
Bug 604453 - SASL Stress and Server crash: Program quits with the assertion failure in PR_Poll
https://bugzilla.redhat.com/show_bug.cgi?id=604453 Resolves: bug 604453 Bug Description: SASL Stress and Server crash: Program quits with the assertion failure in PR_Poll Reviewed by: nhosoi (Thanks!) Branch: master Fix Description: When the server pushes the SASL IO layer on to the connection it must do so when there are no other references to the connection. The only way to do this without introducing more locking is to have the saslbind code just register the intent to push SASL IO at the next available time. This cannot be done in the sasl bind code (or any operation code for that matter) because connection_threadmain() will enable the connection for reading (and polling) after reading the PDU and before calling the operation function. Therefore, during the operation function, the connection may be being actively polled, so we must not access the conn c_prfd. The best place to push the IO layer is in connection_threadmain, after the server has notified that there is read ready on the connection, but before we have actually attempted to read anything. At this point, connection_threadmain is the only thread that will be accessing the connection, and if we push or pop the IO layer before calling the read function, we are guaranteed to have the correct IO layer to use. The code has been made generic enough to allow for use by the startTLS code if the need arises. I also added some more locking in the saslbind code, and changed the sasl IO code to more closely resemble the way that the NSS code deals with IO layer push/pop. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no (cherry picked from commit c28fcadfc7812108573e40f13624e11a5a8609e5)
Diffstat (limited to 'ldap/servers/slapd/fe.h')
-rw-r--r--ldap/servers/slapd/fe.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/ldap/servers/slapd/fe.h b/ldap/servers/slapd/fe.h
index 3eb1d0ad..3a985cb7 100644
--- a/ldap/servers/slapd/fe.h
+++ b/ldap/servers/slapd/fe.h
@@ -116,6 +116,8 @@ int connection_operations_pending( Connection *conn, Operation *op2ignore,
void connection_done(Connection *conn);
void connection_cleanup(Connection *conn);
void connection_reset(Connection* conn, int ns, PRNetAddr * from, int fromLen, int is_SSL);
+void connection_set_io_layer_cb( Connection *c, Conn_IO_Layer_cb push_cb, Conn_IO_Layer_cb pop_cb, void *cb_data );
+int connection_call_io_layer_callbacks( Connection *c );
/*
* conntable.c
@@ -182,7 +184,8 @@ void configure_ns_socket( int * ns );
/*
* sasl_io.c
*/
-int sasl_io_enable(Connection *c);
+int sasl_io_enable(Connection *c, void *data);
+int sasl_io_cleanup(Connection *c, void *data);
/*
* sasl_map.c