36 #define MAX_FIELD_NAME (32) 37 #define MAX_CONTENT_LENGTH (24) 82 char *sep =
"()<>@,;:\\\"/[]?={} \t";
86 while ((*data > 32) && (*data < 127) && (strchr(sep, *data) == NULL) &&
89 if (*data >=
'A' && *data <=
'Z')
92 name[nameLen] = *data -
'A' +
'a';
96 name[nameLen] = *
data;
105 if (nameLen == 14 && memcmp(name,
"content-length", 14) == 0)
109 else if (nameLen == 13 && memcmp(name,
"content-range", 13) == 0)
113 else if (nameLen == 12 && memcmp(name,
"content-type", 12) == 0)
117 else if (nameLen == 6 && memcmp(name,
"x-keys", 6) == 0)
121 else if (nameLen == 13 && memcmp(name,
"x-keylocation", 13) == 0)
125 else if (nameLen == 16 && memcmp(name,
"x-bytespersecond", 16) == 0)
131 while (*data ==
'\r' || *data ==
'\n' || *data ==
' ' || *data ==
'\t')
157 success = GetNextToken(&data, &token);
163 memcpy(buffer, token.
data, token.
len);
164 buffer[token.
len] =
'\0';
168 return contentLength;
187 success = GetNextToken(&data, &token);
190 success = GetNextToken(&data, &token);
194 success = GetNextToken(&data, &token);
198 success = GetNextToken(&data, &token);
202 success = GetNextToken(&data, &token);
206 success = GetNextToken(&data, &token);
210 success = GetNextToken(&data, &token);
221 memcpy(buffer, token.
data, token.
len);
222 buffer[token.
len] =
'\0';
229 return contentLength;
251 case '0':
case '1':
case '2':
case '3':
case '4':
252 case '5':
case '6':
case '7':
case '8':
case '9':
258 while (*p >=
'0' && *p <=
'9');
267 while (*p >=
'a' && *p <=
'z');
268 if (p - *data == 5 && memcmp(*data,
"bytes", 5) == 0)
U64BIT ULONG_Atoi(char *str)
Convert a string to unsigned 64 bit. Only the numeric part of the string is converted (up to the firs...
#define ULL_SetInvalid(variable)