]> git.sur5r.net Git - openldap/commitdiff
clear pagedresults_state if reusing an inactive connection; prepare for more consiste...
authorPierangelo Masarati <ando@openldap.org>
Mon, 21 Jun 2004 21:31:55 +0000 (21:31 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 21 Jun 2004 21:31:55 +0000 (21:31 +0000)
servers/slapd/connection.c
servers/slapd/controls.c

index 228c2ee00937af363663f74867dd10f16c03844a..934e067f8dca40c5602e9e2083400a2e742dc490 100644 (file)
@@ -1573,6 +1573,10 @@ connection_input(
        op->o_preread_attrs = NULL;
        op->o_postread_attrs = NULL;
        op->o_vrFilter = NULL;
+       /* clear state if the connection is being reused from inactive */
+       if ( conn->c_conn_state == SLAP_C_INACTIVE ) {
+               memset( &conn->c_pagedresults_state, 0, sizeof( conn->c_pagedresults_state ) );
+       }
        op->o_pagedresults_state = conn->c_pagedresults_state;
 
        op->o_res_ber = NULL;
index 1e06552ccbe66d426f7cec5de9599087e28c620f..097bfd49643806b0e7449124f3e5ef7c105cec97 100644 (file)
@@ -917,6 +917,16 @@ static int parsePagedResults (
 
        } else {
                /* Initial request.  Initialize state. */
+#if 0
+               if ( op->o_conn->c_pagedresults_state.ps_cookie != 0 ) {
+                       /* There's another pagedResults control on the
+                        * same connection; reject new pagedResults controls 
+                        * (allowed by RFC2696) */
+                       rs->sr_text = "paged results cookie unavailable; try later";
+                       rc = LDAP_UNWILLING_TO_PERFORM;
+                       goto done;
+               }
+#endif
                op->o_pagedresults_state.ps_cookie = 0;
                op->o_pagedresults_state.ps_count = 0;
        }