Move callback return value checking into macro

event_stream
Ryan 15 years ago
parent efd801f410
commit 65c61e6eb8

@ -64,6 +64,10 @@ do { \
parser->FOR##_mark, \ parser->FOR##_mark, \
p - parser->FOR##_mark); \ p - parser->FOR##_mark); \
} \ } \
if (callback_return_value != 0) { \
parser->flags |= ERROR; \
return 0; \
} \
} \ } \
} while(0) } while(0)
@ -148,60 +152,36 @@ do { \
action header_field { action header_field {
CALLBACK(header_field); CALLBACK(header_field);
if (callback_return_value != 0) {
parser->flags |= ERROR;
return 0;
}
parser->header_field_mark = NULL; parser->header_field_mark = NULL;
parser->header_field_size = 0; parser->header_field_size = 0;
} }
action header_value { action header_value {
CALLBACK(header_value); CALLBACK(header_value);
if (callback_return_value != 0) {
parser->flags |= ERROR;
return 0;
}
parser->header_value_mark = NULL; parser->header_value_mark = NULL;
parser->header_value_size = 0; parser->header_value_size = 0;
} }
action request_uri { action request_uri {
CALLBACK(uri); CALLBACK(uri);
if (callback_return_value != 0) {
parser->flags |= ERROR;
return 0;
}
parser->uri_mark = NULL; parser->uri_mark = NULL;
parser->uri_size = 0; parser->uri_size = 0;
} }
action fragment { action fragment {
CALLBACK(fragment); CALLBACK(fragment);
if (callback_return_value != 0) {
parser->flags |= ERROR;
return 0;
}
parser->fragment_mark = NULL; parser->fragment_mark = NULL;
parser->fragment_size = 0; parser->fragment_size = 0;
} }
action query_string { action query_string {
CALLBACK(query_string); CALLBACK(query_string);
if (callback_return_value != 0) {
parser->flags |= ERROR;
return 0;
}
parser->query_string_mark = NULL; parser->query_string_mark = NULL;
parser->query_string_size = 0; parser->query_string_size = 0;
} }
action request_path { action request_path {
CALLBACK(path); CALLBACK(path);
if (callback_return_value != 0) {
parser->flags |= ERROR;
return 0;
}
parser->path_mark = NULL; parser->path_mark = NULL;
parser->path_size = 0; parser->path_size = 0;
} }

Loading…
Cancel
Save