From 597c0c7b35f1f76e5d5c709dd1c082e8c5391405 Mon Sep 17 00:00:00 2001 From: Sam O'Connor Date: Tue, 17 Apr 2018 10:44:16 +1000 Subject: [PATCH] tweaks to allow tests to run with DEBUG_LEVEL != 0 --- src/ConnectionPool.jl | 8 ++++++-- src/StreamRequest.jl | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ConnectionPool.jl b/src/ConnectionPool.jl index 539e1e5dd..06b21ecf1 100644 --- a/src/ConnectionPool.jl +++ b/src/ConnectionPool.jl @@ -581,7 +581,7 @@ function sslupgrade(t::Transaction{TCPSocket}, end function Base.show(io::IO, c::Connection) - nwaiting = bytesavailable(tcpsocket(c.io)) + nwaiting = applicable(tcpsocket, c.io) ? bytesavailable(tcpsocket(c.io)) : 0 print( io, tcpstatus(c), " ", @@ -593,12 +593,16 @@ function Base.show(io::IO, c::Connection) " ≣", c.pipeline_limit, length(c.excess) > 0 ? " $(length(c.excess))-byte excess" : "", nwaiting > 0 ? " $nwaiting bytes waiting" : "", - DEBUG_LEVEL > 1 ? " $(Base._fd(tcpsocket(c.io)))" : "") + DEBUG_LEVEL > 1 && applicable(tcpsocket, c.io) ? + " $(Base._fd(tcpsocket(c.io)))" : "") end Base.show(io::IO, t::Transaction) = print(io, "T$(rpad(t.sequence,2)) ", t.c) function tcpstatus(c::Connection) + if !applicable(tcpsocket, c.io) + return "" + end s = Base.uv_status_string(tcpsocket(c.io)) if s == "connecting" return "🔜🔗" elseif s == "open" return "🔗 " diff --git a/src/StreamRequest.jl b/src/StreamRequest.jl index d0fc31c80..8b59d11c7 100644 --- a/src/StreamRequest.jl +++ b/src/StreamRequest.jl @@ -72,7 +72,7 @@ function request(::Type{StreamLayer}, io::IO, request::Request, body; e = first(e.exceptions).ex end if aborted && isioerror(e) - @debug 1 "⚠️ $(response.status) abort exception excpeted: $ex" + @debug 1 "⚠️ $(response.status) abort exception excpeted: $e" else rethrow(e) end