-
Notifications
You must be signed in to change notification settings - Fork 2.1k
gcoap_forward_proxy: provide cache validation mechanism #17801
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
Conversation
bde1484
to
10d24b4
Compare
10d24b4
to
21fbacc
Compare
21fbacc
to
1435718
Compare
ce54fdc
to
ecabce6
Compare
ecabce6
to
24472a8
Compare
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
Addressed doxygen errors and squashed. |
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.
A few nits.
ccd7dff
to
9d4bb84
Compare
Squashed as requested off-line |
Mh... that indicates, that the proxy is not able to allocate another cep. Will have a look. |
fb9a11d fixes that. On validation, the client ep was previously not freed correctly 😅. Good catch! |
Alright, I can't reproduce this error anymore with your fix. Looks good! Please squash. |
fb9a11d
to
73bcd83
Compare
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.
ACK
Contribution description
This provides support for the cache validation mechanism of CoAP for the
gcoap_forward_proxy
module ifnanocoap_cache
is also provided.Testing procedure
TBD procedurally, but could be easily done with an
aiocoap
server 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.