Branch: Tag:

2014-06-21

2014-06-21 01:24:10 by Martin Nilsson <nilsson@opera.com>

Clean up debug print outs.

112:    }    if (readbuf[0] != '0') {    seterr (LDAP_PROTOCOL_ERROR); -  DWRITE_HI("protocol.read_answer: ERROR: retv=<"+sprintf("%O",readbuf)+">\n"); +  DWRITE_HI("protocol.read_answer: ERROR: retv=<%O>\n", readbuf);    THROW(({"LDAP: Protocol mismatch.\n",backtrace()}));    //return -ldap_errno;    return;    } -  DWRITE(sprintf("protocol.read_answer: sizeof = %d\n", sizeof(readbuf))); +  DWRITE("protocol.read_answer: sizeof = %d\n", sizeof(readbuf));       msglen = readbuf[1];    ofs = 2;
157:    return;    }    readbuf += s; -  //DWRITE(sprintf("protocol.read_answer: %O\n", .ldap_privates.ldap_der_decode(readbuf))); +  //DWRITE("protocol.read_answer: %O\n", .ldap_privates.ldap_der_decode(readbuf));    DWRITE("protocol.read_answer: ok=1.\n");    ok = 1;   
219:    //THREAD_LOCK    msgnum = next_id++;    //THREAD_UNLOCK -  msgid = Standards.ASN1.Types.asn1_integer(msgnum); +  msgid = Standards.ASN1.Types.Integer(msgnum);    if (controls) { -  msgval = Standards.ASN1.Types.asn1_sequence(({msgid, msgop, controls})); +  msgval = Standards.ASN1.Types.Sequence(({msgid, msgop, controls}));    } else { -  msgval = Standards.ASN1.Types.asn1_sequence(({msgid, msgop})); +  msgval = Standards.ASN1.Types.Sequence(({msgid, msgop}));    }       if (objectp(msgval)) { -  DWRITE(sprintf("protocol.do_op: msg = [%d]\n",sizeof(msgval->get_der()))); +  DWRITE("protocol.do_op: msg = [%d]\n",sizeof(msgval->get_der()));    } else    DWRITE("protocol.do_op: msg is null!\n");   
240:    ERROR ("LDAP write error: %s\n", ldap_rem_errstr);    return -ldap_errno;    } -  DWRITE(sprintf("protocol.do_op: write OK [%d bytes].\n",rv)); +  DWRITE("protocol.do_op: write OK [%d bytes].\n",rv);    msgval = 0; msgid = 0;    writebuf= "";    readbuf= ""; // !!! NEni to pozde ?
272:    ERROR ("LDAP read error: %s\n", ldap_rem_errstr);    return -ldap_errno;    } -  DWRITE(sprintf("protocol.readmsg: sizeof = %d\n", sizeof(retv))); +  DWRITE("protocol.readmsg: sizeof = %d\n", sizeof(retv));       msglen = retv[1];    if (msglen & 0x80) { // > 0x7f
294:    msglen += shlp[ix]*(1<<(ix*8));    }    } -  DWRITE(sprintf("protocol.readmsg: reading %d bytes.\n", msglen)); +  DWRITE("protocol.readmsg: reading %d bytes.\n", msglen);    s = ldapfd->read(msglen);    if (!s | (sizeof(s) < msglen)) {    seterr (LDAP_SERVER_DOWN,
304:    }    retv += s;    last_io_time = time(); -  DWRITE(sprintf("protocol.readmsg: %O\n", .ldap_privates.ldap_der_decode(retv))); +  DWRITE("protocol.readmsg: %O\n", .ldap_privates.ldap_der_decode(retv));    return retv;    }   
318:    //THREAD_LOCK    msgnum = next_id++;    //THREAD_UNLOCK -  msgid = Standards.ASN1.Types.asn1_integer(msgnum); -  msgval = Standards.ASN1.Types.asn1_sequence(({msgid, msgop})); +  msgid = Standards.ASN1.Types.Integer(msgnum); +  msgval = Standards.ASN1.Types.Sequence(({msgid, msgop}));       if (objectp(msgval)) { -  DWRITE(sprintf("protocol.writemsg: msg = [%d]\n",sizeof(msgval->get_der()))); +  DWRITE("protocol.writemsg: msg = [%d]\n",sizeof(msgval->get_der()));    } else    DWRITE("protocol.writemsg: msg is null!\n");   
334:    ERROR ("LDAP write error: %s\n", ldap_rem_errstr);    return -ldap_errno;    } -  DWRITE(sprintf("protocol.writemsg: write OK [%d bytes].\n",rv)); +  DWRITE("protocol.writemsg: write OK [%d bytes].\n",rv);    msgval = 0; msgid = 0;    last_io_time = time();    return msgnum;    }