Hello,<div><br></div><div>I&#39;m writing my first module (actually a copy from mod_strip with some simple modifications)</div><div><br></div><div>I have this simple function that for testing purposes should simply make a simple substitution of all chars to A. I used gdb and chain_link-&gt;buf-&gt;start indeed has all the  characters replaced with A. However the output in the end is the original file without any other modification. </div>
<div><br></div><div>Could someone shed some light on this mistery? </div><div><br></div><div>Thanks</div><div><br></div><div>AM</div><div><br></div><div><div>static ngx_int_t</div><div>ngx_http_strip_body_filter(ngx_http_request_t *r, ngx_chain_t *in)</div>
<div>{</div><div>    ngx_http_strip_ctx_t *ctx;</div><div>    ngx_chain_t          *chain_link;</div><div><br></div><div><br></div><div>    u_char *reader;</div><div>    u_char *writer;</div><div><br></div><div>    ngx_log_t   *log;</div>
<div><br></div><div>    log = r-&gt;connection-&gt;log;</div><div><br></div><div>    ngx_log_debug0(NGX_LOG_DEBUG_HTTP, log, 0, &quot;In strip strip body filter 1 &quot;);</div><div><br></div><div>    ctx = ngx_http_get_module_ctx(r, ngx_http_strip_filter_module);</div>
<div>    if (ctx == NULL) {</div><div>        ngx_log_debug0(NGX_LOG_DEBUG_HTTP, log, 0, &quot;In strip strip body filter 2 &quot;);</div><div>        return ngx_http_next_body_filter(r, in);</div><div>    }</div><div>    ngx_log_debug0(NGX_LOG_DEBUG_HTTP, log, 0, &quot;In strip strip body filter 3 &quot;);</div>
<div><br></div><div><br></div><div>    for (chain_link = in; chain_link; chain_link = chain_link-&gt;next) {</div><div>        for (writer = chain_link-&gt;buf-&gt;pos, reader = chain_link-&gt;buf-&gt;pos; reader &lt; chain_link-&gt;buf-&gt;last; reader++) {  </div>
<div>            ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, &quot;w: \&quot;%c\&quot;&quot;, *reader);</div><div><br></div><div>            *reader = &#39;A&#39; ;                  </div><div>            if (reader &lt; chain_link-&gt;buf-&gt;last)  </div>
<div>                        *writer++ = *reader;</div><div>        }</div><div>            ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, &quot;In strip_body_filter writer: \&quot;%s\&quot;&quot;, writer);</div><div><br></div>
<div>        chain_link-&gt;buf-&gt;last = writer;</div><div><br></div><div>    }                          </div><div><br></div><div>    return ngx_http_next_body_filter(r, in);</div><div>}</div></div><div><br></div>