Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
d5903d18
Commit
d5903d18
authored
20 years ago
by
Henrik (Grubba) Grubbström
Browse files
Options
Downloads
Patches
Plain Diff
Broke circularity module.pmod <==> client.pike.
Rev: lib/modules/Protocols.pmod/LDAP.pmod/module.pmod:1.23
parent
67e5967e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/modules/Protocols.pmod/LDAP.pmod/module.pmod
+9
-8
9 additions, 8 deletions
lib/modules/Protocols.pmod/LDAP.pmod/module.pmod
with
9 additions
and
8 deletions
lib/modules/Protocols.pmod/LDAP.pmod/module.pmod
+
9
−
8
View file @
d5903d18
// $Id: module.pmod,v 1.2
2
2005/04/0
7
1
8:36:45 mast
Exp $
// $Id: module.pmod,v 1.2
3
2005/04/0
8
1
2:27:34 grubba
Exp $
#include "ldap_globals.h"
#include "ldap_globals.h"
...
@@ -1610,10 +1610,11 @@ constant connection_rebind_threshold = 4;
...
@@ -1610,10 +1610,11 @@ constant connection_rebind_threshold = 4;
// Let there be a couple of differently bound connections before
// Let there be a couple of differently bound connections before
// starting to rebind the same ones.
// starting to rebind the same ones.
static mapping(string:array(client)) idle_conns = ([]);
static mapping(string:array(
object/*(
client)
*/)
) idle_conns = ([]);
static Thread.Mutex idle_conns_mutex = Thread.Mutex();
static Thread.Mutex idle_conns_mutex = Thread.Mutex();
client get_connection (string ldap_url, void|string binddn, void|string password)
object/*(client)*/ get_connection(string ldap_url, void|string binddn,
void|string password)
//! Returns a client connection to the specified LDAP URL. If a bind
//! Returns a client connection to the specified LDAP URL. If a bind
//! DN is specified (either through a @expr{"bindname"@} extension in
//! DN is specified (either through a @expr{"bindname"@} extension in
//! @[ldap_url] or, if there isn't one, through @[binddn]) then the
//! @[ldap_url] or, if there isn't one, through @[binddn]) then the
...
@@ -1631,7 +1632,7 @@ client get_connection (string ldap_url, void|string binddn, void|string password
...
@@ -1631,7 +1632,7 @@ client get_connection (string ldap_url, void|string binddn, void|string password
{
{
string pass = password;
string pass = password;
password = "CENSORED";
password = "CENSORED";
client conn;
object/*(
client
)*/
conn;
mapping(string:mixed) parsed_url = parse_ldap_url (ldap_url);
mapping(string:mixed) parsed_url = parse_ldap_url (ldap_url);
if (string url_bindname = parsed_url->ext && parsed_url->ext->bindname)
if (string url_bindname = parsed_url->ext && parsed_url->ext->bindname)
...
@@ -1644,10 +1645,10 @@ client get_connection (string ldap_url, void|string binddn, void|string password
...
@@ -1644,10 +1645,10 @@ client get_connection (string ldap_url, void|string binddn, void|string password
find_connection:
find_connection:
if (idle_conns[ldap_url]) {
if (idle_conns[ldap_url]) {
Thread.MutexKey lock = idle_conns_mutex->lock();
Thread.MutexKey lock = idle_conns_mutex->lock();
if (array(client) conns = idle_conns[ldap_url]) {
if (array(
object/*(
client)
*/)
conns = idle_conns[ldap_url]) {
int now = time();
int now = time();
client rebind_conn;
object/*(
client
)*/
rebind_conn;
for (int i = 0; i < sizeof (conns);) {
for (int i = 0; i < sizeof (conns);) {
conn = conns[i];
conn = conns[i];
int last_use = conn->get_last_io_time();
int last_use = conn->get_last_io_time();
...
@@ -1689,7 +1690,7 @@ find_connection:
...
@@ -1689,7 +1690,7 @@ find_connection:
else {
else {
DWRITE("Connecting to %O.\n", ldap_url);
DWRITE("Connecting to %O.\n", ldap_url);
conn = client (parsed_url);
conn =
Protocols.LDAP->
client (parsed_url);
}
}
if (!binddn)
if (!binddn)
...
@@ -1715,7 +1716,7 @@ find_connection:
...
@@ -1715,7 +1716,7 @@ find_connection:
return conn;
return conn;
}
}
void return_connection (client conn)
void return_connection
(object/*
(client
)*/
conn)
//! Use this to return a connection to the connection pool after
//! Use this to return a connection to the connection pool after
//! you've finished using it. The connection is assumed to be working.
//! you've finished using it. The connection is assumed to be working.
//!
//!
...
...
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