Skip to content

Commit

Permalink
Convert php warning to swoole warning, add SW_ERROR_SERVER_INVALID_RE…
Browse files Browse the repository at this point in the history
…QUEST.
  • Loading branch information
twose committed Nov 20, 2018
1 parent 1f785b4 commit d043e9d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ enum swErrorCode
SW_ERROR_SERVER_TOO_MANY_LISTEN_PORT,
SW_ERROR_SERVER_PIPE_BUFFER_FULL,
SW_ERROR_SERVER_NO_IDLE_WORKER,

SW_ERROR_SERVER_ONLY_START_ONE,
SW_ERROR_SERVER_SEND_IN_MASTER,
SW_ERROR_SERVER_INVALID_REQUEST,

/**
* Process exit timeout, forced to end.
Expand Down
1 change: 1 addition & 0 deletions swoole.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,7 @@ PHP_MINIT_FUNCTION(swoole)
SWOOLE_DEFINE(ERROR_SERVER_NO_IDLE_WORKER);
SWOOLE_DEFINE(ERROR_SERVER_ONLY_START_ONE);
SWOOLE_DEFINE(ERROR_SERVER_SEND_IN_MASTER);
SWOOLE_DEFINE(ERROR_SERVER_INVALID_REQUEST);
SWOOLE_DEFINE(ERROR_SERVER_WORKER_EXIT_TIMEOUT);
SWOOLE_DEFINE(ERROR_CO_OUT_OF_COROUTINE);
SWOOLE_DEFINE(ERROR_CO_HAS_BEEN_BOUND);
Expand Down
2 changes: 1 addition & 1 deletion swoole_http_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ static int http_request_on_body(swoole_http_parser *parser, const char *at, size
size_t n = multipart_parser_execute(multipart_parser, c, length);
if (n != length)
{
swoole_php_fatal_error(E_WARNING, "parse multipart body failed, n=%zu.", n);
swoole_error_log(SW_LOG_WARNING, SW_ERROR_SERVER_INVALID_REQUEST, "parse multipart body failed, n=%zu.", n);
}
}

Expand Down
2 changes: 1 addition & 1 deletion swoole_http_v2_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ int swoole_http2_onFrame(swConnection *conn, swEventData *req)
size_t n = multipart_parser_execute(multipart_parser, buffer->str, buffer->length);
if (n != (size_t) length)
{
swoole_php_fatal_error(E_WARNING, "parse multipart body failed.");
swoole_error_log(SW_LOG_WARNING, SW_ERROR_SERVER_INVALID_REQUEST, "parse multipart body failed, n=%zu.", n);
}
}
http2_onRequest(ctx, from_fd);
Expand Down

0 comments on commit d043e9d

Please sign in to comment.