openresty / lua-resty-core

New FFI-based API for lua-nginx-module
792 stars 270 forks source link

bugfix: might get previous nextupdate value #466

Closed ssdr closed 1 month ago

ssdr commented 1 month ago

For the ocsp response without nextUpdate value, it will get the previous nextUpdate value which is cached in the module-level lua ffi variable, this is not what we expected.

Maybe we should use function-level local variable instead?

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

ssdr commented 1 month ago

commit related: https://github.com/openresty/lua-resty-core/commit/7a6521deb7a354fac9cb24cb477c144559ec3c06

Appla commented 1 month ago

How about resetting next_update_p by next_update_p[0] = 0 when next_update != 0 before return next_update?

ssdr commented 1 month ago

How about resetting next_update_p by next_update_p[0] = 0 when next_update != 0 before return next_update?

yes, it seems better.