Permalink
Browse files

bugfix: the dtrace static probes did not compile on non-Linux systems…

… like FreeBSD.
  • Loading branch information...
1 parent e64d60b commit e650dd11802dcd1e110dfe38bdb0f03d27f98a9f @agentzh agentzh committed Aug 22, 2012
Showing with 11 additions and 14 deletions.
  1. +5 −5 dtrace/ngx_lua_provider.d
  2. +1 −1 src/ngx_http_lua_api.c
  3. +1 −1 src/ngx_http_lua_common.h
  4. +2 −4 src/ngx_http_lua_conf.c
  5. +2 −3 src/ngx_http_lua_socket_tcp.c
View
@@ -1,9 +1,9 @@
provider nginx_lua {
/* lua_State *L */
- probe http__lua__register__preload__package(void *L, char *pkg);
+ probe http__lua__register__preload__package(void *L, u_char *pkg);
probe http__lua__req__socket__consume__preread(ngx_http_request_t *r,
- char *data, size_t len);
+ u_char *data, size_t len);
/* lua_State *parent, lua_State *child */
probe http__lua__user__coroutine__create(ngx_http_request_t *r,
@@ -15,15 +15,15 @@ provider nginx_lua {
/* ngx_http_lua_socket_tcp_upstream_t *u */
probe http__lua__socket__tcp__send__start(ngx_http_request_t *r,
- void *u, char *data, size_t len);
+ void *u, u_char *data, size_t len);
/* ngx_http_lua_socket_tcp_upstream_t *u */
probe http__lua__socket__tcp__receive__done(ngx_http_request_t *r,
- void *u, char *data, size_t len);
+ void *u, u_char *data, size_t len);
/* ngx_http_lua_socket_tcp_upstream_t *u */
probe http__lua__socket__tcp__setkeepalive__buf__unread(
- ngx_http_request_t *r, void *u, char *data, size_t len);
+ ngx_http_request_t *r, void *u, u_char *data, size_t len);
};
View
@@ -71,7 +71,7 @@ ngx_http_lua_add_package_preload(ngx_conf_t *cf, const char *package,
return NGX_ERROR;
}
- hook->package = package;
+ hook->package = (u_char *) package;
hook->loader = func;
return NGX_OK;
@@ -81,7 +81,7 @@ typedef ngx_int_t (*ngx_http_lua_conf_handler_pt)(ngx_log_t *log,
typedef struct {
- const char *package;
+ u_char *package;
lua_CFunction loader;
} ngx_http_lua_preload_hook_t;
View
@@ -250,12 +250,10 @@ ngx_http_lua_init_vm(ngx_conf_t *cf, ngx_http_lua_main_conf_t *lmcf)
for (i = 0; i < lmcf->preload_hooks->nelts; i++) {
- ngx_http_lua_probe_register_preload_package(L,
- (char *)
- hook[i].package);
+ ngx_http_lua_probe_register_preload_package(L, hook[i].package);
lua_pushcfunction(L, hook[i].loader);
- lua_setfield(L, -2, hook[i].package);
+ lua_setfield(L, -2, (char *) hook[i].package);
}
lua_pop(L, 2);
@@ -1366,7 +1366,6 @@ ngx_http_lua_socket_tcp_read(ngx_http_request_t *r,
}
ngx_http_lua_probe_req_socket_consume_preread(r,
- (char *)
r->header_in->pos,
size);
@@ -3516,7 +3515,7 @@ ngx_http_lua_socket_push_input_data(ngx_http_request_t *r,
if (!u->bufs_in) {
lua_pushliteral(L, "");
- ngx_http_lua_probe_socket_tcp_receive_done(r, u, "", 0);
+ ngx_http_lua_probe_socket_tcp_receive_done(r, u, (u_char *) "", 0);
return NGX_OK;
}
@@ -3542,7 +3541,7 @@ ngx_http_lua_socket_push_input_data(ngx_http_request_t *r,
if (size == 0) {
lua_pushliteral(L, "");
- ngx_http_lua_probe_socket_tcp_receive_done(r, u, "", 0);
+ ngx_http_lua_probe_socket_tcp_receive_done(r, u, (u_char *) "", 0);
goto done;
}

0 comments on commit e650dd1

Please sign in to comment.