Commit Graph

223 Commits

Author SHA1 Message Date
Lachlan Roberts 1ae03a9d40 Allow extensions of QpackEncoder to override choice to huffman encode.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-12-20 09:33:38 +01:00
Lachlan Roberts f1e46c6127 Add synchronization to both Qpack Encoder and Decoder.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-12-20 09:33:38 +01:00
Lachlan Roberts 7c042b5205 wip
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-12-20 09:33:38 +01:00
Lachlan Roberts f8e2831185 Implement SectionAcknowledgment and StreamCancellation
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-12-20 09:33:38 +01:00
Lachlan Roberts c271b70d29 Rewrite QpackEncoder.encode for HttpField, implement Duplicates.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-12-20 09:33:38 +01:00
Lachlan Roberts bdf44b8e22 Work through examples B.1. and B.2. from spec and fix bugs.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-12-20 09:33:38 +01:00
Lachlan Roberts 5b178d16b7 Write the basic implementation for the QpackEncoder.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-12-20 09:33:38 +01:00
Lachlan Roberts ae4f33ed9e Remove the QPACK tests which only apply to HTTP/2 HPACK.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-12-20 09:33:38 +01:00
Lachlan Roberts 5958bae765 QpackDecoder should take the Stream ID to decode.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-12-20 09:33:38 +01:00
Lachlan Roberts 08b612feca Add basic implementation for the QpackDecoder.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-12-20 09:33:38 +01:00
Lachlan Roberts 9d9e13cf3a Use setPrefix API for NBitIntegerParser
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-12-20 09:33:38 +01:00
Lachlan Roberts 12a64b1637 Use classes for encoder and decoder instructions.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-12-20 09:33:38 +01:00
Lachlan Roberts 883e4f79c2 Implement Encoder & Decoder Streams to encode instructions.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-12-20 09:33:38 +01:00
Lachlan Roberts 2916b60091 Implement insertNameWithReference and insertWithLiteralName in EncoderInstructionParser.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-12-20 09:33:38 +01:00
Lachlan Roberts b3cd2a1c27 Implement setCapacity and duplicate on the Encoder Instruction Parser.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-12-20 09:33:38 +01:00
Lachlan Roberts 7c34d3c0cd Implement a decoder instruction parser & add tests.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-12-20 09:33:38 +01:00
Lachlan Roberts 96b940e35d Add copy of the new QPACK static table from SPEC.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-12-20 09:33:38 +01:00
Lachlan Roberts f39313b1d5 Decouple the DynamicTable from the QpackContext.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-12-20 09:33:38 +01:00
Lachlan Roberts 5d07842af8 Extract the StaticTable from the QpackContext.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-12-20 09:33:38 +01:00
Lachlan Roberts f8d2d9c600 Refactor names of HPACK to QPACK
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-12-20 09:33:38 +01:00
Lachlan Roberts ee042b173a Copy http2-hpack files into http3-qpack.
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
2021-12-20 09:33:38 +01:00
Ludovic Orban 4b6bcca529 get rid of promoteSession()
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 2f3587ef6d refactor session creation
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 0d890dc1c1 minor ref change
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 9f9d022373 improve debug logs
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban b1c8a9a1b8 make close(Throwable) private
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 59fe74a598 improve debug logs
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 5424f67132 dispatch from the timer thread to iterate
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 2244be64ef do not write directly to the endpoint
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban f860f1ca7c improve toString
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban e10dcad826 do not write directly to the endpoint
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 624f0f1ce4 fix log
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban c68d8e95cb fix log
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 619ba7a090 todo
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban c6093e9859 todos and cleanups
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban c117fbc61a todos and cleanups
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 197851257e cleanup tests
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban c96d64a04d cleanup tests
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 0771d860df get rid of QuicheConfig in QuicClientConnector
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban b8f39b5b2c get rid of HttpClientTransportOverQuic and IClientConnector
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban c70f49c773 improve quiche error handling
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 4455291bf9 make ClientQuicConnector extend from ClientConnector
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 9ad1c0e7a0 client quic config is kinda configurable now
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 34bf18cd8c fix max multiplex
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban b151957a5b more end2end tests
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban a12a2f34e5 clean up alpn protocol configuration
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 82960f417e clean up alpn protocol configuration
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 89369b9c25 introduce char_pointer native type
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban c2335c1e77 throw a specific exception on token validation error
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban a4e4872a9a notify and cleanup when quic connection is refused
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 29b2f8fa8a add a way to build a connection id object from a cid array
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban e1ceffe25a make onClose overridable and null-safe
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 4908b0676a do not close when QuicConnection gets an exception as it is shared by multiple quic connections
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 56d5a6a101 fix checkstyle
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban ecfffe5f66 make quic token minting and validation pluggable
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 44606d94be rename connectors
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 0ab056238b force selector count to 1
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 2e5ff2ddc3 remove unneeded parameter
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban a2cb2a69e6 make server use common classes
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 8315ba5815 make client use common classes
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 7d303b14c8 better align client and server quic sessions
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban a1b4eafc73 better align client and server quic connections
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban e8376a1a21 cleanup
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 669ae8ff1b move datagram endpoint to common module
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban ca4562ca8e cleanup SelectorManager accept FSM
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 3c1f1d3fe0 rename client datagram connector
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban c562262768 cleanup SelectorManager connect FSM
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 16cbcc0e4f HttpDestination can now be told to use cleartext even when the scheme is secure
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban c19988af28 create stream 0 when client connection is set up
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 6b3ad74ae6 fix NPE during dispose
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban c8e66daefe kinda sorta done the piping work up to Session.process()
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban c8d7bf01e1 better align client and server impls
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 2fcaad0cd8 add big file download test
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban e6cd0bae64 start quic client plumbing
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 17d28ea0c4 fix lifecycle on unrecoverable network error
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 6267089b4f replace InetSocketAddress decoding/encoding with side-stack argument passing
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban ee900b1a8d replace InetSocketAddress decoding/encoding with side-stack argument passing
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 62eed58afb improve pkcs12 -> pem convertor
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 6ae2fcde13 code alignment
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban eec497e0a9 move the execution strategy from connection to session
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 6b07965b9a minor refactoring
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban bfed7a5dfb add comment
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 6d0f7b6077 change test logs to INFO
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 22cf07dea8 improvements about how tasks are dispatched
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 90fbd977d7 add protection against using a freed quiche connection
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 69b7fe2887 force loading libquiche early
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 5a5ffd65e8 fix buffers clearing and releasing on looping
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 14c6143cdb fix a couple connection closing bugs
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 432eddf583 dispatch session readable events to EWYK
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 55657e3ea1 fix default value of _currentInterestOps
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 36e72019c9 improve flush() logging and impl
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 4b20324418 remove unneeded fillable flag
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 23c476cef6 fill can actually return -1
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban fc25540331 align ServerDatagramEndPoint with SocketChannelEndPoint
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban aaf0239911 handle filling and writing with proper NIO
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban a8a26706ab add debug log
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 36c0f79a94 factor out address decoding and encoding
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 44eb359d57 fix and document cipher buffers handling + add debug logs
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban e35b480afd fix closing of session
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 25ee5e35ac handle quiche connections timeouts
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban f0725d09d0 make QuicStreamEndPoint extend from AbstractEndPoint and handle finished streams
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban d12550f88a fix buffer too short exception
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Simone Bordet 81e3546b14 Pair programming session with Ludovic.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
2021-12-20 09:33:38 +01:00
Ludovic Orban 60b660cf04 fix buffer fill/flush modes
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban c2d8688feb run request handling + flush cipher text to socket
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban dfcb673425 stop concatenating debug strings
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban f3c96690db code alignment
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 9065d52ccd unneeded class
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 03fd0d5fef slight fill interest cleanup
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 9d0b7f71ac add licenses + fix checkstyle + modularize
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 53dd781744 addition of stream endpoints
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban e370f5e0ba misc cleanups and improvements
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban add0c8b605 fill now expects a fillable buffer + resets the buffer's position when nothing is read
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban ed49749897 negotiate now keeps the output buffer in flushable mode
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban e347074975 now capable of accepting a quic connection
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 1f588d719d add quiche native lib
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban bd2ed99550 refactorings
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban e1cd6956f4 encode address into buffers
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 340eb46b43 cleanups
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban ae330cb05f capable of serving one small http request over udp
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 24dbb4c084 fill kinda works
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban 45e45e6cf2 kinda sorta working datagram connector
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00
Ludovic Orban ccfe4ec90f no-op datagram connector
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
2021-12-20 09:33:38 +01:00