mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
r8523: match a zero message id in ldap replies to the last request sent. Thanks to simo
for noticing that this is needed to catch the server sending a "can't decode request"
error reply
(This used to be commit 6e81e866dc
)
This commit is contained in:
parent
9953452d49
commit
039393d662
@ -106,6 +106,11 @@ static void ldap_match_message(struct ldap_connection *conn, struct ldap_message
|
|||||||
for (req=conn->pending; req; req=req->next) {
|
for (req=conn->pending; req; req=req->next) {
|
||||||
if (req->messageid == msg->messageid) break;
|
if (req->messageid == msg->messageid) break;
|
||||||
}
|
}
|
||||||
|
/* match a zero message id to the last request sent.
|
||||||
|
It seems that servers send 0 if unable to parse */
|
||||||
|
if (req == NULL && msg->messageid == 0) {
|
||||||
|
req = conn->pending;
|
||||||
|
}
|
||||||
if (req == NULL) {
|
if (req == NULL) {
|
||||||
DEBUG(0,("ldap: no matching message id for %u\n",
|
DEBUG(0,("ldap: no matching message id for %u\n",
|
||||||
msg->messageid));
|
msg->messageid));
|
||||||
@ -480,6 +485,9 @@ struct ldap_request *ldap_request_send(struct ldap_connection *conn,
|
|||||||
req->state = LDAP_REQUEST_SEND;
|
req->state = LDAP_REQUEST_SEND;
|
||||||
req->conn = conn;
|
req->conn = conn;
|
||||||
req->messageid = conn->next_messageid++;
|
req->messageid = conn->next_messageid++;
|
||||||
|
if (conn->next_messageid == 0) {
|
||||||
|
conn->next_messageid = 1;
|
||||||
|
}
|
||||||
req->type = msg->type;
|
req->type = msg->type;
|
||||||
if (req->messageid == -1) {
|
if (req->messageid == -1) {
|
||||||
goto failed;
|
goto failed;
|
||||||
|
Loading…
Reference in New Issue
Block a user