openresty / lua-resty-core

New FFI-based API for lua-nginx-module
811 stars 272 forks source link

bugfix: might get previous nextupdate value #466

Closed ssdr closed 6 months ago

ssdr commented 6 months 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 6 months ago

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

Appla commented 6 months ago

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

ssdr commented 6 months 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.