Mercurial > hg > nginx-quic
annotate src/os/unix/ngx_sunpro_x86.il @ 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 | d620f497c50f |
children | 2cd019520210 |
rev | line source |
---|---|
561 | 1 / |
2 / Copyright (C) Igor Sysoev | |
4412 | 3 / Copyright (C) Nginx, Inc. |
561 | 4 / |
5 | |
6 / ngx_atomic_uint_t ngx_atomic_cmp_set(ngx_atomic_t *lock, | |
7 / ngx_atomic_uint_t old, ngx_atomic_uint_t set); | |
8 / | |
2818
7e02df612521
preserve Solaris binary hardware capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
1309
diff
changeset
|
9 / the arguments are passed on stack (%esp), 4(%esp), 8(%esp) |
561 | 10 |
11 .inline ngx_atomic_cmp_set,0 | |
12 movl (%esp), %ecx | |
13 movl 4(%esp), %eax | |
14 movl 8(%esp), %edx | |
15 lock | |
16 cmpxchgl %edx, (%ecx) | |
17 setz %al | |
18 movzbl %al, %eax | |
19 .end | |
20 | |
21 | |
22 / ngx_atomic_int_t ngx_atomic_fetch_add(ngx_atomic_t *value, | |
23 / ngx_atomic_int_t add); | |
24 / | |
2818
7e02df612521
preserve Solaris binary hardware capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
1309
diff
changeset
|
25 / the arguments are passed on stack (%esp), 4(%esp) |
561 | 26 |
27 .inline ngx_atomic_fetch_add,0 | |
28 movl (%esp), %ecx | |
29 movl 4(%esp), %eax | |
30 lock | |
31 xaddl %eax, (%ecx) | |
32 .end | |
1309 | 33 |
34 | |
35 / ngx_cpu_pause() | |
2818
7e02df612521
preserve Solaris binary hardware capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
1309
diff
changeset
|
36 / |
7e02df612521
preserve Solaris binary hardware capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
1309
diff
changeset
|
37 / the "rep; nop" is used instead of "pause" to avoid the "[ PAUSE ]" hardware |
7e02df612521
preserve Solaris binary hardware capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
1309
diff
changeset
|
38 / capability added by linker because Solaris/i386 does not know about it: |
7e02df612521
preserve Solaris binary hardware capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
1309
diff
changeset
|
39 / |
7e02df612521
preserve Solaris binary hardware capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
1309
diff
changeset
|
40 / ld.so.1: nginx: fatal: hardware capability unsupported: 0x2000 [ PAUSE ] |
1309 | 41 |
42 .inline ngx_cpu_pause,0 | |
2818
7e02df612521
preserve Solaris binary hardware capabilities
Igor Sysoev <igor@sysoev.ru>
parents:
1309
diff
changeset
|
43 rep; nop |
1309 | 44 .end |