+ op->o_conn = conn;
+ op->vrFilter = NULL;
+#ifdef LDAP_CONTROL_PAGEDRESULTS
+ op->o_pagedresults_state = conn->c_pagedresults_state;
+#endif
+#ifdef LDAP_CONNECTIONLESS
+ if (conn->c_is_udp) {
+
+ if ( cdn ) {
+ ber_str2bv( cdn, 0, 1, &op->o_dn );
+ op->o_protocol = LDAP_VERSION2;
+ }
+ op->o_res_ber = ber_alloc_t( LBER_USE_DER );
+ if (op->o_res_ber == NULL)
+ return 1;
+
+ rc = ber_write(op->o_res_ber, (char *)&peeraddr, sizeof(struct sockaddr), 0);
+ if (rc != sizeof(struct sockaddr)) {
+#ifdef NEW_LOGGING
+ LDAP_LOG( CONNECTION, INFO,
+ "connection_input: conn %lu ber_write failed\n",
+ conn->c_connid, 0, 0 );
+#else
+ Debug( LDAP_DEBUG_ANY, "ber_write failed\n", 0, 0, 0 );
+#endif
+ return 1;
+ }
+
+ if (op->o_protocol == LDAP_VERSION2) {
+ rc = ber_printf(op->o_res_ber, "{is{" /*}}*/, op->o_msgid, "");
+ if (rc == -1) {
+#ifdef NEW_LOGGING
+ LDAP_LOG( CONNECTION, INFO,
+ "connection_input: conn %lu put outer sequence failed\n",
+ conn->c_connid, 0, 0 );
+#else
+ Debug( LDAP_DEBUG_ANY, "ber_write failed\n", 0, 0, 0 );
+#endif
+ return rc;
+ }
+ }
+ }
+#endif /* LDAP_CONNECTIONLESS */
+
+ rc = 0;
+
+ /* Don't process requests when the conn is in the middle of a
+ * Bind, or if it's closing. Also, don't let any single conn
+ * use up all the available threads, and don't execute if we're
+ * currently blocked on output. And don't execute if there are
+ * already pending ops, let them go first.
+ */