Go to the documentation of this file.
32 #define TRACE_LEVEL HTTP_TRACE_LEVEL
60 for(i = 0; i <
length; i++)
73 if(isprint(
c) &&
c <= 126)
77 if(
c ==
' ' ||
c ==
'\t')
101 if((
m & charset) == 0)
127 if(pos == NULL || param == NULL)
138 separatorFound =
FALSE;
154 if(param->
name == NULL)
162 else if(
c ==
' ' ||
c ==
'\t' ||
c ==
',' ||
c ==
';')
166 else if(isalnum(
c) ||
osStrchr(
"!#$%&'*+-.^_`|~",
c) != NULL ||
c >= 128)
180 if(
c ==
'\0' ||
c ==
',' ||
c ==
';')
187 else if(
c ==
' ' ||
c ==
'\t')
195 separatorFound =
TRUE;
199 else if(isalnum(
c) ||
osStrchr(
"!#$%&'*+-.^_`|~",
c) != NULL ||
c >= 128)
209 else if(!separatorFound)
212 if(
c ==
'\0' ||
c ==
',' ||
c ==
';')
217 else if(
c ==
' ' ||
c ==
'\t')
224 separatorFound =
TRUE;
233 else if(isalnum(
c) ||
osStrchr(
"!#$%&'*+-.^_`|~",
c) != NULL ||
c >= 128)
246 else if(param->
value == NULL)
249 if(
c ==
'\0' ||
c ==
',' ||
c ==
';')
254 else if(
c ==
' ' ||
c ==
'\t')
264 else if(isalnum(
c) ||
osStrchr(
"!#$%&'*+-.^_`|~",
c) != NULL ||
c >= 128)
278 if(param->
value[0] ==
'\"')
308 else if(isprint(
c) ||
c ==
'\t' ||
c >= 128)
321 if(
c ==
'\0' ||
c ==
' ' ||
c ==
'\t' ||
c ==
',' ||
c ==
';')
328 else if(isalnum(
c) ||
osStrchr(
"!#$%&'*+-.^_`|~",
c) != NULL ||
c >= 128)
480 static const char_t hexDigit[16] =
482 '0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
483 '8',
'9',
'a',
'b',
'c',
'd',
'e',
'f'
487 for(i = inputLen - 1; i >= 0; i--)
490 output[i * 2 + 1] = hexDigit[input[i] & 0x0F];
492 output[i * 2] = hexDigit[(input[i] >> 4) & 0x0F];
496 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.