how can i get a complete proxy content?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

how can i get a complete proxy content?

pf shineyear
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?
Reply | Threaded
Open this post in threaded view
|

Re: how can i get a complete proxy content?

Maxim Dounin
Hello!

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

> 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?

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 Dounin

Reply | Threaded
Open this post in threaded view
|

Re: how can i get a complete proxy content?

pf shineyear
how can i get it all?? please ~~

On Mon, Mar 16, 2009 at 10:34 PM, Maxim Dounin <[hidden email]> wrote:
Hello!

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

> 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?

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 Dounin


Reply | Threaded
Open this post in threaded view
|

Re: how can i get a complete proxy content?

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

On Mon, Mar 16, 2009 at 10:56 PM, pf shineyear <[hidden email]> wrote:
how can i get it all?? please ~~


On Mon, Mar 16, 2009 at 10:34 PM, Maxim Dounin <[hidden email]> wrote:
Hello!

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

> 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?

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 Dounin



Reply | Threaded
Open this post in threaded view
|

Re: how can i get a complete proxy content?

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

On Tue, Mar 17, 2009 at 12:36 AM, pf shineyear <[hidden email]> wrote:
can u give me some example that can help me to cellect all proxy backend content in body filter?


On Mon, Mar 16, 2009 at 10:56 PM, pf shineyear <[hidden email]> wrote:
how can i get it all?? please ~~


On Mon, Mar 16, 2009 at 10:34 PM, Maxim Dounin <[hidden email]> wrote:
Hello!

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

> 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?

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 Dounin