Skip to content

feature: exposed ngx_http_lua_ffi_str_t for other Nginx modules.#1273

Closed
spacewander wants to merge 1 commit into
openresty:masterfrom
spacewander:expose_ffi_ngx_str_t
Closed

feature: exposed ngx_http_lua_ffi_str_t for other Nginx modules.#1273
spacewander wants to merge 1 commit into
openresty:masterfrom
spacewander:expose_ffi_ngx_str_t

Conversation

@spacewander
Copy link
Copy Markdown
Member

I hereby granted the copyright of the changes in this pull request
to the authors of this lua-nginx-module project.

#include <lua.h>
#include <stdint.h>

#include "ngx_http_lua_api_common.h"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's wrong to include common.h in api.h since it exposes all ngx_lua's internal types and symbols, which is not desired.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agentzh
No, ngx_http_lua_api_common.h is not ngx_http_lua_common.h.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spacewander Why introduce this new common.h file? It's confusing ;) Let's simply put everything inside this api.h. This file is small anyway.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agentzh
The ngx_http_lua_ffi_str_t is required inside of the lua-nginx-module too. Put it into api.h will require the other headers to include the public API header. I think it could be more flexible by adding a middle layer.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spacewander Hmm, I disagree here. Internally we should use ngx_str_t directly.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@agentzh
ngx_http_lua_ffi_str_t is used in ngx_http_lua_util.h:
https://github.com/openresty/lua-nginx-module/blob/master/src/ngx_http_lua_util.h#L25

If we put ngx_http_lua_ffi_str_t into api.h, then we should include the public API header into the internal utility header, which is strange.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spacewander I don't want that api_common.h file. It's horrible and confusing. You can include the whole api.h file if necessary. I don't mind.

#include <lua.h>
#include <stdint.h>

#include "ngx_http_lua_api_common.h"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spacewander Why introduce this new common.h file? It's confusing ;) Let's simply put everything inside this api.h. This file is small anyway.

@agentzh
Copy link
Copy Markdown
Member

agentzh commented Mar 27, 2018

@spacewander Committed 809192c instead. Thanks!

@agentzh agentzh closed this Mar 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants