<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Menlo;
panose-1:2 11 6 9 3 8 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
p.p1, li.p1, div.p1
{mso-style-name:p1;
margin:0cm;
font-size:8.5pt;
font-family:Menlo;
color:black;}
span.s1
{mso-style-name:s1;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="en-IL" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi. <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Nginx 1.23.2<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:white"><span lang="EN-US" style="color:black">The cpi
</span><span style="font-size:9.0pt;font-family:Menlo;color:#74531F">ngx_http_write_filter</span><span style="font-size:9.0pt;font-family:Menlo;color:black">(</span><span style="font-size:9.0pt;font-family:Menlo;color:#2B91AF">ngx_http_request_t</span><span style="font-size:9.0pt;font-family:Menlo;color:black">
*</span><span style="font-size:9.0pt;font-family:Menlo;color:gray">r</span><span style="font-size:9.0pt;font-family:Menlo;color:black">,
</span><span style="font-size:9.0pt;font-family:Menlo;color:#2B91AF">ngx_chain_t</span><span style="font-size:9.0pt;font-family:Menlo;color:black"> *</span><span style="font-size:9.0pt;font-family:Menlo;color:gray">in</span><span style="font-size:9.0pt;font-family:Menlo;color:black">)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:white"><span style="font-size:9.0pt;font-family:Menlo;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">Loop over the request out buffers and in chain<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">If calculate size of combined buffer to write.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I add body replacement on chain. <o:p>
</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">It have value, but </span><span style="font-size:9.0pt;font-family:Menlo;color:#8A1BFF">ngx_buf_size</span><span style="font-size:9.0pt;font-family:Menlo;color:black">(</span><span style="font-size:9.0pt;font-family:Menlo;color:#1F377F">cl</span><span style="font-size:9.0pt;font-family:Menlo;color:black">->buf);</span><span lang="EN-US" style="font-size:9.0pt;font-family:Menlo;color:black">
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:Menlo;color:black">Return it have 0. Size.</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:white"><span lang="EN-US" style="font-size:9.0pt;font-family:Menlo;color:#1F377F">(</span><span style="font-size:9.0pt;font-family:Menlo;color:#1F377F">l</span><span style="font-size:9.0pt;font-family:Menlo;color:black">->buf->last
- </span><span style="font-size:9.0pt;font-family:Menlo;color:#1F377F">cl</span><span style="font-size:9.0pt;font-family:Menlo;color:black">->buf->pos</span><span lang="EN-US" style="font-size:9.0pt;font-family:Menlo;color:black">) give the correct size
<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">So the buffer not written.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Only the header part send back to client<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Any idea?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="p1"><span class="s1">023/06/21 10:45:31 [debug] 22962#22962: *3 write old buf t:1 f:0 00005600970D81E0, pos 00005600970D81E0, size: 179 file: 0, size: 0</span><o:p></o:p></p>
<p class="p1"><span class="s1">2023/06/21 10:45:31 [debug] 22962#22962: *3 write new buf t:0 f:0 00005600970D8098, pos 00005600970D8098, size: 247 file: 0, size: 0</span><o:p></o:p></p>
<p class="p1"><span class="s1">2023/06/21 10:45:31 [debug] 22962#22962: *3 http write filter: l:1 f:0 s:179</span><o:p></o:p></p>
<p class="p1"><span class="s1">2023/06/21 10:45:31 [debug] 22962#22962: *3 http write filter limit 2097152</span><o:p></o:p></p>
<p class="p1"><span class="s1">2023/06/21 10:45:31 [debug] 22962#22962: *3 writev: 179 of 179</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>