# How can i get a complete proxy content?

**URL:** <https://www.ruby-forum.com/t/how-can-i-get-a-complete-proxy-content/163004>\
**Category:** NGINX\
**Created:** [March 16, 2009, 3:12pm UTC](https://www.ruby-forum.com/t/how-can-i-get-a-complete-proxy-content/163004 "2009-03-16T15:12:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pf\_shineyear](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a6a055/32.png) [@pf\_shineyear](https://www.ruby-forum.com/u/pf_shineyear)\
**Post date:** [March 16, 2009, 3:12pm UTC](https://www.ruby-forum.com/t/how-can-i-get-a-complete-proxy-content/163004/1 "2009-03-16T15:12:25Z")

</div>

hi

i try to get a complete proxy content from a body filter like this:

struct ngx\_chain\_s \*tmp\_in = in;

while (tmp\_in)  
{  
len = tmp\_in-\>buf-\>last - tmp\_in-\>buf-\>pos;

```
if (len <= 0)
{
      if (tmp_in->next == NULL)break;

      tmp_in = tmp_in->next;
      continue;
}

// copy the buf to somewhere

if (tmp_in->next == NULL)
{
    break;
}

tmp_in = tmp_in->next;

```

}

if (tmp\_in-\>buf-\>last\_buf)  
{  
//end of the buf  
}

i set proxy\_buffering off; but when i want to get a more little bigger  
file  
about 200KB

i always got len \<= 0 buf , so can u tell me why ? and how to resolve  
that?

---

<div class="post-metadata">

**Author:** ![pf\_shineyear](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a6a055/32.png) [@pf\_shineyear](https://www.ruby-forum.com/u/pf_shineyear)\
**Post date:** [March 16, 2009, 3:41pm UTC](https://www.ruby-forum.com/t/how-can-i-get-a-complete-proxy-content/163004/2 "2009-03-16T15:41:48Z")

</div>

Hello!

On Mon, Mar 16, 2009 at 10:04:16PM +0800, pf shineyear wrote:

> ```
> if (len <= 0)
> if (tmp_in->next == NULL)
> //end of the buf
> 
> ```
> 
> }
> 
> i set proxy\_buffering off; but when i want to get a more little bigger file  
> about 200KB
> 
> i always got len \<= 0 buf , so can u tell me why ? and how to resolve that?

Buffers with (last - pos) \<= 0 are prefectly normal, as there is  
much more than simple buffers with content in memory. This  
include various special buffers and buffers with content in files.

Maxim D.

---

<div class="post-metadata">

**Author:** ![pf\_shineyear](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a6a055/32.png) [@pf\_shineyear](https://www.ruby-forum.com/u/pf_shineyear)\
**Post date:** [March 16, 2009, 5:44pm UTC](https://www.ruby-forum.com/t/how-can-i-get-a-complete-proxy-content/163004/3 "2009-03-16T17:44:41Z")

</div>

can u give me some example that can help me to cellect all proxy backend  
content in body filter?

---

<div class="post-metadata">

**Author:** ![pf\_shineyear](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a6a055/32.png) [@pf\_shineyear](https://www.ruby-forum.com/u/pf_shineyear)\
**Post date:** [March 16, 2009, 4:10pm UTC](https://www.ruby-forum.com/t/how-can-i-get-a-complete-proxy-content/163004/4 "2009-03-16T16:10:36Z")

</div>

how can i get it all?? please ~~

---

<div class="post-metadata">

**Author:** ![pf\_shineyear](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a6a055/32.png) [@pf\_shineyear](https://www.ruby-forum.com/u/pf_shineyear)\
**Post date:** [March 17, 2009, 8:52am UTC](https://www.ruby-forum.com/t/how-can-i-get-a-complete-proxy-content/163004/5 "2009-03-17T08:52:04Z")

</div>

is there any body can help me ?~?~?~
