pike.git / lib / modules / Protocols.pmod / LDAP.pmod / protocol.pike

version» Context lines:

pike.git/lib/modules/Protocols.pmod/LDAP.pmod/protocol.pike:1:   #pike __REAL_VERSION__      // LDAP client protocol implementation for Pike.   // - // $Id: protocol.pike,v 1.20 2008/01/13 17:02:43 nilsson Exp $ + // $Id: protocol.pike,v 1.21 2008/06/28 16:36:58 nilsson Exp $   //   // Honza Petrous, hop@unibase.cz   //   // ----------------------------------------------------------------------   //   // History:   //   // v1.9 1999-02-19 created separate file   // - improved checking of readed bytes in 'readmsg'   // v1.9.1.1
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/protocol.pike:38:    /*private*/ string writebuf=""; // write buffer   // private written; // count of written chars    private function con_ok; // async callback functions    object conthread; // thread connection    array extra_args; // not used, yet   // /*private*/ int errno;    int connected = 0;    object low_fd = Stdio.File(); // helper fd    object ldapfd; // helper fd    - static int last_io_time; // Timestamp when I/O on the fd was made last. + protected int last_io_time; // Timestamp when I/O on the fd was made last.       int seterr(int errno, void|string errstr) {    // Sets ldap_err* variables and returns errno       ldap_rem_errstr = errstr;    ldap_errno = errno;    return errno;    }       //!
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/protocol.pike:80:   string server_error_string() {return ldap_rem_errstr;}       array error() { return ({error_number(), error_string()}); }         //! Returns when I/O was made last. Useful to find out whether it's   //! safe to continue using a connection that has been idle for some   //! time.   int get_last_io_time() {return last_io_time;}    -  static void read_answer() { +  protected void read_answer() {    // ----------------------    // Reads LDAP PDU (with defined msgid) from the server       int msglen = 0, ix, ofs;    string s, shlp;       if(sizeof(readbuf) < 2)    readbuf = ldapfd->read(2); // 1. byte = 0x0C, 2. byte = msglen    if (intp(readbuf) || (sizeof(readbuf) < 2)) {    seterr (LDAP_TIMEOUT);
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/protocol.pike:151:    //DWRITE(sprintf("protocol.read_answer: %s\n", .ldap_privates.ldap_der_decode(readbuf)->debug_string()));    DWRITE("protocol.read_answer: ok=1.\n");    ok = 1;       last_io_time = time();       if(con_ok)    con_ok(this, @extra_args);    }    -  static int is_whole_pdu() { +  protected int is_whole_pdu() {    // ----------------------    // Check if LDAP PDU is complete in 'readbuf'       int msglen, ix, ofs;    string shlp;       if (sizeof(readbuf) < 3)    return 0; // PDU have min. 3 bytes       if (readbuf[0] != '0')
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/protocol.pike:332:    }    DWRITE(sprintf("protocol.writemsg: write OK [%d bytes].\n",rv));    msgval = 0; msgid = 0;    last_io_time = time();    return msgnum;    }      #else   constant this_program_does_not_exist=1;   #endif +