-
Notifications
You must be signed in to change notification settings - Fork 183
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: Factorisation of implementation into modules and layers #135
Merged
Merged
Changes from 145 commits
Commits
Show all changes
188 commits
Select commit
Hold shift + click to select a range
d572554
Replace FIFOBuffer implementation with BufferStream/IOBuffer wrapper.
samoconnor 9f01226
Rename canonicalize!(::String) -> tocameldash!(::String)
samoconnor 8d8841e
Remove URI, header and body size limits from parser.
samoconnor fabde09
Replace unused parser option "lenient" with global const "strict".
samoconnor 1b4aee0
Parser simplification
samoconnor f7ba394
Add tests for parsing one charactar at a time. Fix #125 and #126.
samoconnor 2dd90a8
Store method, major, minor, url and status in Parser - begin to separ…
samoconnor bb120bd
Use Vector{Pair} instead of Dict for Headers. See #108.
samoconnor f20fcb3
Use IOBuffer instead of Vector{UInt8} for field and value buffers in …
samoconnor 35dfe80
reduce main parse! function to a single method by keeping a reference…
samoconnor ce9d6ae
Remove *_mark from Parser.
samoconnor b1eebe8
Remove (mostly) unused Parser.nread field
samoconnor 7e0d643
Explicitly return HPE_OK (not errno) in Parser in places where there is
samoconnor 2bf357e
Clean up gotos and main loop condition in parser
samoconnor 602d7ed
Replace @debug(PARSING_DEBUG, ParsingStateCode(p_state)) in every ifelse
samoconnor c3194c0
Merge branch 'buffer_stream_branch' into simplify_parser_branch
samoconnor 770247f
Move header and body procssing out of parser (via callbacks)
samoconnor ac46ca2
throw message incomplete error from parse()
samoconnor 5af3f19
move upgrade flag to Parser struct so that state is preserved between…
samoconnor 175819e
throw ArgumentError for zero len passed to parse!
samoconnor 5d3ffa1
simplify ParsingError display
samoconnor f788921
Replace multiple status var returned by parse!() with state accessor
samoconnor 70a8373
Merge remote-tracking branch 'origin/master' into simplify_parser_branch
samoconnor aaf8e5d
replace "while true" read loop in client with "while !eof(socket)" loop
samoconnor 8f49465
throw errors directly from parse!()
samoconnor 5febfb8
Call show(r) for verbose logging and write(r) for comms.
samoconnor dbb1bae
fix parse error when fragmentation splits CRLF
samoconnor 9accb0b
simple debug macro
samoconnor 77ba528
function absuri(u::URI, context::URI)
samoconnor ebced40
parser interface tweaks in server (untested)
samoconnor 87775ee
Work in progress. Separation of client functionality into layers.
samoconnor 9f1756c
Added closeread/closewrite interface to manage pooling/interleaving.
samoconnor 89b4f19
Add high level client interfaces
samoconnor 573867f
Move default port (80/443) to getconnection.
samoconnor be4bc91
simplify Base.print(io::IO, u::URI), just print string directly
samoconnor 602ed98
simplify Base.print(io::IO, u::URI), just print string directly
samoconnor 8f031c1
Split util functions into: Pairs.jl, Stirngs.jl, debug.jl, parseutils.jl
samoconnor 8b57b6f
debug tweaks
samoconnor cf9c03d
tweak import of MbedTLS.SSLContext
samoconnor 57224d1
Update client.jl API to use refactored internals.
samoconnor 1a2b4ae
improve show(io::IO, c::Connection)
samoconnor 6167fa6
Parsers.jl cleanup
samoconnor 40e56eb
doc examples
samoconnor aa8f232
Architecture and Internal Interface Documentation
samoconnor 9ae07c5
Whoops
samoconnor 11f90a4
Split stack furthur into seperate modules.
samoconnor 946e35d
more refinement of layer separation, doc updates
samoconnor ea0a9c9
note that header functions are case-insensitive
samoconnor 808b577
doc typos
samoconnor 4b601f5
Cache Parser in ConnectionPool.
samoconnor fe07a9b
simplify Base.read!(::IO, ::Parser) per https://github.com/JuliaWeb/M…
samoconnor dc95c38
fix prior broken commit
samoconnor 0a654eb
test/REQUIRE JSON
samoconnor 3a79361
fix for syntax: unexpected "catch" on 0.7
samoconnor b3625f8
temporarily limit travis to v0.6/linux
samoconnor a4e13a4
Ensure that all old client.jl keyword options are handeled or produce a
samoconnor fd7c97d
Revert rename of parser.jl -> Parsers.jl to avoid making GitHub's diff
samoconnor 024a5a5
tweaks to "minimal" configuration
samoconnor 388433c
fix connection pool locking for concurrent access to same connection
samoconnor d17d851
Parser tweaks
samoconnor b928fe0
cosmetics
samoconnor 6b6b16e
add state and status to ParsingError. Handle eof() before message has…
samoconnor c22a7cc
fix read/write locks in ConnectionPool.jl
samoconnor 7ad1d73
typo in @err macro
samoconnor b02c8da
add note about header fragmentation
samoconnor 67ac47a
ConnectionPool scheme refinement.
samoconnor 21ca900
HTTP.jl
samoconnor d5af224
Merge remote-tracking branch 'origin/master' into simplify_parser_branch
samoconnor 9457bf8
v0.7 compat
samoconnor 4319b2b
remove old async test, see new test/async.jl
samoconnor fe2243c
v0.7 updates
samoconnor 16836f6
remove unreachable state s_dead
samoconnor 2fcc81e
split parse! into parseheaders! and parsebody!
samoconnor dbc37df
add readbody! and readheaders!
samoconnor 17d080f
API notes
samoconnor 5f13213
API notes
samoconnor f547a28
API notes
samoconnor 5aa1b0b
More extreme async and streaming tests: async.jl
samoconnor f6867ca
Merge remote-tracking branch 'origin/master' into simplify_parser_branch
samoconnor c3f8253
Move request() function from RequestStack module to top-level HTTP mo…
samoconnor 531d36a
whoops
samoconnor 3e0d7a6
More async streaming tests (and resulting bug-fixes)
samoconnor d7155d1
whoops
samoconnor f78324a
whoops
samoconnor 10d8b82
whoops
samoconnor 36e871f
need eof bugfix in +MbedTLS 0.5.2
samoconnor b6114c7
tweak AWS4AuthRequest.jl debug levels
samoconnor 6813d54
DEBUG_LEVEL = 0 by default
samoconnor 090148d
added lockedby() to compat.jl
samoconnor cd54d0f
type annotation
samoconnor 28dc704
type annotation
samoconnor ebbe960
cosmetics
samoconnor 0d1056a
reenstate verbose= option
samoconnor 16084d0
ConnectionPool.jl enhancements.
samoconnor a241651
test tweaks
samoconnor 701d2f4
added TimeoutLayer
samoconnor 21b942e
Concurrency enhancements to Handle RFC7230 6.5, early termination.
samoconnor 80043ee
typo
samoconnor 0f5a32a
ConnectionPool eof() handle closed Transaction.
samoconnor 8666274
fix pipline_limit off-by-one, add +Base.close(c::Connection) = Base.c…
samoconnor 901004f
more variation of parameters in test/async.jl
samoconnor 8e69738
Add test/WebSockets.jl to test connection upgrade.
samoconnor 03c6a03
Ignore 100 Continue message in startread(http::HTTPStream)
samoconnor 7511663
Test for 100-continue
samoconnor d5e4038
MUST NOT automatically retry a request with a non-idempotent method
samoconnor 6a7e1fa
fix deadlock when no conncetion duplication is allowed
samoconnor 7c89d28
https://tools.ietf.org/html/rfc7230#section-6.3.2
samoconnor 279e807
Fix isrecoverable()/isidempotent() bug
samoconnor 6acaee2
Add loopback test for abort while sending body (& fix bugs)
samoconnor b7a1eb7
dont set chunked header when upgrade header is set
samoconnor 343d860
add tests for pipeline_limit and duplicate_limit
samoconnor 6dd2807
Pass Content-Length:0 to S3 GET in tests to avoid automatic chunked h…
samoconnor d34e9e1
added tests for no pipelinging after non-idempotent
samoconnor f44d68d
Fix for closed connections stuck in pool.
samoconnor 1cfdd96
loopback test connection pool cleanup
samoconnor a42f1d6
close before purge in close(c::Connection)
samoconnor 2e4e4ed
Set Content-Length: 0 by default for iofunction GET requests
samoconnor 15232fd
tweak delays in loopback test to remove race conditions
samoconnor 27d665b
dont run AWS S3 tests if creds ENV not set
samoconnor a4ed450
whoops
samoconnor 941c6e6
docstring cleanup, work in progress
samoconnor 704264d
arch doc
samoconnor 3c94232
Doc cleanup
samoconnor 7507bbb
fix !minima/minimal bug in stack()
samoconnor 38cf9c6
Doc cleanup.
samoconnor 5e0dade
Remove Connect.jl module.
samoconnor 128a33b
doc updates
samoconnor c1d2b35
typo
samoconnor 422c8f5
Fix show(::IOError).
samoconnor 25e2af9
handlers tweaks for compatibility with HTTP.Request
samoconnor eabeab7
remove redundant connectionclosed(p::Parser), replaced by hasheader(h…
samoconnor 969f438
added @ensure to debug.jl
samoconnor dd5b23a
remove unneeded abbeviation of request to req
samoconnor 2c9fee6
added hasheader(::Message, key, value)
samoconnor 4345a9c
ConnectionPool and HTTP.Stream tweaks for server mode compatibility.
samoconnor d032905
cosmatics
samoconnor 16f28ee
WIP integrating connection pipelining and HTTP.Stream with server.jl
samoconnor a2419c9
Add HTTP.listen server API
samoconnor e17f7ad
Parser cleanup post "Connection: Upgrade" testing.
samoconnor 133b5dd
Remove commented out dead code.
samoconnor 2aad8ca
add Base.readbytes!(t::Transaction, a::Vector{UInt8}, nb::Int)
samoconnor 250b6ea
Messages.jl
samoconnor e0d900a
Revise Streams.jl to bypass parser for non-chunked bodies.
samoconnor 97409a9
use ConnectionPool.byteview conveniance fn in Base.readavailable(http…
samoconnor fa38054
Remove redundant header interpretation from Parser.
samoconnor 9b5191f
https://github.com/JuliaWeb/HTTP.jl/pull/135#pullrequestreview-88370194
samoconnor 09a508c
https://github.com/JuliaWeb/HTTP.jl/pull/135#pullrequestreview-88370960
samoconnor 058e2e4
doc tweak
samoconnor 2acab09
typo
samoconnor cb9ad32
https://github.com/JuliaWeb/HTTP.jl/pull/135#pullrequestreview-88372788
samoconnor 499b752
doc fix
samoconnor cb1b850
doc tweaks
samoconnor bb96146
doc tweak
samoconnor c02b21b
remove redundant import in Messages.jl
samoconnor a8f4f73
typos, and add escapepath to URIs module
samoconnor e32604b
Rename Nitrogren -> Servers
samoconnor aa792e5
0.6 tweaks
samoconnor ea97668
update README
samoconnor 5bc54e5
Merge https://github.com/samoconnor/HTTP.jl/pull/1
samoconnor a53ba48
compat for Val
samoconnor 8bb14bd
compat for Val
samoconnor 235879c
IOExtras.closeread::Stream{Request} fix for server mode
samoconnor 4d6f94d
Add http://localhost:8081 server for ConnectionPool debug.
samoconnor 6c10abc
https://github.com/JuliaLang/julia/pull/25479
samoconnor 396dca5
latest v0.7 master compat tweaks
samoconnor 8b9ffcf
move STATUS_CODES const to Messages.jl (only place it is used) and us…
samoconnor 13503ab
Don't include consts.jl in top level HTTP namespace
samoconnor 934b4de
Server doc updates
samoconnor cc76f4f
untested integration of Server and serve with listen
samoconnor 3d5fc58
FIXME
samoconnor b7ce63c
Add MicroLogging for Windows v0.6
EricForgy 37e9bb1
Rename handlers.jl to Handlers.jl
EricForgy a6bcb4b
Merge pull request #2 from EricForgy/simplify_parser_branch
samoconnor 831e64e
Merge pull request #3 from EricForgy/patch-8
samoconnor b263d13
untested implementation of HTTP.serve() calling HTTP.listen()
samoconnor 25944c8
Server integration and tests.
samoconnor cb4a894
oops
samoconnor 1df2227
disable extra debug printf in test/server.jl
samoconnor b2b5a14
Return status 413 for too-large headers.
samoconnor be69847
randomise server port number in tests
samoconnor 6d978be
iso8859_1_to_utf8 per #141
samoconnor aff5cac
typo
samoconnor 61e197d
Naming consistancy tweaks.
samoconnor 6c6dfbb
update tests and compat
samoconnor 7d92068
try to fix Inexact Error in win32
samoconnor d27163c
Update @ensure macro to print values of failed comparison.
samoconnor b6ea4c7
Add postconditions to URI(;kw...) and parse(::URI, ...) to ensure
samoconnor 23dab21
handle asterix-form Request Target https://tools.ietf.org/html/rfc723…
samoconnor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,6 @@ | |
.DS_Store | ||
*.key | ||
*.crt | ||
*.swp | ||
docs/build/ | ||
docs/site/ | ||
docs/site/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
julia 0.6 | ||
MbedTLS 0.4.0 | ||
MbedTLS 0.5.2 | ||
IniFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's best practice to leave this as nightly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't actually think this will work as 0.7 until there's a release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9b5191f