Project

General

Profile

04-limit-ssl-mem.patch

File which fixes this on my system (though it's probably not a "proper" fix) - mlcreech, 2007-07-25 17:43

View differences:

lighttpd-1.4.15/src/connections.c 2007-07-20 16:05:37.000000000 -0400
194 194
#ifdef USE_OPENSSL
195 195
	int r, ssl_err, len;
196 196
	buffer *b = NULL;
197
	size_t cnt=0;
198
	static const size_t max_buffered_blocks=8;
197 199

  
198 200
	if (!con->conf.is_ssl) return -1;
199 201

  
......
223 225
			con->bytes_read += len;
224 226
			b = NULL;
225 227
		}
226
	} while (len > 0);
228
	} while ((len > 0) && (++cnt<max_buffered_blocks));
227 229

  
228 230

  
229 231
	if (len < 0) {
lighttpd-1.4.15/src/network.c 2007-07-20 16:05:42.000000000 -0400
380 380
					s->ssl_pemfile);
381 381
			return -1;
382 382
		}
383
		SSL_CTX_set_default_read_ahead(s->ssl_ctx, 1);
383
		SSL_CTX_set_default_read_ahead(s->ssl_ctx, 0);
384 384
		SSL_CTX_set_mode(s->ssl_ctx, SSL_CTX_get_mode(s->ssl_ctx) | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
385 385

  
386 386
		srv_socket->ssl_ctx = s->ssl_ctx;