Mercurial > hg > nginx-quic
annotate src/os/unix/ngx_dlopen.h @ 6428:545b5e4d83b2
Upstream: avoid closing client connection in edge case.
If proxy_cache is enabled, and proxy_no_cache tests true, it was previously
possible for the client connection to be closed after a 304. The fix is to
recheck r->header_only after the final cacheability is determined, and end the
request if no longer cacheable.
Example configuration:
proxy_cache foo;
proxy_cache_bypass 1;
proxy_no_cache 1;
If a client sends If-None-Match, and the upstream server returns 200 with a
matching ETag, no body should be returned to the client. At the start of
ngx_http_upstream_send_response proxy_no_cache is not yet tested, thus cacheable
is still 1 and downstream_error is set.
However, by the time the downstream_error check is done in process_request,
proxy_no_cache has been tested and cacheable is set to 0. The client connection
is then closed, regardless of keepalive.
author | Justin Li <jli.justinli@gmail.com> |
---|---|
date | Tue, 08 Mar 2016 22:31:55 -0500 |
parents | 7142b04337d6 |
children |
rev | line source |
---|---|
6380
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
1 |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
2 /* |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
3 * Copyright (C) Maxim Dounin |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
4 * Copyright (C) Nginx, Inc. |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
5 */ |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
6 |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
7 |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
8 #ifndef _NGX_DLOPEN_H_INCLUDED_ |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
9 #define _NGX_DLOPEN_H_INCLUDED_ |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
10 |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
11 |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
12 #include <ngx_config.h> |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
13 #include <ngx_core.h> |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
14 |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
15 |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
16 #define ngx_dlopen(path) dlopen((char *) path, RTLD_NOW | RTLD_GLOBAL) |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
17 #define ngx_dlopen_n "dlopen()" |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
18 |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
19 #define ngx_dlsym(handle, symbol) dlsym(handle, symbol) |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
20 #define ngx_dlsym_n "dlsym()" |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
21 |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
22 #define ngx_dlclose(handle) dlclose(handle) |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
23 #define ngx_dlclose_n "dlclose()" |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
24 |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
25 |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
26 #if (NGX_HAVE_DLOPEN) |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
27 char *ngx_dlerror(void); |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
28 #endif |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
29 |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
30 |
7142b04337d6
Dynamic modules: dlopen() support.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
31 #endif /* _NGX_DLOPEN_H_INCLUDED_ */ |