<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Hello!</div>
<div class="moz-cite-prefix"><br>
</div>
<blockquote type="cite"
cite="mid:CANN+EMqPtvwUycUvVd3O7R=cgvELV4KLp7JwWOqj2KpKaFHnZw@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Thanks for sharing patches. It's interesting for me and I'm
going to test it soon.</div>
</div>
</blockquote>
<p>Did you already had some time to test it? I am interested in you
thoughts and results :)<br>
<br>
</p>
<blockquote type="cite"
cite="mid:CANN+EMqPtvwUycUvVd3O7R=cgvELV4KLp7JwWOqj2KpKaFHnZw@mail.gmail.com">
<div dir="ltr">
<div>For this particular patch I would suggest to reduce the
scope of mutex locking</div>
<div>and remove it when "serve_tempfile" is not configured. See
my version below:</div>
<div><span style="font-family:monospace"><span
style="font-weight:bold;color:rgb(0,0,0);background-color:rgb(255,255,255)">diff
--git a/src/http/ngx_http_file_cache.c
b/src/http/ngx_http_file_cache.c</span><span
style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br>
<span
style="font-weight:bold;color:rgb(0,0,0);background-color:rgb(255,255,255)">index
db379450..97982aed 100644</span><span
style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br>
<span
style="font-weight:bold;color:rgb(0,0,0);background-color:rgb(255,255,255)">---
a/src/http/ngx_http_file_cache.c</span><span
style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br>
<span
style="font-weight:bold;color:rgb(0,0,0);background-color:rgb(255,255,255)">+++
b/src/http/ngx_http_file_cache.c</span><span
style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br>
<span
style="color:rgb(24,178,178);background-color:rgb(255,255,255)">@@
-460,6 +460,22 @@</span><span
style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
ngx_http_file_cache_open(ngx_http_request_t *r)
</span><br>
goto done;
<br>
}
<br>
<br>
<span
style="color:rgb(24,178,24);background-color:rgb(255,255,255)">+
if (c->serve_tempfile) {</span><span
style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br>
<span
style="color:rgb(24,178,24);background-color:rgb(255,255,255)">+
ngx_shmtx_lock(&cache->shpool->mutex);</span><span
style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br>
<span
style="color:rgb(24,178,24);background-color:rgb(255,255,255)">+</span><span
style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br>
<span
style="color:rgb(24,178,24);background-color:rgb(255,255,255)">+
if (c->node->updating) {</span><span
style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br>
<span
style="color:rgb(24,178,24);background-color:rgb(255,255,255)">+
/* Do not try old cached file, jump directly to
cache_lock and use tempfile */</span><span
style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br>
<span
style="color:rgb(24,178,24);background-color:rgb(255,255,255)">+
test = 0;</span><span
style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br>
<span
style="color:rgb(24,178,24);background-color:rgb(255,255,255)">+
}</span><span
style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br>
<span
style="color:rgb(24,178,24);background-color:rgb(255,255,255)">+</span><span
style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br>
<span
style="color:rgb(24,178,24);background-color:rgb(255,255,255)">+
ngx_shmtx_unlock(&cache->shpool->mutex);</span><span
style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br>
<span
style="color:rgb(24,178,24);background-color:rgb(255,255,255)">+</span><span
style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br>
<span
style="color:rgb(24,178,24);background-color:rgb(255,255,255)">+
if (!test) {</span><span
style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br>
<span
style="color:rgb(24,178,24);background-color:rgb(255,255,255)">+
rv = NGX_DECLINED;</span><span
style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br>
<span
style="color:rgb(24,178,24);background-color:rgb(255,255,255)">+
goto done;</span><span
style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br>
<span
style="color:rgb(24,178,24);background-color:rgb(255,255,255)">+
}</span><span
style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br>
<span
style="color:rgb(24,178,24);background-color:rgb(255,255,255)">+
}</span><span
style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br>
<span
style="color:rgb(24,178,24);background-color:rgb(255,255,255)">+</span><span
style="color:rgb(0,0,0);background-color:rgb(255,255,255)">
</span><br>
rc = ngx_http_file_cache_open_file(r, &c-><a
href="http://file.name" moz-do-not-send="true">file.name</a>);
<br>
if (rc != NGX_DECLINED) {
<br>
return rc;<br>
</span></div>
</div>
</blockquote>
<p><br>
Yes, this is of course better, thank you.</p>
<p>Jiří Setnička<br>
</p>
</body>
</html>