Commit 590ca5d
sys/net/gcoap: get rid of API abuse
Calling `coap_get_token()` and `coap_get_token_length()` on an
(mostly) uninitialized `coap_pkt_t` did work so far due to
implementation details matching the expectations, but this is not
backed up by any API contract.
This fixes the API abuse by introducing and using a new API that does
read a token and token length from a CoAP over UDP packet out of a
buffer. This now provides the behavior expected by the caller and
commits to it via API contract.
Co-authored-by: mguetschow <mikolai.guetschow@tu-dresden.de>
Co-authored-by: benpicco <benpicco@googlemail.com>1 parent e62e388 commit 590ca5d
2 files changed
Lines changed: 28 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
| 358 | + | |
358 | 359 | | |
359 | 360 | | |
360 | 361 | | |
| |||
757 | 758 | | |
758 | 759 | | |
759 | 760 | | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
760 | 783 | | |
761 | 784 | | |
762 | 785 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
945 | 945 | | |
946 | 946 | | |
947 | 947 | | |
948 | | - | |
949 | | - | |
950 | | - | |
951 | | - | |
952 | 948 | | |
953 | 949 | | |
954 | 950 | | |
955 | 951 | | |
956 | 952 | | |
957 | 953 | | |
958 | | - | |
| 954 | + | |
959 | 955 | | |
960 | 956 | | |
961 | 957 | | |
| |||
972 | 968 | | |
973 | 969 | | |
974 | 970 | | |
975 | | - | |
976 | | - | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
977 | 974 | | |
978 | 975 | | |
979 | | - | |
| 976 | + | |
980 | 977 | | |
981 | 978 | | |
982 | 979 | | |
| |||
0 commit comments