-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add dso module #24
add dso module #24
Conversation
…hub.com/taobao/tengine/pull/1). 2 refactor some code.
add test scripts for dso module.
|| (path->len == old_dl_m[i].path.len | ||
&& ngx_strncmp(path->data, old_dl_m[i].path.data, old_dl_m[i].path.len) == 0)) | ||
{ | ||
return NGX_DECLINED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果更改了动态模块的代码, 期望通过reload来生效, 这里是否会导致总是使用旧的代码?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是有意这么做的,如果更换了so文件,那么需要重启nginx。
原因是这样子的:
reload的时候,我无法卸载老的已经加载的dso模块,因为linux下dloepn打开都是有引用计数的。而不卸载老的加载的模块,就无法强制加载新的dso模块。
不过我确实应该文档里面注明的,明天我会修改下文档。
谢谢!
看了一下 diff 有几点疑问, 不知是否存在 ~
|
1 如果更改了so,那么需要重启nginx才能生效。 谢谢。 |
} | ||
} else { | ||
if (dcf->path.data[0] != '/') { | ||
return NGX_ERROR; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在解析 dso_path 命令的时候没有要求必须是绝对路径, 这里缺少提示信息, -t fail 后用户不知道什么情况
|
2 modify the directives of dso. 3 fix some bug.
1 不支持reload加载修改的dso模块原因是这样子的, 如果你要重新加载新的dso,那么你必须dlclose老的handle,而如果你dlclose老的handle的话,当新的so加载失败的时候,此时就回不去原来的状态了。 2 剩下的两个问题,我这个新版本已经解决了。 谢谢! |
|
||
if (cycle != ngx_cycle) { | ||
|
||
if (cycle->old_cycle->conf_ctx) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该是清理 cycle ?
2 fix bug of dso cleanup
2 modify load directives.
static char * | ||
ngx_dso_stub(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | ||
{ | ||
ngx_str_t *value, *module_name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
module_name -> module
if [ $NGX_DSO != YES ]; then | ||
cat << END | ||
|
||
you should enable the dso module, if you want to use a dynamic loaded module. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dynamic -> dynamically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should enable dso, if you ...
HTTP_STUB_STATUS=NO | ||
HTTP_STUB_STATUS=YES | ||
|
||
#shared module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shared modules
It looks good to me. |
1 similar comment
It looks good to me. |
will commit a new pull request. |
add dso module