Skip to content

Commit

Permalink
small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadim Sadokhov committed Oct 17, 2023
1 parent f884297 commit 87dc60d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion runtime/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1799,7 +1799,7 @@ static void init_superglobals_impl(const http_query_data &http_data, const rpc_q
}

static http_query_data empty_http_data;
static rpc_query_data empty_rpc_data{tl_query_header_t(), {}, {}};
static rpc_query_data empty_rpc_data;
static job_query_data empty_job_data;

void init_superglobals(const php_query_data_t &data) {
Expand Down
4 changes: 2 additions & 2 deletions server/php-engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ int rpcx_execute(connection *c, int op, raw_message *raw) {
int64_t left_bytes_without_headers = tl_fetch_unread();

len -= (left_bytes_with_headers - left_bytes_without_headers);
assert(len % 4 == 0);
assert(len % sizeof(int) == 0);

long long req_id = header.qid;

Expand All @@ -1009,7 +1009,7 @@ int rpcx_execute(connection *c, int op, raw_message *raw) {
double actual_script_timeout = custom_settings.has_timeout() ? normalize_script_timeout(custom_settings.php_timeout_ms / 1000.0) : script_timeout;
set_connection_timeout(c, actual_script_timeout);

std::vector<int> buffer((len + sizeof(int)) / sizeof(int));
std::vector<int> buffer(len / sizeof(int));
auto fetched_bytes = tl_fetch_data(buffer.data(), len);
if (fetched_bytes == -1) {
client_rpc_error(c, req_id, tl_fetch_error_code(), tl_fetch_error_string());
Expand Down

0 comments on commit 87dc60d

Please sign in to comment.