Go to the documentation of this file.
32 #define TRACE_LEVEL HTTP_TRACE_LEVEL
59 for(i = 0; i <
length; i++)
72 if(isprint(
c) &&
c <= 126)
76 if(
c ==
' ' ||
c ==
'\t')
100 if((
m & charset) == 0)
126 if(pos == NULL || param == NULL)
137 separatorFound =
FALSE;
153 if(param->
name == NULL)
161 else if(
c ==
' ' ||
c ==
'\t' ||
c ==
',' ||
c ==
';')
165 else if(isalnum(
c) ||
osStrchr(
"!#$%&'*+-.^_`|~",
c) != NULL ||
c >= 128)
179 if(
c ==
'\0' ||
c ==
',' ||
c ==
';')
186 else if(
c ==
' ' ||
c ==
'\t')
194 separatorFound =
TRUE;
198 else if(isalnum(
c) ||
osStrchr(
"!#$%&'*+-.^_`|~",
c) != NULL ||
c >= 128)
208 else if(!separatorFound)
211 if(
c ==
'\0' ||
c ==
',' ||
c ==
';')
216 else if(
c ==
' ' ||
c ==
'\t')
223 separatorFound =
TRUE;
232 else if(isalnum(
c) ||
osStrchr(
"!#$%&'*+-.^_`|~",
c) != NULL ||
c >= 128)
245 else if(param->
value == NULL)
248 if(
c ==
'\0' ||
c ==
',' ||
c ==
';')
253 else if(
c ==
' ' ||
c ==
'\t')
263 else if(isalnum(
c) ||
osStrchr(
"!#$%&'*+-.^_`|~",
c) != NULL ||
c >= 128)
277 if(param->
value[0] ==
'\"')
307 else if(isprint(
c) ||
c ==
'\t' ||
c >= 128)
320 if(
c ==
'\0' ||
c ==
' ' ||
c ==
'\t' ||
c ==
',' ||
c ==
';')
327 else if(isalnum(
c) ||
osStrchr(
"!#$%&'*+-.^_`|~",
c) != NULL ||
c >= 128)
479 static const char_t hexDigit[16] =
481 '0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
482 '8',
'9',
'a',
'b',
'c',
'd',
'e',
'f'
486 for(i = inputLen - 1; i >= 0; i--)
489 output[i * 2 + 1] = hexDigit[input[i] & 0x0F];
491 output[i * 2] = hexDigit[(input[i] >> 4) & 0x0F];
495 output[inputLen * 2] =
'\0';
error_t httpCopyParamValue(const HttpParam *param, char_t *value, size_t maxLen)
Copy the value of a parameter.
void httpEncodeHexString(const uint8_t *input, size_t inputLen, char_t *output)
Convert byte array to hex string.
bool_t httpCompareParamName(const HttpParam *param, const char_t *name)
Compare parameter name with the supplied string.
bool_t httpCompareParamValue(const HttpParam *param, const char_t *value)
Compare parameter name with the supplied string.
@ ERROR_INVALID_PARAMETER
Invalid parameter.
#define osStrncasecmp(s1, s2, length)
#define osMemcpy(dest, src, length)
Definitions common to HTTP client and server.
error_t httpCheckCharset(const char_t *s, size_t length, uint_t charset)
Check whether a string contains valid characters.
error_t httpParseParam(const char_t **pos, HttpParam *param)
Parse a list of parameters.