Skip to content
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

documentation or implementation error: httpd_req_get_url_query_str (IDFGH-1052) #3374

Closed
dannybackx opened this issue Apr 27, 2019 · 1 comment

Comments

@dannybackx
Copy link

Environment

  • IDF version : 3.2

Problem Description

The documentation on httpd_req_get_url_query_str specifies how to deal with the buffer and buflen. Spefically :

  • If output size is greater than input, then the value is truncated, accompanied by truncation error as return value
  • Use httpd_req_get_url_query_len() to know the right buffer length

This is misleading. For meaningful results, you should not use the return value of httpd_req_get_url_query_len() but one more (to accomodate for the 0 terminator of the string).

The documentation should include such a remark. Note that the examples do take this into account, in a slightly strange way.

@github-actions github-actions bot changed the title documentation or implementation error: httpd_req_get_url_query_str documentation or implementation error: httpd_req_get_url_query_str (IDFGH-1052) Apr 27, 2019
@anurag-kar
Copy link
Contributor

@dannybackx Thanks for pointing out.

It should read

Use httpd_req_get_url_query_len() + 1 to know the right buffer length

or

Use httpd_req_get_url_query_len() to know the query string length

@igrr igrr closed this as completed in 5e1c19d May 9, 2019
igrr pushed a commit that referenced this issue Jun 20, 2019
igrr pushed a commit that referenced this issue Jun 21, 2019
trombik pushed a commit to trombik/esp-idf that referenced this issue Aug 9, 2019
loganfin pushed a commit to Lumenaries/esp_http_server that referenced this issue Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants