@@ -282,11 +282,11 @@ TlsCloseProc(ClientData instanceData, /* The socket to close. */ Tcl_Interp *interp) /* For error reporting - unused. */ { State *statePtr = (State *) instanceData; - dprintf(stderr,"\nTlsCloseProc(%p)", (void *) statePtr); + dprintf("TlsCloseProc(%p)", (void *) statePtr); if (channelTypeVersion == TLS_CHANNEL_VERSION_1) { /* * Remove event handler to underlying channel, this could * be because we are closing for real, or being "unstacked". @@ -330,11 +330,11 @@ State *statePtr = (State *) instanceData; int bytesRead; /* How many bytes were read? */ *errorCodePtr = 0; - dprintf(stderr,"\nBIO_read(%d)", bufSize); + dprintf("BIO_read(%d)", bufSize); if (statePtr->flags & TLS_TCL_CALLBACK) { /* don't process any bytes while verify callback is running */ bytesRead = 0; goto input; @@ -365,20 +365,20 @@ * functions play with the retry flags though, and this seems to work * correctly. Similar fix in TlsOutputProc. - hobbs */ ERR_clear_error(); bytesRead = BIO_read(statePtr->bio, buf, bufSize); - dprintf(stderr,"\nBIO_read -> %d", bytesRead); + dprintf("BIO_read -> %d", bytesRead); if (bytesRead < 0) { int err = SSL_get_error(statePtr->ssl, bytesRead); if (err == SSL_ERROR_SSL) { Tls_Error(statePtr, SSL_ERROR(statePtr->ssl, bytesRead)); *errorCodePtr = ECONNABORTED; } else if (BIO_should_retry(statePtr->bio)) { - dprintf(stderr,"RE! "); + dprintf("RE! "); *errorCodePtr = EAGAIN; } else { *errorCodePtr = Tcl_GetErrno(); if (*errorCodePtr == ECONNRESET) { /* Soft EOF */ @@ -386,11 +386,11 @@ bytesRead = 0; } } } input: - dprintf(stderr, "\nInput(%d) -> %d [%d]", bufSize, bytesRead, *errorCodePtr); + dprintf("Input(%d) -> %d [%d]", bufSize, bytesRead, *errorCodePtr); return bytesRead; } /* *------------------------------------------------------------------- @@ -419,11 +419,11 @@ State *statePtr = (State *) instanceData; int written, err; *errorCodePtr = 0; - dprintf(stderr,"\nBIO_write(%p, %d)", (void *) statePtr, toWrite); + dprintf("BIO_write(%p, %d)", (void *) statePtr, toWrite); if (statePtr->flags & TLS_TCL_CALLBACK) { /* don't process any bytes while verify callback is running */ written = -1; *errorCodePtr = EAGAIN; @@ -438,11 +438,11 @@ } if (statePtr->flags & TLS_TCL_INIT) { statePtr->flags &= ~(TLS_TCL_INIT); } if (toWrite == 0) { - dprintf(stderr, "zero-write\n"); + dprintf("zero-write"); BIO_flush(statePtr->bio); written = 0; goto output; } else { /* @@ -456,11 +456,11 @@ * BIO functions play with the retry flags though, and this seems to * work correctly. Similar fix in TlsInputProc. - hobbs */ ERR_clear_error(); written = BIO_write(statePtr->bio, buf, toWrite); - dprintf(stderr,"\nBIO_write(%p, %d) -> [%d]", + dprintf("BIO_write(%p, %d) -> [%d]", (void *) statePtr, toWrite, written); } if (written <= 0) { switch ((err = SSL_get_error(statePtr->ssl, written))) { case SSL_ERROR_NONE: @@ -467,40 +467,40 @@ if (written < 0) { written = 0; } break; case SSL_ERROR_WANT_WRITE: - dprintf(stderr," write W BLOCK"); + dprintf(" write W BLOCK"); break; case SSL_ERROR_WANT_READ: - dprintf(stderr," write R BLOCK"); + dprintf(" write R BLOCK"); break; case SSL_ERROR_WANT_X509_LOOKUP: - dprintf(stderr," write X BLOCK"); + dprintf(" write X BLOCK"); break; case SSL_ERROR_ZERO_RETURN: - dprintf(stderr," closed\n"); + dprintf(" closed"); written = 0; break; case SSL_ERROR_SYSCALL: *errorCodePtr = Tcl_GetErrno(); - dprintf(stderr," [%d] syscall errr: %d", + dprintf(" [%d] syscall errr: %d", written, *errorCodePtr); written = -1; break; case SSL_ERROR_SSL: Tls_Error(statePtr, SSL_ERROR(statePtr->ssl, written)); *errorCodePtr = ECONNABORTED; written = -1; break; default: - dprintf(stderr," unknown err: %d\n", err); + dprintf(" unknown err: %d", err); break; } } output: - dprintf(stderr, "\nOutput(%d) -> %d", toWrite, written); + dprintf("Output(%d) -> %d", toWrite, written); return written; } /* *------------------------------------------------------------------- @@ -595,11 +595,11 @@ * combination of TCL_READABLE, * TCL_WRITABLE and TCL_EXCEPTION. */ { State *statePtr = (State *) instanceData; - dprintf(stderr, "TlsWatchProc(0x%x)\n", mask); + dprintf("TlsWatchProc(0x%x)", mask); /* Pretend to be dead as long as the verify callback is running. * Otherwise that callback could be invoked recursively. */ if (statePtr->flags & TLS_TCL_CALLBACK) { return; } @@ -774,11 +774,11 @@ ClientData clientData; int mask; { State *statePtr = (State *) clientData; -dprintf(stderr, "HANDLER(0x%x)\n", mask); + dprintf("HANDLER(0x%x)", mask); Tcl_Preserve( (ClientData)statePtr); if (mask & TCL_READABLE) { BIO_set_flags(statePtr->p_bio, BIO_FLAGS_READ); } else { @@ -883,11 +883,11 @@ State *statePtr; int *errorCodePtr; /* Where to store error code. */ { int err; - dprintf(stderr,"\nWaitForConnect(%p)", (void *) statePtr); + dprintf("WaitForConnect(%p)", (void *) statePtr); if (statePtr->flags & TLS_TCL_HANDSHAKE_FAILED) { /* * We choose ECONNRESET over ECONNABORTED here because some server * side code, on the wiki for example, sets up a read handler that @@ -922,21 +922,21 @@ statePtr->flags |= TLS_TCL_HANDSHAKE_FAILED; *errorCodePtr = ECONNABORTED; return -1; } else if (BIO_should_retry(statePtr->bio)) { if (statePtr->flags & TLS_TCL_ASYNC) { - dprintf(stderr,"E! "); + dprintf("E! "); *errorCodePtr = EAGAIN; return -1; } else { continue; } } else if (err == 0) { if (Tcl_Eof(statePtr->self)) { return 0; } - dprintf(stderr,"CR! "); + dprintf("CR! "); *errorCodePtr = ECONNRESET; return -1; } if (statePtr->flags & TLS_TCL_SERVER) { err = SSL_get_verify_result(statePtr->ssl); @@ -947,14 +947,14 @@ *errorCodePtr = ECONNABORTED; return -1; } } *errorCodePtr = Tcl_GetErrno(); - dprintf(stderr,"ERR(%d, %d) ", rc, *errorCodePtr); + dprintf("ERR(%d, %d) ", rc, *errorCodePtr); return -1; } - dprintf(stderr,"R0! "); + dprintf("R0! "); return 1; } } Tcl_Channel