You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typedefstruct {
str_array*vars;
constchar*path; // current path to dispatchintpath_len; // the length of the current pathintrequest_method; // current request methodvoid*data; // R3Route ptrchar*host; // the request hostinthost_len;
char*remote_addr;
intremote_addr_len;
} match_entry;
typedefstruct_str_array {
char**slugs;
intslugs_len;
char**tokens;
intlen;
intcap;
} str_array;
Access to slug names and it's values is through match_entry->vars.
Slug names are pointers to routers field slugs. They do not copy by value and do not create again.
The second point was not realized full. ...so we can iterate the slugs in the matched route - it is incorrect way to access slugs. Routes created only once and there is no need to change it in life time. Because slug values depend on every match path it is better to save that values in match_entry struct.
So iterate slugs with match_entry->vars.
The text was updated successfully, but these errors were encountered: