]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#4545 unchased referral fix from HEAD
authorHoward Chu <hyc@openldap.org>
Wed, 13 Dec 2006 16:24:09 +0000 (16:24 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 13 Dec 2006 16:24:09 +0000 (16:24 +0000)
libraries/libldap/result.c

index 4db51b83e3e0eb543cef679ff7c6208ce3677d64..03a2677fe9166552be3b7a8a8ed0bb1cf0cc6881 100644 (file)
@@ -566,7 +566,7 @@ nextresp2:
                                                                lr->lr_msgid, 0, 0);
                                                }
 
-                                               /* We sucessfully chased the reference */
+                                               /* We successfully chased the reference */
                                                v3ref = V3REF_SUCCESS;
                                        }
                                }
@@ -648,6 +648,26 @@ nextresp2:
                                        LDAP_FREE( lr->lr_res_error );
                                        lr->lr_res_error = NULL;
                                }
+
+                               /* Since it's not a SearchReference, it must be a
+                                * result. Since we're not chasing the referral,
+                                * this request is done.
+                                */
+                               if ( v3ref == V3REF_TOAPP ) {
+                                       lr->lr_status = LDAP_REQST_COMPLETED;
+                                       Debug( LDAP_DEBUG_TRACE,
+                                               "request done: ld %p msgid %d, "
+                                               "referral returned to app\n",
+                                               (void *)ld, lr->lr_msgid, 0);
+#ifdef LDAP_R_COMPILE
+                                       ldap_pvt_thread_mutex_lock( &ld->ld_req_mutex );
+#endif
+                                       ldap_free_request( ld, lr );
+#ifdef LDAP_R_COMPILE
+                                       ldap_pvt_thread_mutex_unlock( &ld->ld_req_mutex );
+#endif
+                                       lr = NULL;
+                               }
                        }
                }
        }