diff --git a/config b/config index 87aa299c..8423d392 100644 --- a/config +++ b/config @@ -1,7 +1,6 @@ ngx_module_type=HTTP ngx_module_name=ngx_http_lua_kong_module ngx_module_srcs=" \ - $ngx_addon_dir/src/ngx_http_lua_kong_apple_m1.c \ $ngx_addon_dir/src/ngx_http_lua_kong_grpc.c \ $ngx_addon_dir/src/ngx_http_lua_kong_ssl.c \ $ngx_addon_dir/src/ngx_http_lua_kong_var.c \ diff --git a/src/ngx_http_lua_kong_apple_m1.c b/src/ngx_http_lua_kong_apple_m1.c deleted file mode 100644 index 35798b4b..00000000 --- a/src/ngx_http_lua_kong_apple_m1.c +++ /dev/null @@ -1,131 +0,0 @@ -/** - * Copyright 2019-2022 Kong Inc. - - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - - * http://www.apache.org/licenses/LICENSE-2.0 - - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#include "ngx_http_lua_kong_common.h" - - -// macOS with M1 fixes, see: https://github.com/LuaJIT/LuaJIT/issues/205 - -int ngx_http_lua_ffi_shdict_get(ngx_shm_zone_t *zone, const unsigned char *key, - size_t key_len, int *value_type, unsigned char **str_value_buf, - size_t *str_value_len, double *num_value, int *user_flags, - int get_stale, int *is_stale, char **errmsg); - -typedef struct { - ngx_shm_zone_t *zone; - const unsigned char *key; - size_t key_len; - int *value_type; - unsigned char **str_value_buf; - size_t *str_value_len; - double *num_value; - int *user_flags; - int get_stale; - int *is_stale; - char **errmsg; -} ngx_shdict_get_t; - -int -ngx_http_lua_ffi_shdict_get_m1(ngx_shdict_get_t *s) -{ - return ngx_http_lua_ffi_shdict_get(s->zone, s->key, s->key_len, s->value_type, - s->str_value_buf, s->str_value_len, s->num_value, s->user_flags, s->get_stale, - s->is_stale, s->errmsg); -} - - -int ngx_http_lua_ffi_shdict_store(ngx_shm_zone_t *zone, int op, - const unsigned char *key, size_t key_len, int value_type, - const unsigned char *str_value_buf, size_t str_value_len, - double num_value, long exptime, int user_flags, char **errmsg, - int *forcible); - -typedef struct { - ngx_shm_zone_t *zone; - int op; - const unsigned char *key; - size_t key_len; - int value_type; - const unsigned char *str_value_buf; - size_t str_value_len; - double num_value; - long exptime; - int user_flags; - char **errmsg; - int *forcible; -} ngx_shdict_store_t; - -int -ngx_http_lua_ffi_shdict_store_m1(ngx_shdict_store_t *s) -{ - return ngx_http_lua_ffi_shdict_store(s->zone, s->op, s->key, s->key_len, s->value_type, - s->str_value_buf, s->str_value_len, s->num_value, s->exptime, s->user_flags, s->errmsg, - s->forcible); -} - - -int ngx_http_lua_ffi_shdict_incr(ngx_shm_zone_t *zone, const unsigned char *key, - size_t key_len, double *num_value, char **errmsg, int has_init, - double init, long init_ttl, int *forcible); - -typedef struct { - ngx_shm_zone_t *zone; - const unsigned char *key; - size_t key_len; - double *num_value; - char **errmsg; - int has_init; - double init; - long init_ttl; - int *forcible; -} ngx_shdict_incr_t; - -int -ngx_http_lua_ffi_shdict_incr_m1(ngx_shdict_incr_t *s) -{ - return ngx_http_lua_ffi_shdict_incr(s->zone, s->key, s->key_len, s->num_value, - s->errmsg, s->has_init, s->init, s->init_ttl, s->forcible); -} - - -int ngx_http_lua_ffi_set_resp_header(ngx_http_request_t *r, - const char *key_data, size_t key_len, int is_nil, - const char *sval, size_t sval_len, void *mvals, - size_t mvals_len, int override, char **errmsg); - -typedef struct { - ngx_http_request_t *r; - const char *key_data; - size_t key_len; - int is_nil; - const char *sval; - size_t sval_len; - void *mvals; - size_t mvals_len; - int override; - char **errmsg; -} ngx_set_resp_header_t; - -int -ngx_http_lua_ffi_set_resp_header_m1(ngx_set_resp_header_t *s) -{ - return ngx_http_lua_ffi_set_resp_header(s->r, s->key_data, s->key_len, s->is_nil, - s->sval, s->sval_len, s->mvals, s->mvals_len, s->override, s->errmsg); -} - - -// macOS with M1 fixes end diff --git a/stream/src/ngx_stream_lua_kong_module.c b/stream/src/ngx_stream_lua_kong_module.c index 70b2e5ce..f6100d1f 100644 --- a/stream/src/ngx_stream_lua_kong_module.c +++ b/stream/src/ngx_stream_lua_kong_module.c @@ -297,33 +297,3 @@ ngx_stream_lua_kong_get_upstream_ssl_verify(ngx_stream_session_t *s, return ngx_lua_kong_ssl_get_upstream_ssl_verify(&ctx->ssl_ctx, proxy_ssl_verify); } #endif - - -// macOS with M1 fixes, see: https://github.com/LuaJIT/LuaJIT/issues/205 - -int -ngx_stream_lua_ffi_shdict_get_m1(ngx_shdict_get_t *s) -{ - return ngx_stream_lua_ffi_shdict_get(s->zone, s->key, s->key_len, s->value_type, - s->str_value_buf, s->str_value_len, s->num_value, s->user_flags, s->get_stale, - s->is_stale, s->errmsg); -} - - -int -ngx_stream_lua_ffi_shdict_store_m1(ngx_shdict_store_t *s) -{ - return ngx_stream_lua_ffi_shdict_store(s->zone, s->op, s->key, s->key_len, s->value_type, - s->str_value_buf, s->str_value_len, s->num_value, s->exptime, s->user_flags, s->errmsg, - s->forcible); -} - - -int -ngx_stream_lua_ffi_shdict_incr_m1(ngx_shdict_incr_t *s) -{ - return ngx_stream_lua_ffi_shdict_incr(s->zone, s->key, s->key_len, s->num_value, - s->errmsg, s->has_init, s->init, s->init_ttl, s->forcible); -} - -// macOS with M1 fixes end diff --git a/t/001-tls.t b/t/001-tls.t index 1c4141a2..7a582d13 100644 --- a/t/001-tls.t +++ b/t/001-tls.t @@ -415,8 +415,8 @@ qpvBFOY29Mlww88oWNGTA8QeW84Y1EJbRkHavzSsMFB73sxidQW0cHNC5t9RCKAQ uibeZgK1Yk7YQKXdvbZvXwrgTcAjCdbppw2L6e0Uy+OGgNjnIps8K460SdaIiA== -----END CERTIFICATE----- ---- error_log -[lua] ssl_certificate_by_lua:2: ssl cert by lua is running! +--- error_log eval +qr/ssl_certificate_by_lua.*ssl cert by lua is running!/ --- no_error_log [error]