gcoap_forward_proxy: provide cache validation mechanism#17801
Merged
cgundogan merged 1 commit intoRIOT-OS:masterfrom May 12, 2022
Merged
gcoap_forward_proxy: provide cache validation mechanism#17801cgundogan merged 1 commit intoRIOT-OS:masterfrom
cgundogan merged 1 commit intoRIOT-OS:masterfrom
Conversation
bde1484 to
10d24b4
Compare
10d24b4 to
21fbacc
Compare
21fbacc to
1435718
Compare
2 tasks
ce54fdc to
ecabce6
Compare
ecabce6 to
24472a8
Compare
Member
Author
|
Rebased and retested on diff --git a/aiocoap/cli/fileserver.py b/aiocoap/cli/fileserver.py
index 1bf2ba4..f6ce129 100644
--- a/aiocoap/cli/fileserver.py
+++ b/aiocoap/cli/fileserver.py
@@ -160,2 +160,3 @@ class FileServer(Resource, aiocoap.interfaces.ObservableResource):
+ response.opt.max_age = 10
response.opt.etag = etag) $ sudo ./dist/tool/tapsetup/tapsetup
$ PORT=tap1 USEMODULE="gcoap_forward_proxy nanocoap_cache" make -C examples/gcoap -j flash term
...
[second terminal in aiocoap repo]
$ ./aiocoap-fileserver --bind "[$(ip addr show dev tapbr0 scope link | grep -o 'inet6 [0-9a-f:]\+' | sed 's/inet6 //')%tapbr0]" test/
...
[third terminal]
$ make -C examples/gcoap term
All up, running the shell now
> coap proxy set fe80::e0bc:7dff:fecb:f550 5683
coap proxy set fe80::e0bc:7dff:fecb:f550 5683
>
> coap get fe80::dc1a:a8ff:fe09:45b3 5683 /a.txt
coap get fe80::dc1a:a8ff:fe09:45b3 5683 /a.txt
gcoap_cli: sending msg ID 51017, 54 bytes
> --- blockwise start ---
gcoap: response Success, code 2.05, 7 bytes
foobar
--- blockwise complete ---
coap get fe80::dc1a:a8ff:fe09:45b3 5683 /a.txt
coap get fe80::dc1a:a8ff:fe09:45b3 5683 /a.txt
gcoap_cli: sending msg ID 51018, 54 bytes
> --- blockwise start ---
gcoap: response Success, code 2.05, 7 bytes
foobar
--- blockwise complete ---
^C
native: exiting |
24472a8 to
1b569a5
Compare
Member
Author
|
Addressed doxygen errors and squashed. |
ccd7dff to
9d4bb84
Compare
Member
Author
|
Squashed as requested off-line |
Member
Member
Author
|
Mh... that indicates, that the proxy is not able to allocate another cep. Will have a look. |
Member
Author
|
fb9a11d fixes that. On validation, the client ep was previously not freed correctly 😅. Good catch! |
Member
|
Alright, I can't reproduce this error anymore with your fix. Looks good! Please squash. |
fb9a11d to
73bcd83
Compare
This was referenced Oct 18, 2023
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


Contribution description
This provides support for the cache validation mechanism of CoAP for the
gcoap_forward_proxymodule ifnanocoap_cacheis also provided.Testing procedure
TBD procedurally, but could be easily done with an
aiocoapserver with ETag support, a RIOT client and a RIOT forward proxy inbetween the two. The client requests a resource via the proxy (the server delivers the data with an ETag), waits until the Max-Age (default 60 seconds) of the resource passed, then requests the (assumed to be unchanging) resource again. This should trigger the proxy to send a request with the resource's ETag to the server which in turn answers with a 2.03 Valid response. The proxy should then send the original cached response back (and update the cache entries Max-Age).Issues/PRs references
Requires #13889 and its dependencies.