139
static bool check_gmt_end(const char *s)
144
while (isspace(*s)) {
148
/* check for correct timezone */
149
if ((strncmp(s, "GMT", 3) != 0) &&
150
(strncmp(s, "UTC", 3) != 0)) {
156
while (isspace(*s)) {
139
165
static bool parse_rfc850(const char *s, struct tm *t)
141
167
memset(t, 0, sizeof(*t));
142
return check_str_end(strptime(s, "%A, %d-%b-%y %H:%M:%S GMT", t));
168
return check_gmt_end(strptime(s, "%A, %d-%b-%y %H:%M:%S ", t));
145
171
static bool parse_asctime(const char *s, struct tm *t)
151
177
static bool parse_rfc1123(const char *s, struct tm *t)
153
179
memset(t, 0, sizeof(*t));
154
return check_str_end(strptime(s, "%a, %d %b %Y %H:%M:%S GMT", t));
180
return check_gmt_end(strptime(s, "%a, %d %b %Y %H:%M:%S ", t));
157
183
static bool parse_rfc1123_alt(const char *s, struct tm *t)
294
320
NameVal nv(nameval);
295
321
int ret = nv.parse();
297
val_map[nv.get_name()] = nv.get_val();
323
string& name = nv.get_name();
324
string& val = nv.get_val();
299
if ((nv.get_name().compare("acl") == 0) ||
300
(nv.get_name().compare("location") == 0) ||
301
(nv.get_name().compare("uploads") == 0) ||
302
(nv.get_name().compare("partNumber") == 0) ||
303
(nv.get_name().compare("uploadId") == 0) ||
304
(nv.get_name().compare("versionid") == 0) ||
305
(nv.get_name().compare("torrent") == 0)) {
306
sub_resources[nv.get_name()] = nv.get_val();
327
if ((name.compare("acl") == 0) ||
328
(name.compare("location") == 0) ||
329
(name.compare("uploads") == 0) ||
330
(name.compare("partNumber") == 0) ||
331
(name.compare("uploadId") == 0) ||
332
(name.compare("versionId") == 0) ||
333
(name.compare("torrent") == 0)) {
334
sub_resources[name] = val;
335
} else if (name[0] == 'r') { // root of all evil
336
if ((name.compare("response-content-type") == 0) ||
337
(name.compare("response-content-language") == 0) ||
338
(name.compare("response-expires") == 0) ||
339
(name.compare("response-cache-control") == 0) ||
340
(name.compare("response-content-disposition") == 0) ||
341
(name.compare("response-content-encoding") == 0)) {
342
sub_resources[name] = val;
343
has_resp_modifier = true;
316
string& XMLArgs::get(string& name)
354
string& XMLArgs::get(string& name, bool *exists)
318
356
map<string, string>::iterator iter;
319
357
iter = val_map.find(name);
320
if (iter == val_map.end())
358
bool e = (iter != val_map.end());
325
string& XMLArgs::get(const char *name)
366
string& XMLArgs::get(const char *name, bool *exists)
369
return get(s, exists);
331
372
bool verify_bucket_permission(struct req_state *s, int perm)