Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Lazy Parsing #331

Draft
wants to merge 42 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
d67960f
WIP: Lazy header parser based on code from LazyJSON.jl
samoconnor Sep 24, 2018
49f1acc
Make Header <: AbstractDict
samoconnor Sep 25, 2018
7cb8064
more doc, more tests, optional folding support, validation regexs, in…
samoconnor Sep 26, 2018
314b395
move Lazy* tests from src/ to test/.
samoconnor Sep 27, 2018
301239b
Improve tests for LazyString nextind and isvalid.
samoconnor Sep 28, 2018
27dd47b
use underlying string indexes (except for index 1)
samoconnor Sep 28, 2018
b1526aa
more docs, indexing cleanup, move most methods from LazyASCII up to L…
samoconnor Sep 29, 2018
d092563
doc updates
samoconnor Sep 29, 2018
e3f34ba
improve iterator trait definitions, clean up type parameters
samoconnor Sep 29, 2018
c99cf70
performance test
samoconnor Sep 29, 2018
b26b50f
make isvalid work with IOBuffer
samoconnor Sep 30, 2018
6b7b4b2
add local LazyStrings.jl function `maxindex` to allow underlying stri…
samoconnor Sep 30, 2018
5be0d8d
add header mutation interface `delete!`, `push!` and `setindex!` usin…
samoconnor Sep 30, 2018
728c169
add header mutation interface `delete!`, `push!` and `setindex!` usin…
samoconnor Sep 30, 2018
2f4400b
tweak mutation functions for clarity, add return types to method, tar…
samoconnor Sep 30, 2018
23dbc19
Improve AbstractString compatibility of LazyHTTP and LazyStrings
samoconnor Oct 1, 2018
887e61e
add LazyHTTP.Header support to IODebug.jl
samoconnor Oct 1, 2018
46746b9
Monkeypatch for https://github.com/JuliaLang/julia/issues/29451
samoconnor Oct 1, 2018
0752ca4
add Base.append! for LazyHTTP.Header and add headers option to Respon…
samoconnor Oct 1, 2018
d4bb186
uncomment benchmark
samoconnor Oct 1, 2018
0d22f41
export start-line fields as Pseudo-Header Fields for forwards-compat…
samoconnor Oct 5, 2018
c390860
Nibbles
samoconnor Oct 12, 2018
9208f43
WIP HPack
samoconnor Oct 14, 2018
81b0485
Improve cursor/offset system for handling random access.
samoconnor Oct 15, 2018
161796b
unravel hp_field / Base.iterate(bi::BlockIterator
samoconnor Oct 15, 2018
e69df9b
doc cleanup, tweak some field and var names
samoconnor Oct 15, 2018
dc441a4
add HPack.jl and Nibbles.jl to tests
samoconnor Oct 16, 2018
09d3664
add LazyJSON as test dep
samoconnor Oct 16, 2018
c833c89
tweak Project.toml again
samoconnor Oct 16, 2018
9d72a56
add HTTP_JL_RUN_FULL_HPACK_TEST
samoconnor Oct 17, 2018
af3cffa
tweak HTTP_JL_RUN_FULL_HPACK_TEST
samoconnor Oct 17, 2018
ac675d7
tweak HTTP_JL_RUN_FULL_HPACK_TEST
samoconnor Oct 17, 2018
9992138
WIP HPack shortcut methods
samoconnor Oct 20, 2018
b250eb6
MbedTLS hang bug fix
samoconnor Oct 20, 2018
0bda22f
MbedTLS bug fix
samoconnor Oct 20, 2018
7a81bd4
HPack shortcut methods
samoconnor Oct 21, 2018
ca36aa0
Use the General registry uuid. (#333)
fredrikekre Oct 16, 2018
ccb5998
update tomls
samoconnor Oct 21, 2018
fa50d5b
Decoding HTTP frames
samoconnor Oct 24, 2018
178d936
More tests and doc for HTTP Frames
samoconnor Oct 25, 2018
e2c234c
rework Frames.jl around a processing function for each frame type
samoconnor Oct 29, 2018
a276be9
Merge branch 'master' into so/lazyprep
samoconnor Nov 1, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 5 additions & 27 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,14 @@ uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[BinaryProvider]]
deps = ["Libdl", "Pkg", "SHA", "Test"]
git-tree-sha1 = "b530fbeb6f41ab5a83fbe3db1fcbe879334bcd2d"
git-tree-sha1 = "9930c1a6cd49d9fcd7218df6be417e6ae4f1468a"
uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
version = "0.4.2"

[[Compat]]
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
git-tree-sha1 = "ae262fa91da6a74e8937add6b613f58cd56cdad4"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "1.1.0"
version = "0.5.2"

[[Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"

[[DelimitedFiles]]
deps = ["Mmap"]
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"

[[Distributed]]
deps = ["LinearAlgebra", "Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Expand Down Expand Up @@ -59,10 +49,10 @@ deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"

[[MbedTLS]]
deps = ["BinaryProvider", "Compat", "Libdl", "Pkg", "Sockets"]
git-tree-sha1 = "17d5a81dbb1e682d4ff707c01f0afe5948068fa6"
deps = ["BinaryProvider", "Libdl", "Pkg", "Random", "Sockets", "Test"]
git-tree-sha1 = "4b890362c0c2fdb14a575ce927f1f4eeac6dda9f"
uuid = "739be429-bea8-5141-9913-cc70e7f3736d"
version = "0.6.0"
version = "0.6.4"

[[Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
Expand All @@ -89,21 +79,9 @@ uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"

[[SharedArrays]]
deps = ["Distributed", "Mmap", "Random", "Serialization"]
uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383"

[[Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"

[[SparseArrays]]
deps = ["LinearAlgebra", "Random"]
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[[Statistics]]
deps = ["LinearAlgebra", "SparseArrays"]
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
8 changes: 4 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name = "HTTP"
uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3"
authors = ["Jacob Quinn", "Sam O'Conner", "contributors: https://github.com/JuliaWeb/HTTP.jl/graphs/contributors"]
version = "0.7.0"
authors = ["Jacob Quinn", "Sam O'Connor", "contributors: https://github.com/JuliaWeb/HTTP.jl/graphs/contributors"]

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand All @@ -14,13 +13,14 @@ Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
MbedTLS = "v0.6.0"
MbedTLS = "v0.6.4"

[extras]
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
LazyJSON = "fc18253b-5e1b-504c-a4a2-9ece4944c004"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
XMLDict = "228000da-037f-5747-90a9-8195ccbf91a5"

[targets]
test = ["Test", "JSON", "XMLDict", "Distributed"]
test = ["Test", "JSON", "LazyJSON", "XMLDict", "Distributed"]
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
julia 0.7
MbedTLS 0.6
MbedTLS 0.6.4
IniFile
10 changes: 8 additions & 2 deletions src/AWS4AuthRequest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ using ..Dates
using MbedTLS: digest, MD_SHA256, MD_MD5
import ..Layer, ..request, ..Headers
using ..URIs
using ..Pairs: getkv, setkv, rmkv
import ..Pairs: setkv, rmkv
import ..@debug, ..DEBUG_LEVEL

using ..LazyHTTP
setkv(c::LazyHTTP.Header, k, v) = setindex!(c, v, k)
rmkv(c::LazyHTTP.Header, k) = delete!(c, k)



"""
request(AWS4AuthLayer, ::URI, ::Request, body) -> HTTP.Response

Expand Down Expand Up @@ -36,7 +42,7 @@ end

function sign_aws4!(method::String,
url::URI,
headers::Headers,
headers::Union{Headers,LazyHTTP.Header},
body::Vector{UInt8};
body_sha256::Vector{UInt8}=digest(MD_SHA256, body),
body_md5::Vector{UInt8}=digest(MD_MD5, body),
Expand Down
Loading