mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-16 19:20:30 +00:00
Made behavior of mg_get_cookie(..) on errors the same as mg_get_var(..). Separated the two cases a.) problems with destination buffer and b.) cookie header or cookie parameter not existing.
This commit is contained in:
1 parent
ca9212c3ca
commit
8faf6f7b72
2 files changed
+31
-26
No files matched your search
+3
-3
@@ -308,9 +308,9 @@ int mg_get_var(const char *data, size_t data_len,
|
||||
//
|
||||
// Return:
|
||||
// On success, value length.
|
||||
// On error, -1 (either "Cookie:" header is not present at all, or the
|
||||
// requested parameter is not found, or destination buffer is too small
|
||||
// to hold the value).
|
||||
// On error:
|
||||
// -1 (either "Cookie:" header is not present at all or the requested parameter is not found).
|
||||
// -2 (destination buffer is NULL, zero length or too small to hold the value).
|
||||
int mg_get_cookie(const struct mg_connection *,
|
||||
const char *cookie_name, char *buf, size_t buf_len);
|
||||
|
||||
|
||||
Reference in new issue
Block a user