Skip to content

Commit e6f12e3

Browse files
committed
Added to readme and fixed a linter error
1 parent ca6df4f commit e6f12e3

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

README.markdown

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6827,7 +6827,7 @@ This feature was first introduced in the `v0.3.1rc22` release.
68276827
ngx.shared.DICT.get
68286828
-------------------
68296829

6830-
**syntax:** *value, flags = ngx.shared.DICT:get(key, flags?)*
6830+
**syntax:** *value, flags = ngx.shared.DICT:get(key)*
68316831

68326832
**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua**
68336833

@@ -6837,9 +6837,6 @@ In case of errors, `nil` and a string describing the error will be returned.
68376837

68386838
The value returned will have the original data type when they were inserted into the dictionary, for example, Lua booleans, numbers, or strings.
68396839

6840-
If flags is not nil, value will only be returned if flags do not match with shm.
6841-
A 3rd return argument will indicate if flags matched.
6842-
68436840
The first argument to this method must be the dictionary object itself, for example,
68446841

68456842
```lua
@@ -6869,11 +6866,11 @@ See also [ngx.shared.DICT](#ngxshareddict).
68696866
ngx.shared.DICT.get_stale
68706867
-------------------------
68716868

6872-
**syntax:** *value, flags, stale = ngx.shared.DICT:get_stale(key, flags?)*
6869+
**syntax:** *value, flags, stale = ngx.shared.DICT:get_stale(key)*
68736870

68746871
**context:** *set_by_lua*, rewrite_by_lua*, access_by_lua*, content_by_lua*, header_filter_by_lua*, body_filter_by_lua*, log_by_lua*, ngx.timer.*, balancer_by_lua*, ssl_certificate_by_lua*, ssl_session_fetch_by_lua*, ssl_session_store_by_lua*, ssl_client_hello_by_lua**
68756872

6876-
Similar to the [get](#ngxshareddictget) method but returns the value even if the key has already expired, and the `flags_match` will be the 4th return value.
6873+
Similar to the [get](#ngxshareddictget) method but returns the value even if the key has already expired.
68776874

68786875
Returns a 3rd value, `stale`, indicating whether the key has expired or not.
68796876

src/ngx_http_lua_shdict.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1613,7 +1613,7 @@ ngx_http_lua_ffi_shdict_get(ngx_shm_zone_t *zone, u_char *key,
16131613
return NGX_OK;
16141614
}
16151615

1616-
if (*user_flags_neq && *user_flags == (int)sd->user_flags) {
1616+
if (*user_flags_neq && *user_flags == (int) sd->user_flags) {
16171617
*is_stale = (rc == NGX_DONE);
16181618
*user_flags_neq = 0;
16191619
ngx_shmtx_unlock(&ctx->shpool->mutex);

0 commit comments

Comments
 (0)