src/_bonsai/ldapconnectiter.c
LDAPConnectIter *
LDAPConnectIter_New(LDAPConnection *conn, ldap_conndata_t *info, SOCKET sock) {
    PyObject *tmp = NULL;
    LDAPConnectIter *self =
            (LDAPConnectIter *)LDAPConnectIterType.tp_new(&LDAPConnectIterType,
                    NULL, NULL);

    if (conn != NULL && self != NULL) {
        Py_INCREF(conn);
        self->conn = conn;
        self->info = info;

        /* Check the TLS state. */
        tmp = PyObject_GetAttrString(self->conn->client, "tls");
        if (tmp == NULL) return NULL;
        self->tls = PyObject_IsTrue(tmp);
        Py_DECREF(tmp);


        self->init_thread_data = create_init_thread_data(self->conn->client, sock);
        if (self->init_thread_data == NULL) return NULL;

        if (create_init_thread(self->init_thread_data, self->info, &(self->init_thread))
                != 0) return NULL;

        self->timeout = -1;
    }

    return self;
}
/* Create a new LDAPConnectIter object for internal use. */
Create a new LDAPConnectIter object for internal use.
Create a new LDAPConnectIter object for internal use .
LDAPConnectIter *
LDAPConnectIter_New(LDAPConnection *conn, ldap_conndata_t *info, SOCKET sock) {
    PyObject *tmp = NULL;
    LDAPConnectIter *self =
            (LDAPConnectIter *)LDAPConnectIterType.tp_new(&LDAPConnectIterType,
                    NULL, NULL);
    if (conn != NULL && self != NULL) {
        Py_INCREF(conn);
        self->conn = conn;
        self->info = info;
        tmp = PyObject_GetAttrString(self->conn->client, "tls");
        if (tmp == NULL) return NULL;
        self->tls = PyObject_IsTrue(tmp);
        Py_DECREF(tmp);
        self->init_thread_data = create_init_thread_data(self->conn->client, sock);
        if (self->init_thread_data == NULL) return NULL;
        if (create_init_thread(self->init_thread_data, self->info, &(self->init_thread))
                != 0) return NULL;
        self->timeout = -1;
    }
    return self;
}
LDAPConnectIter * LDAPConnectIter_New ( LDAPConnection * conn , ldap_conndata_t * info , SOCKET sock ) { PyObject * tmp = NULL ; LDAPConnectIter * self = ( LDAPConnectIter * ) LDAPConnectIterType . tp_new ( & LDAPConnectIterType , NULL , NULL ) ; if ( conn != NULL && self != NULL ) { Py_INCREF ( conn ) ; self -> conn = conn ; self -> info = info ; tmp = PyObject_GetAttrString ( self -> conn -> client , " " ) ; if ( tmp == NULL ) return NULL ; self -> tls = PyObject_IsTrue ( tmp ) ; Py_DECREF ( tmp ) ; self -> init_thread_data = create_init_thread_data ( self -> conn -> client , sock ) ; if ( self -> init_thread_data == NULL ) return NULL ; if ( create_init_thread ( self -> init_thread_data , self -> info , & ( self -> init_thread ) ) != 0 ) return NULL ; self -> timeout = -1 ; } return self ; }
Create a new LDAPConnectIter object for internal use.
Create a new LDAPConnectIter object for internal use .
/* Check the TLS state. */