Skip to content

Commit aa792e5

Browse files
committed
0.6 tweaks
Rename some files to match module names.
1 parent e32604b commit aa792e5

File tree

16 files changed

+50
-23
lines changed

16 files changed

+50
-23
lines changed

src/ConnectionPool.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ function Base.readavailable(t::Transaction)::ByteView
182182
end
183183

184184

185+
@static if VERSION < v"0.7.0-DEV.2915" const copyto! = copy! end
186+
185187
function Base.readbytes!(t::Transaction, a::Vector{UInt8}, nb::Int)
186188

187189
if !isempty(t.c.excess)

src/HTTP.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ const DEBUG_LEVEL = 0
99
const minimal = false
1010

1111
include("compat.jl")
12-
1312
include("debug.jl")
13+
1414
include("Pairs.jl")
1515
include("Strings.jl")
1616
include("IOExtras.jl") ;import .IOExtras.IOError
17-
include("uri.jl") ;using .URIs
17+
include("URIs.jl") ;using .URIs
1818
if !minimal
1919
include("consts.jl")
2020
include("utils.jl")
2121
include("fifobuffer.jl") ;using .FIFOBuffers
2222
include("cookies.jl") ;using .Cookies
2323
include("multipart.jl")
2424
end
25-
include("parser.jl") ;import .Parsers: Parser, Headers, Header,
25+
include("Parsers.jl") ;import .Parsers: Parser, Headers, Header,
2626
ParsingError, ByteView
2727
include("ConnectionPool.jl")
2828
include("Messages.jl") ;using .Messages
@@ -582,8 +582,8 @@ include("WebSockets.jl") ;using .WebSockets
582582
end
583583
include("client.jl")
584584
include("sniff.jl")
585-
include("handlers.jl"); using .Handlers
586-
include("server.jl"); using .Servers.listen
585+
include("Handlers.jl"); using .Handlers
586+
include("Servers.jl"); using .Servers.listen
587587
end
588588
include("precompile.jl")
589589

File renamed without changes.
File renamed without changes.

src/Streams.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ https://tools.ietf.org/html/rfc7231#section-6.2.1
165165
function handle_continue(http::Stream{Response})
166166
if http.message.status == 100
167167
@debug 1 "✅ Continue: $(http.stream)"
168-
configure_parser(http)
168+
reset!(http.parser)
169169
readheaders(http.stream, http.parser, http.message)
170170
end
171171

src/TimeoutRequest.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module TimeoutRequest
22

3-
import ..Layer, ..request, ..lockedby
3+
import ..Layer, ..request
44
using ..ConnectionPool
55
import ..@debug, ..DEBUG_LEVEL
66

File renamed without changes.

src/debug.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
taskid(t=current_task()) = hex(hash(t) & 0xffff, 4)
2-
taskid(l::ReentrantLock) = islocked(l) ? taskid(lockedby(l)) : ""
32

43
macro debug(n::Int, s)
54
DEBUG_LEVEL >= n ? :(println("DEBUG: ", taskid(), " ", $(esc(s)))) :

test/async.jl

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
using Test
1+
@static if VERSION > v"0.7.0-DEV.2005"
2+
using Test
3+
using Base64
4+
end
25
using HTTP
36
using JSON
47
using MbedTLS: digest, MD_MD5, MD_SHA256
5-
using Base64
68

79
using HTTP.IOExtras
810
using HTTP.request
@@ -46,8 +48,9 @@ function dump_async_exception(e, st)
4648
print(String(take!(buf)))
4749
end
4850

49-
if haskey(ENV, "AWS_ACCESS_KEY_ID") ||
50-
haskey(ENV, "AWS_DEFAULT_PROFILE")
51+
if VERSION > v"0.7.0-DEV.2338" &&
52+
(haskey(ENV, "AWS_ACCESS_KEY_ID") ||
53+
haskey(ENV, "AWS_DEFAULT_PROFILE"))
5154
@testset "async s3 dup$dup, count$count, sz$sz, pipw$pipe, $http, $mode" for
5255
count in [10, 100, 1000],
5356
dup in [0, 7],
@@ -144,6 +147,10 @@ for i = 1:count
144147
@test a == put_data_sums[i]
145148
end
146149

150+
if haskey(ENV, "HTTP_JL_TEST_QUICK_ASYNC")
151+
break
152+
end
153+
147154
end # testset
148155
end # if haskey(ENV, "AWS_ACCESS_KEY_ID")
149156

@@ -299,6 +306,11 @@ println("running async $count, 1:$num, $config, $http C")
299306
HTTP.ConnectionPool.showpool(STDOUT)
300307
HTTP.ConnectionPool.closeall()
301308

309+
310+
if haskey(ENV, "HTTP_JL_TEST_QUICK_ASYNC")
311+
break
312+
end
313+
302314
end # testset
303315

304316
stop_pool_dump=true

test/client.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ for sch in ("http", "https")
1111
@test status(HTTP.get("$sch://httpbin.org/ip")) == 200
1212
@test status(HTTP.head("$sch://httpbin.org/ip")) == 200
1313
@test status(HTTP.options("$sch://httpbin.org/ip")) == 200
14-
@test status(HTTP.post("$sch://httpbin.org/ip"; statusexception=false)) == 405
14+
@test status(HTTP.post("$sch://httpbin.org/ip"; status_exception=false)) == 405
1515
@test status(HTTP.post("$sch://httpbin.org/post")) == 200
1616
@test status(HTTP.put("$sch://httpbin.org/put")) == 200
1717
@test status(HTTP.delete("$sch://httpbin.org/delete")) == 200

0 commit comments

Comments
 (0)