|
|
@ -23,8 +23,9 @@
|
|
|
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#include "http_parser.h"
|
|
|
|
#include "http_parser.h"
|
|
|
|
|
|
|
|
#ifndef NDEBUG
|
|
|
|
#include <assert.h>
|
|
|
|
# include <assert.h>
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
static int unhex[] = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
|
|
|
|
static int unhex[] = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
|
|
|
|
,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
|
|
|
|
,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
|
|
|
@ -44,7 +45,8 @@ static int unhex[] = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
|
|
|
|
#define CALLBACK(FOR) \
|
|
|
|
#define CALLBACK(FOR) \
|
|
|
|
if (parser->FOR##_mark && parser->on_##FOR) { \
|
|
|
|
if (parser->FOR##_mark && parser->on_##FOR) { \
|
|
|
|
callback_return_value = \
|
|
|
|
callback_return_value = \
|
|
|
|
parser->on_##FOR(parser, parser->FOR##_mark, p - parser->FOR##_mark); \
|
|
|
|
parser->on_##FOR(parser, parser->FOR##_mark, \
|
|
|
|
|
|
|
|
p - parser->FOR##_mark); \
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#define RESET_PARSER(parser) \
|
|
|
|
#define RESET_PARSER(parser) \
|
|
|
@ -225,7 +227,6 @@ do { \
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CRLF = "\r\n";
|
|
|
|
CRLF = "\r\n";
|
|
|
|
|
|
|
|
|
|
|
|
# character types
|
|
|
|
# character types
|
|
|
|