~ubuntu-branches/ubuntu/quantal/nginx/quantal-updates

« back to all changes in this revision

Viewing changes to src/event/ngx_event_pipe.c

  • Committer: Package Import Robot
  • Author(s): Kartik Mistry, Kartik Mistry
  • Date: 2011-09-26 10:17:04 UTC
  • mfrom: (4.2.38 sid)
  • Revision ID: package-import@ubuntu.com-20110926101704-x8pxngiujrmkxnn3
Tags: 1.1.4-2
[Kartik Mistry]
* debian/modules:
  + Updated nginx-upload-progress module, Thanks to upstream for fixing issue
    that FTBFS nginx on kFreeBSD-* archs.
  + Updated nginx-lua module to latest upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
                && p->upstream->read->pending_eof)
150
150
            {
151
151
                p->upstream->read->ready = 0;
152
 
                p->upstream->read->eof = 0;
 
152
                p->upstream->read->eof = 1;
153
153
                p->upstream_eof = 1;
154
154
                p->read = 1;
155
155
 
392
392
                       cl->buf->file_last - cl->buf->file_pos);
393
393
    }
394
394
 
 
395
    ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0,
 
396
                   "pipe length: %O", p->length);
 
397
 
395
398
#endif
396
399
 
 
400
    if (p->free_raw_bufs && p->length != -1) {
 
401
        cl = p->free_raw_bufs;
 
402
 
 
403
        if (cl->buf->last - cl->buf->pos >= p->length) {
 
404
 
 
405
            /* STUB */ cl->buf->num = p->num++;
 
406
 
 
407
            if (p->input_filter(p, cl->buf) == NGX_ERROR) {
 
408
                 return NGX_ABORT;
 
409
            }
 
410
 
 
411
            p->free_raw_bufs = cl->next;
 
412
            ngx_free_chain(p->pool, cl);
 
413
        }
 
414
    }
 
415
 
 
416
    if (p->length == 0) {
 
417
        p->upstream_done = 1;
 
418
        p->read = 1;
 
419
    }
 
420
 
397
421
    if ((p->upstream_eof || p->upstream_error) && p->free_raw_bufs) {
398
422
 
399
423
        /* STUB */ p->free_raw_bufs->buf->num = p->num++;
633
657
 
634
658
        rc = p->output_filter(p->output_ctx, out);
635
659
 
 
660
        ngx_chain_update_chains(p->pool, &p->free, &p->busy, &out, p->tag);
 
661
 
636
662
        if (rc == NGX_ERROR) {
637
663
            p->downstream_error = 1;
638
664
            return ngx_event_pipe_drain_chains(p);
639
665
        }
640
666
 
641
 
        ngx_chain_update_chains(&p->free, &p->busy, &out, p->tag);
642
 
 
643
667
        for (cl = p->free; cl; cl = cl->next) {
644
668
 
645
669
            if (cl->buf->temp_file) {
848
872
    }
849
873
    p->last_in = &cl->next;
850
874
 
 
875
    if (p->length == -1) {
 
876
        return NGX_OK;
 
877
    }
 
878
 
 
879
    p->length -= b->last - b->pos;
 
880
 
851
881
    return NGX_OK;
852
882
}
853
883