8000 collection: generate ordered uris for crated resources by Danielius1922 · Pull Request #169 · iotivity/iotivity-lite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

collection: generate ordered uris for crated resources #169

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

Merged
merged 5 commits into from
Jan 17, 2022

Conversation

Danielius1922
Copy link
Member

No description provided.

@Danielius1922 Danielius1922 force-pushed the adam/feature/collection-href branch from 712625b to f61fa23 Compare December 15, 2021 10:14
@Danielius1922 Danielius1922 force-pushed the adam/feature/collection-href branch from 1128663 to 67fb89f Compare December 15, 2021 21:43
@Danielius1922 Danielius1922 marked this pull request as ready for review December 15, 2021 21:44
@Danielius1922 Danielius1922 force-pushed the adam/feature/collection-href branch 2 times, most recently from 3fef8bb to d470a4f Compare December 15, 2021 22:02
@jkralik jkralik requested a review from WAvdBeek December 16, 2021 07:59
For created resources in the collection create uris with
the format "${collection uri}/{index}", where index is the
lowest numerical value not used by some other resource
in the collection.
If such uri cannot be used then fallback to the original
randomly generated uri.
Each collections keeps a list of owned resources (links).
Default uri for a resource in a collection is in the format
"${collection uri}/${index}", where index is a unique
integer value.

When a new resource is generated a unique index value
must be found. We also want index to be the lowest
possible value. For an unordered list this would require
an O(n^2) algorithm.
To enable the use of an O(n) algorithm we keep the list
with links ordered primarily by uri length and secondarily
by uri value.
Use this header to add compiler specific code
without breaking compilation on all platforms.
Segfault occured with collections, create and resource
observations enabled. After adding cca 25 resources
the payload became so large that it was larger than
maximal allowed size (OC_MAX_APP_DATA_SIZE). However,
error handling was not done, so the -1 returned by
oc_rep_get_encoded_payload_size was casted to size_t
and interpreted as payload size (4GB in this case).
@Danielius1922 Danielius1922 force-pushed the adam/feature/collection-href branch from d470a4f to f240ec7 Compare January 12, 2022 14:37
@WAvdBeek
Copy link
Contributor

will be merged on monday (17 Jan 2022 - afternoon) if the previous merge passes the CTT

@WAvdBeek WAvdBeek merged commit e0a2f40 into master Jan 17, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jan 17, 2022
@Danielius1922 Danielius1922 deleted the adam/feature/collection-href branch September 8, 2022 10:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot identify to which oc_collection a newly created dynamic resource belongs during creation
4 participants
0