Skip to content

Commit

Permalink
tweaks to allow tests to run with DEBUG_LEVEL != 0
Browse files Browse the repository at this point in the history
  • Loading branch information
samoconnor committed Apr 17, 2018
1 parent fa6b206 commit 597c0c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/ConnectionPool.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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), " ",
Expand All @@ -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 "🔗 "
Expand Down
2 changes: 1 addition & 1 deletion src/StreamRequest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 597c0c7

Please sign in to comment.