Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joe Martin
OpenLDAP
Commits
b49932d6
Commit
b49932d6
authored
Mar 16, 2017
by
Ondřej Kuzník
Committed by
Ondřej Kuzník
Nov 17, 2020
Browse files
Connection write support
parent
79f7e79f
Changes
3
Hide whitespace changes
Inline
Side-by-side
servers/lloadd/client.c
View file @
b49932d6
...
...
@@ -42,6 +42,24 @@ void
client_write_cb
(
evutil_socket_t
s
,
short
what
,
void
*
arg
)
{
Connection
*
c
=
arg
;
ldap_pvt_thread_mutex_lock
(
&
c
->
c_io_mutex
);
Debug
(
LDAP_DEBUG_CONNS
,
"client_write_cb: "
"have something to write to client %lu
\n
"
,
c
->
c_connid
);
if
(
ber_flush
(
c
->
c_sb
,
c
->
c_pendingber
,
1
)
)
{
int
err
=
sock_errno
();
if
(
err
!=
EWOULDBLOCK
&&
err
!=
EAGAIN
)
{
ldap_pvt_thread_mutex_lock
(
&
c
->
c_mutex
);
ldap_pvt_thread_mutex_unlock
(
&
c
->
c_io_mutex
);
client_destroy
(
c
);
return
;
}
event_add
(
c
->
c_write_event
,
NULL
);
}
c
->
c_pendingber
=
NULL
;
ldap_pvt_thread_mutex_unlock
(
&
c
->
c_io_mutex
);
}
Connection
*
...
...
servers/lloadd/slap.h
View file @
b49932d6
...
...
@@ -285,8 +285,8 @@ struct Connection {
ldap_pvt_thread_mutex_t
c_io_mutex
;
/* only one pdu written at a time */
BerElement
*
c_currentber
;
/* ber we're attempting to read */
struct
berval
c_pendingber
;
/* ber we're attempting to write */
BerElement
*
c_currentber
;
/* ber we're attempting to read */
BerElement
*
c_pendingber
;
/* ber we're attempting to write */
#define CONN_IS_TLS 1
#define CONN_IS_CLIENT 4
...
...
servers/lloadd/upstream.c
View file @
b49932d6
...
...
@@ -39,6 +39,27 @@ void
upstream_write_cb
(
evutil_socket_t
s
,
short
what
,
void
*
arg
)
{
Connection
*
c
=
arg
;
ldap_pvt_thread_mutex_lock
(
&
c
->
c_io_mutex
);
Debug
(
LDAP_DEBUG_CONNS
,
"upstream_write_cb: "
"have something to write to upstream %lu
\n
"
,
c
->
c_connid
);
if
(
ber_flush
(
c
->
c_sb
,
c
->
c_pendingber
,
1
)
)
{
int
err
=
sock_errno
();
if
(
err
!=
EWOULDBLOCK
&&
err
!=
EAGAIN
)
{
ldap_pvt_thread_mutex_lock
(
&
c
->
c_mutex
);
Debug
(
LDAP_DEBUG_ANY
,
"upstream_write_cb: "
"error writing to connection %ld
\n
"
,
c
->
c_connid
);
ldap_pvt_thread_mutex_unlock
(
&
c
->
c_io_mutex
);
upstream_destroy
(
c
);
return
;
}
event_add
(
c
->
c_write_event
,
0
);
}
c
->
c_pendingber
=
NULL
;
ldap_pvt_thread_mutex_unlock
(
&
c
->
c_io_mutex
);
}
Connection
*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment