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

« back to all changes in this revision

Viewing changes to src/http/modules/ngx_http_memcached_module.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:
344
344
 
345
345
        while (*p && *p++ != CR) { /* void */ }
346
346
 
347
 
        r->headers_out.content_length_n = ngx_atoof(len, p - len - 1);
348
 
        if (r->headers_out.content_length_n == -1) {
 
347
        u->headers_in.content_length_n = ngx_atoof(len, p - len - 1);
 
348
        if (u->headers_in.content_length_n == -1) {
349
349
            ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
350
350
                          "memcached sent invalid length in response \"%V\" "
351
351
                          "for key \"%V\"",
366
366
 
367
367
        u->headers_in.status_n = 404;
368
368
        u->state->status = 404;
 
369
        u->keepalive = 1;
369
370
 
370
371
        return NGX_OK;
371
372
    }
407
408
    u = ctx->request->upstream;
408
409
    b = &u->buffer;
409
410
 
410
 
    if (u->length == ctx->rest) {
 
411
    if (u->length == (ssize_t) ctx->rest) {
411
412
 
412
413
        if (ngx_strncmp(b->last,
413
414
                   ngx_http_memcached_end + NGX_HTTP_MEMCACHED_END - ctx->rest,
426
427
        u->length -= bytes;
427
428
        ctx->rest -= bytes;
428
429
 
 
430
        if (u->length == 0) {
 
431
            u->keepalive = 1;
 
432
        }
 
433
 
429
434
        return NGX_OK;
430
435
    }
431
436
 
463
468
    if (ngx_strncmp(last, ngx_http_memcached_end, b->last - last) != 0) {
464
469
        ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0,
465
470
                      "memcached sent invalid trailer");
 
471
 
 
472
        b->last = last;
 
473
        cl->buf->last = last;
 
474
        u->length = 0;
 
475
        ctx->rest = 0;
 
476
 
 
477
        return NGX_OK;
466
478
    }
467
479
 
468
480
    ctx->rest -= b->last - last;
470
482
    cl->buf->last = last;
471
483
    u->length = ctx->rest;
472
484
 
 
485
    if (u->length == 0) {
 
486
        u->keepalive = 1;
 
487
    }
 
488
 
473
489
    return NGX_OK;
474
490
}
475
491