<div dir="ltr">Hi,<div>I am seeing an alert in the nginx error.log with the message "http request count is zero". It seems to be from this code in src/http/ngx_http_request.c:</div><div><br></div><div><font face="monospace">if (r->count == 0) {<br>  ngx_log_error(NGX_LOG_ALERT, c->log, 0, "http request count is zero");<br>}<br></font></div><div><br></div><div>These alerts are showing up for requests that receive a NGX_HTTP_FORBIDDEN from my module. What does it mean when "r->count" is zero? Is there some additional stuff I must do in my module to avoid seeing this message? Any help in understanding the issue is appreciated. I've included  my code for sending the response. Thanks.</div><div><br></div><div>Regards,</div><div>Dk.</div><div><br></div><div><br></div><div>ngx_buf_t *buf = ngx_create_temp_buf(r->pool, buf_size);<br></div><div>...</div><div><font face="monospace">ngx_int_t<br>send_response(ngx_http_request_t *r, ngx_uint_t http_status, ngx_buf_t *buf)<br>{<br>  ngx_int_t rc;<br>  ngx_log_t *log = r->connection->log;<br><br>  if (NULL == buf) {<br>    ngx_log_error(NGX_LOG_ERR, log, 0, "%s: Invalid input buffer", __FUNCTION__);<br>    return NGX_ERROR;<br>  }<br><br>  rc = ngx_http_discard_request_body(r);<br>  if (rc != NGX_OK) {<br>    ngx_log_error(NGX_LOG_ERR, log, 0, "%s: Discard req. body failed. rc=%i", __FUNCTION__, rc);<br>    return rc;<br>  }<br><br>  r->err_status = http_status;<br>  r->headers_out.status = http_status;<br>  r->headers_out.content_length_n = buf->last - buf->pos;<br>  ngx_str_set(&r->headers_out.content_type, "text/plain");<br><br>  rc = ngx_http_send_header(r);<br><br>  if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {<br>    ngx_log_error(NGX_LOG_ERR, log, 0, "%s: Send header failed. rc=%i", __FUNCTION__, rc);<br>    return rc;<br>  }<br></font></div><div><font face="monospace"><br></font></div><div><font face="monospace">  ngx_chain_t *out_chain = ngx_alloc_chain_link(r->pool);<br>  if (NULL == out_chain) {<br>    ngx_log_error(NGX_LOG_ERR, log, 0, "%s: Buffer chain alloc failed", __FUNCTION__);<br>    return NGX_ERROR;<br>  }<br><br>  out_chain->buf = buf;<br>  out_chain->next = NULL;<br>  buf->last_buf = 1;<br>  buf->last_in_chain = 1;<br><br>  rc = ngx_http_output_filter(r, out_chain);<br>  if ((rc != NGX_OK) && (rc != NGX_AGAIN)) {<br>    ngx_log_error(NGX_LOG_ERR, log, 0, "%s: Output filter call failed. rc=%i", __FUNCTION__, rc);<br>    return NGX_ERROR;<br>  }<br><br>  return NGX_OK;<br>}</font><br></div></div>