Project

General

Profile

lighttpd-fastcgi.patch

Patch to process large fastcgi responses more efficiently - tomh, 2009-06-05 22:29

View differences:

src/mod_fastcgi.c 2009-06-05 00:08:19.000000000 +0100
2361 2361

  
2362 2362
	/* get at least the FastCGI header */
2363 2363
	for (c = hctx->rb->first; c; c = c->next) {
2364
		size_t weWant = sizeof(*header) - (packet->b->used - 1);
2365
		size_t weHave = c->mem->used - c->offset - 1;
2366

  
2367
		if (weHave > weWant) weHave = weWant;
2368

  
2364 2369
		if (packet->b->used == 0) {
2365
			buffer_copy_string_len(packet->b, c->mem->ptr + c->offset, c->mem->used - c->offset - 1);
2370
			buffer_copy_string_len(packet->b, c->mem->ptr + c->offset, weHave);
2366 2371
		} else {
2367
			buffer_append_string_len(packet->b, c->mem->ptr + c->offset, c->mem->used - c->offset - 1);
2372
			buffer_append_string_len(packet->b, c->mem->ptr + c->offset, weHave);
2368 2373
		}
2369 2374

  
2370 2375
		if (packet->b->used >= sizeof(*header) + 1) break;