Skip to content

Commit

Permalink
https://github.com/JuliaLang/julia/pull/25479
Browse files Browse the repository at this point in the history
  • Loading branch information
samoconnor committed Jan 13, 2018
1 parent 4d6f94d commit 6c10abc
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 20 deletions.
1 change: 0 additions & 1 deletion src/AWS4AuthRequest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module AWS4AuthRequest

using ..Base64
using ..Dates
using ..Unicode
using MbedTLS: digest, MD_SHA256, MD_MD5
import ..Layer, ..request, ..Headers
using ..URIs
Expand Down
24 changes: 19 additions & 5 deletions src/ConnectionPool.jl
Original file line number Diff line number Diff line change
Expand Up @@ -546,12 +546,12 @@ function Base.show(io::IO, c::Connection)
lpad(c.readcount,3), "", c.readbusy ? "🔒 " : " ",
c.host, ":",
c.port != "" ? c.port : Int(c.peerport), ":", Int(c.localport),
",", c.pipeline_limit,
length(c.excess) > 0 ? ", $(length(c.excess))-byte excess" : "",
"", c.pipeline_limit,
length(c.excess) > 0 ? " $(length(c.excess))-byte excess" : "",
inactiveseconds(c) > 5 ?
", inactive $(round(inactiveseconds(c),1))s" : "",
nwaiting > 0 ? ", $nwaiting bytes waiting" : "",
DEBUG_LEVEL > 1 ? ", $(Base._fd(tcpsocket(c.io)))" : "")
" inactive $(round(inactiveseconds(c),1))s" : "",
nwaiting > 0 ? " $nwaiting bytes waiting" : "",
DEBUG_LEVEL > 1 ? " $(Base._fd(tcpsocket(c.io)))" : "")
end

Base.show(io::IO, t::Transaction) = print(io, "T$(rpad(t.sequence,2)) ", t.c)
Expand Down Expand Up @@ -580,4 +580,18 @@ function showpool(io::IO)
unlock(poollock)
end

function showpoolhtml(io::IO)
lock(poollock)
println(io, "<table>")
for c in pool
print(io, "<tr>")
for x in split("$c")
print(io, "<td>$x</td>")
end
println(io, "<tr>")
end
println(io, "</table>")
unlock(poollock)
end

end # module ConnectionPool
2 changes: 0 additions & 2 deletions src/Messages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ export Message, Request, Response,
readstartline!, writestartline,
bodylength, unknown_length

using ..Unicode

import ..HTTP

using ..Pairs
Expand Down
2 changes: 0 additions & 2 deletions src/URIs.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
module URIs

using ..Unicode

import Base.==

include("urlparser.jl")
Expand Down
1 change: 0 additions & 1 deletion src/WebSockets.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module WebSockets

using ..Base64
using ..Unicode
using MbedTLS: digest, MD_SHA1, SSLContext
import ..HTTP
using ..IOExtras
Expand Down
4 changes: 2 additions & 2 deletions src/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ mutable struct Client
# cookies are stored in-memory per host and automatically sent when appropriate
cookies::Dict{String, Set{Cookie}}
# global request settings
options::(VERSION > v"0.7.0-DEV.2338" ? NamedTuple : Vector{Tuple{Symbol,Any}})
options::Vector{Tuple{Symbol,Any}}
end

Client(;options...) = Client(Dict{String, Set{Cookie}}(), options)
Client(;options...) = Client(Dict{String, Set{Cookie}}(), collect(options))
global const DEFAULT_CLIENT = Client()

# build Request
Expand Down
2 changes: 0 additions & 2 deletions src/compat.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
@static if VERSION >= v"0.7.0-DEV.2915"

using Base64
using Unicode
import Dates

else # Julia v0.6

eval(:(module Base64 end))
eval(:(module Unicode end))
const Dates = Base.Dates

pairs(x) = [k => v for (k,v) in x]
Expand Down
1 change: 0 additions & 1 deletion src/cookies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ module Cookies
export Cookie

import ..Dates
using ..Unicode

import Base.==
import ..URIs.isurlchar
Expand Down
7 changes: 5 additions & 2 deletions test/async.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@ stop_pool_dump = false
<html><head>
<title>HTTP.jl Connection Pool</title>
<meta http-equiv="refresh" content="1">
<style type="text/css" media="screen">
td { padding-left: 5px; padding-right: 5px }
</style>
</head>
<body><pre>
""")
write(http, "<body><pre>")
buf = IOBuffer()
HTTP.ConnectionPool.showpool(buf)
HTTP.ConnectionPool.showpoolhtml(buf)
write(http, take!(buf))
write(http, "</pre></body>")
end

@async begin
sleep(1)
sleep(5)
try
run(`open http://localhost:8081`)
catch e
Expand Down
1 change: 0 additions & 1 deletion test/messages.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module MessagesTest

using ..Test
using ..Unicode

using HTTP.Messages
import HTTP.Messages.appendheader
Expand Down
1 change: 0 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using HTTP
using HTTP.Dates
using HTTP.Unicode
using HTTP.Test

@testset "HTTP" begin
Expand Down

0 comments on commit 6c10abc

Please sign in to comment.