changeset 6142:6c0bfc35af03 HEAD

Removed memory pool parameter from iostreams. Default pool was almost always used, and the stream usually required destroying anyway so it didn't even make freeing memory easier.
author Timo Sirainen <tss@iki.fi>
date Tue, 24 Jul 2007 06:59:56 +0300
parents 783d614b0db4
children 705773edecfb
files src/auth/auth-client-connection.c src/auth/auth-master-connection.c src/auth/auth-worker-client.c src/auth/auth-worker-server.c src/auth/db-passwd-file.c src/deliver/auth-client.c src/deliver/deliver.c src/deliver/duplicate.c src/dict/dict-server.c src/imap-login/client.c src/imap/client.c src/imap/cmd-append.c src/imap/imap-fetch-body.c src/lib-auth/auth-server-connection.c src/lib-dict/dict-client.c src/lib-dict/dict-sql.c src/lib-imap/imap-bodystructure.c src/lib-imap/imap-envelope.c src/lib-index/mail-cache-compress.c src/lib-index/mailbox-list-index-sync.c src/lib-mail/istream-header-filter.c src/lib-settings/settings.c src/lib-storage/index/cydir/cydir-mail.c src/lib-storage/index/cydir/cydir-save.c src/lib-storage/index/dbox/dbox-file.c src/lib-storage/index/dbox/dbox-mail.c src/lib-storage/index/dbox/dbox-sync-expunge.c src/lib-storage/index/dbox/dbox-uidlist.c src/lib-storage/index/index-mail-headers.c src/lib-storage/index/maildir/maildir-keywords.c src/lib-storage/index/maildir/maildir-mail.c src/lib-storage/index/maildir/maildir-save.c src/lib-storage/index/maildir/maildir-uidlist.c src/lib-storage/index/mbox/istream-raw-mbox.c src/lib-storage/index/mbox/istream-raw-mbox.h src/lib-storage/index/mbox/mbox-file.c src/lib-storage/index/mbox/mbox-mail.c src/lib-storage/index/mbox/mbox-save.c src/lib-storage/index/mbox/mbox-sync-rewrite.c src/lib-storage/list/subscription-file.c src/lib/file-copy.c src/lib/iostream-internal.h src/lib/iostream.c src/lib/istream-data.c src/lib/istream-file.c src/lib/istream-internal.h src/lib/istream-limit.c src/lib/istream-mmap.c src/lib/istream-seekable.c src/lib/istream-seekable.h src/lib/istream-tee.c src/lib/istream-tee.h src/lib/istream.c src/lib/istream.h src/lib/ostream-crlf.c src/lib/ostream-crlf.h src/lib/ostream-file.c src/lib/ostream-internal.h src/lib/ostream.c src/lib/ostream.h src/login-common/login-proxy.c src/login-common/master.c src/master/auth-process.c src/master/log.c src/master/login-process.c src/plugins/acl/acl-backend-vfile-acllist.c src/plugins/acl/acl-backend-vfile.c src/plugins/expire/auth-client.c src/plugins/fts-squat/squat-test.c src/plugins/fts-squat/squat-trie.c src/plugins/fts-squat/squat-uidlist.c src/plugins/trash/trash-plugin.c src/plugins/zlib/istream-zlib.c src/plugins/zlib/istream-zlib.h src/plugins/zlib/zlib-plugin.c src/pop3-login/client.c src/pop3/client.c src/util/rawlog.c
diffstat 78 files changed, 199 insertions(+), 278 deletions(-) [+]
line wrap: on
line diff
--- a/src/auth/auth-client-connection.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/auth/auth-client-connection.c	Tue Jul 24 06:59:56 2007 +0300
@@ -275,10 +275,9 @@
 
 	conn->fd = fd;
 	conn->input =
-		i_stream_create_file(fd, default_pool,
-				     AUTH_CLIENT_MAX_LINE_LENGTH, FALSE);
+		i_stream_create_file(fd, AUTH_CLIENT_MAX_LINE_LENGTH, FALSE);
 	conn->output =
-		o_stream_create_file(fd, default_pool, (size_t)-1, FALSE);
+		o_stream_create_file(fd, (size_t)-1, FALSE);
 	o_stream_set_flush_callback(conn->output, auth_client_output, conn);
 	conn->io = io_add(fd, IO_READ, auth_client_input, conn);
 
--- a/src/auth/auth-master-connection.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/auth/auth-master-connection.c	Tue Jul 24 06:59:56 2007 +0300
@@ -242,10 +242,8 @@
 	conn->listener = listener;
 	conn->refcount = 1;
 	conn->fd = fd;
-	conn->input = i_stream_create_file(fd, default_pool,
-					   MAX_INBUF_SIZE, FALSE);
-	conn->output = o_stream_create_file(fd, default_pool,
-					    (size_t)-1, FALSE);
+	conn->input = i_stream_create_file(fd, MAX_INBUF_SIZE, FALSE);
+	conn->output = o_stream_create_file(fd, (size_t)-1, FALSE);
 	o_stream_set_flush_callback(conn->output, master_output, conn);
 	conn->io = io_add(fd, IO_READ, master_input, conn);
 
--- a/src/auth/auth-worker-client.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/auth/auth-worker-client.c	Tue Jul 24 06:59:56 2007 +0300
@@ -468,10 +468,9 @@
 	client->auth = auth;
 	client->fd = fd;
 	client->input =
-		i_stream_create_file(fd, default_pool,
-				     AUTH_WORKER_MAX_LINE_LENGTH, FALSE);
+		i_stream_create_file(fd, AUTH_WORKER_MAX_LINE_LENGTH, FALSE);
 	client->output =
-		o_stream_create_file(fd, default_pool, (size_t)-1, FALSE);
+		o_stream_create_file(fd, (size_t)-1, FALSE);
 	o_stream_set_flush_callback(client->output, auth_worker_output, client);
 	client->io = io_add(fd, IO_READ, auth_worker_input, client);
 
--- a/src/auth/auth-worker-server.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/auth/auth-worker-server.c	Tue Jul 24 06:59:56 2007 +0300
@@ -79,10 +79,9 @@
 
 	conn = i_new(struct auth_worker_connection, 1);
 	conn->fd = fd;
-	conn->input = i_stream_create_file(fd, default_pool,
-					   AUTH_WORKER_MAX_LINE_LENGTH, FALSE);
-	conn->output =
-		o_stream_create_file(fd, default_pool, (size_t)-1, FALSE);
+	conn->input = i_stream_create_file(fd, AUTH_WORKER_MAX_LINE_LENGTH,
+					   FALSE);
+	conn->output = o_stream_create_file(fd, (size_t)-1, FALSE);
 	conn->io = io_add(fd, IO_READ, worker_input, conn);
 	conn->requests = buffer_create_dynamic(default_pool, 128);
 
--- a/src/auth/db-passwd-file.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/auth/db-passwd-file.c	Tue Jul 24 06:59:56 2007 +0300
@@ -183,7 +183,7 @@
 	pw->users = hash_create(default_pool, pw->pool, 100,
 				str_hash, (hash_cmp_callback_t *)strcmp);
 
-	input = i_stream_create_file(pw->fd, default_pool, 4096, FALSE);
+	input = i_stream_create_file(pw->fd, 4096, FALSE);
 	while ((line = i_stream_read_next_line(input)) != NULL) {
 		if (*line == '\0' || *line == ':' || *line == '#')
 			continue; /* no username or comment */
--- a/src/deliver/auth-client.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/deliver/auth-client.c	Tue Jul 24 06:59:56 2007 +0300
@@ -179,10 +179,8 @@
 
 	conn = i_new(struct auth_connection, 1);
 	conn->fd = fd;
-	conn->input =
-		i_stream_create_file(fd, default_pool, MAX_INBUF_SIZE, FALSE);
-	conn->output =
-		o_stream_create_file(fd, default_pool, MAX_OUTBUF_SIZE, FALSE);
+	conn->input = i_stream_create_file(fd, MAX_INBUF_SIZE, FALSE);
+	conn->output = o_stream_create_file(fd, MAX_OUTBUF_SIZE, FALSE);
 	conn->io = io_add(fd, IO_READ, auth_input, conn);
 	return conn;
 }
--- a/src/deliver/deliver.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/deliver/deliver.c	Tue Jul 24 06:59:56 2007 +0300
@@ -229,7 +229,7 @@
 		i_fatal_status(EX_CONFIG, "open(%s) failed: %m", path);
 
 	t_push();
-	input = i_stream_create_file(fd, default_pool, 1024, TRUE);
+	input = i_stream_create_file(fd, 1024, TRUE);
 	while ((line = i_stream_read_next_line(input)) != NULL) {
 		/* @UNSAFE: line is modified */
 
@@ -417,7 +417,7 @@
 	envelope_sender = address_sanitize(envelope_sender);
 	mbox_hdr = mbox_from_create(envelope_sender, ioloop_time);
 
-	input = i_stream_create_file(fd, default_pool, 4096, FALSE);
+	input = i_stream_create_file(fd, 4096, FALSE);
 	input_filter =
 		i_stream_create_header_filter(input,
 					      HEADER_FILTER_EXCLUDE |
@@ -428,14 +428,12 @@
 					      NULL);
 	i_stream_unref(&input);
 
-	input_list[0] = i_stream_create_from_data(default_pool, mbox_hdr,
-						  strlen(mbox_hdr));
+	input_list[0] = i_stream_create_from_data(mbox_hdr, strlen(mbox_hdr));
 	input_list[1] = input_filter;
-	input_list[2] = i_stream_create_from_data(default_pool, "\n", 1);
+	input_list[2] = i_stream_create_from_data("\n", 1);
 	input_list[3] = NULL;
 
-	input = i_stream_create_seekable(input_list, default_pool,
-					 MAIL_MAX_MEMORY_BUFFER,
+	input = i_stream_create_seekable(input_list, MAIL_MAX_MEMORY_BUFFER,
 					 "/tmp/dovecot.deliver.");
 	i_stream_unref(&input_list[0]);
 	i_stream_unref(&input_list[1]);
--- a/src/deliver/duplicate.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/deliver/duplicate.c	Tue Jul 24 06:59:56 2007 +0300
@@ -94,7 +94,7 @@
 	}
 
 	/* <timestamp> <id_size> <user_size> <id> <user> */
-	input = i_stream_create_file(fd, default_pool, 4096, FALSE);
+	input = i_stream_create_file(fd, 4096, FALSE);
 
 	change_count = 0;
 	while (i_stream_read_data(input, &data, &size, sizeof(stamp) +
@@ -218,7 +218,7 @@
 	if (duplicate_file == NULL || !file->changed || file->new_fd == -1)
 		return;
 
-	output = o_stream_create_file(file->new_fd, default_pool, 4096, FALSE);
+	output = o_stream_create_file(file->new_fd, 4096, FALSE);
 	iter = hash_iterate_init(file->hash);
 	while (hash_iterate(iter, &key, &value)) {
 		struct duplicate *d = value;
--- a/src/dict/dict-server.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/dict/dict-server.c	Tue Jul 24 06:59:56 2007 +0300
@@ -446,9 +446,9 @@
 	conn = i_new(struct dict_client_connection, 1);
 	conn->server = server;
 	conn->fd = fd;
-	conn->input = i_stream_create_file(fd, default_pool,
-					   DICT_CLIENT_MAX_LINE_LENGTH, FALSE);
-	conn->output = o_stream_create_file(fd, default_pool, 128*1024, FALSE);
+	conn->input = i_stream_create_file(fd, DICT_CLIENT_MAX_LINE_LENGTH,
+					   FALSE);
+	conn->output = o_stream_create_file(fd, 128*1024, FALSE);
 	conn->io = io_add(fd, IO_READ, dict_client_connection_input, conn);
 	return conn;
 }
--- a/src/imap-login/client.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/imap-login/client.c	Tue Jul 24 06:59:56 2007 +0300
@@ -68,10 +68,8 @@
 
 static void client_open_streams(struct imap_client *client, int fd)
 {
-	client->input = i_stream_create_file(fd, default_pool,
-					     MAX_INBUF_SIZE, FALSE);
-	client->output = o_stream_create_file(fd, default_pool, MAX_OUTBUF_SIZE,
-					      FALSE);
+	client->input = i_stream_create_file(fd, MAX_INBUF_SIZE, FALSE);
+	client->output = o_stream_create_file(fd, MAX_OUTBUF_SIZE, FALSE);
 	client->parser = imap_parser_create(client->input, client->output,
 					    MAX_IMAP_LINE);
 }
--- a/src/imap/client.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/imap/client.c	Tue Jul 24 06:59:56 2007 +0300
@@ -30,10 +30,9 @@
 	client = i_new(struct client, 1);
 	client->fd_in = fd_in;
 	client->fd_out = fd_out;
-	client->input = i_stream_create_file(fd_in, default_pool,
-					     imap_max_line_length, FALSE);
-	client->output = o_stream_create_file(fd_out, default_pool,
-					      (size_t)-1, FALSE);
+	client->input =
+		i_stream_create_file(fd_in, imap_max_line_length, FALSE);
+	client->output = o_stream_create_file(fd_out, (size_t)-1, FALSE);
 
 	o_stream_set_flush_callback(client->output, _client_output, client);
 
--- a/src/imap/cmd-append.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/imap/cmd-append.c	Tue Jul 24 06:59:56 2007 +0300
@@ -186,7 +186,7 @@
 
 	/* we have to read the nonsynced literal so we don't treat the message
 	   data as commands. */
-	ctx->input = i_stream_create_limit(default_pool, ctx->client->input,
+	ctx->input = i_stream_create_limit(ctx->client->input,
 					   ctx->client->input->v_offset,
 					   ctx->msg_size);
 
@@ -317,7 +317,7 @@
 	}
 
 	/* save the mail */
-	ctx->input = i_stream_create_limit(default_pool, client->input,
+	ctx->input = i_stream_create_limit(client->input,
 					   client->input->v_offset,
 					   ctx->msg_size);
 	ret = mailbox_save_init(ctx->t, flags, keywords,
--- a/src/imap/imap-fetch-body.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/imap/imap-fetch-body.c	Tue Jul 24 06:59:56 2007 +0300
@@ -280,7 +280,7 @@
 	if (size->physical_size == size->virtual_size &&
 	    ctx->cur_mail->has_no_nuls) {
 		/* no need to kludge with CRs, we can use sendfile() */
-		input = i_stream_create_limit(default_pool, ctx->cur_input,
+		input = i_stream_create_limit(ctx->cur_input,
 					      ctx->cur_input->v_offset,
 					      ctx->cur_size);
 		i_stream_unref(&ctx->cur_input);
--- a/src/lib-auth/auth-server-connection.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-auth/auth-server-connection.c	Tue Jul 24 06:59:56 2007 +0300
@@ -226,10 +226,9 @@
 	conn->path = p_strdup(pool, path);
 	conn->fd = fd;
 	conn->io = io_add(fd, IO_READ, auth_client_input, conn);
-	conn->input = i_stream_create_file(fd, default_pool,
-					   AUTH_CLIENT_MAX_LINE_LENGTH, FALSE);
-	conn->output = o_stream_create_file(fd, default_pool, (size_t)-1,
-					    FALSE);
+	conn->input = i_stream_create_file(fd, AUTH_CLIENT_MAX_LINE_LENGTH,
+					   FALSE);
+	conn->output = o_stream_create_file(fd, (size_t)-1, FALSE);
 	conn->requests = hash_create(default_pool, pool, 100, NULL, NULL);
 	conn->auth_mechs_buf = buffer_create_dynamic(default_pool, 256);
 
--- a/src/lib-dict/dict-client.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-dict/dict-client.c	Tue Jul 24 06:59:56 2007 +0300
@@ -244,10 +244,8 @@
 	/* Dictionary lookups are blocking */
 	net_set_nonblock(dict->fd, FALSE);
 
-	dict->input = i_stream_create_file(dict->fd, default_pool,
-					   (size_t)-1, FALSE);
-	dict->output = o_stream_create_file(dict->fd, default_pool,
-					    4096, FALSE);
+	dict->input = i_stream_create_file(dict->fd, (size_t)-1, FALSE);
+	dict->output = o_stream_create_file(dict->fd, 4096, FALSE);
 	dict->transaction_id_counter = 0;
 
 	t_push();
--- a/src/lib-dict/dict-sql.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-dict/dict-sql.c	Tue Jul 24 06:59:56 2007 +0300
@@ -48,7 +48,7 @@
 		return -1;
 	}
 
-	input = i_stream_create_file(fd, default_pool, (size_t)-1, FALSE);
+	input = i_stream_create_file(fd, (size_t)-1, FALSE);
 	while ((line = i_stream_read_next_line(input)) != NULL) {
 		while (*line == ' ') line++;
 		value = strchr(line, '=');
--- a/src/lib-imap/imap-bodystructure.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-imap/imap-bodystructure.c	Tue Jul 24 06:59:56 2007 +0300
@@ -695,8 +695,7 @@
 	const struct imap_arg *args;
 	int ret;
 
-	input = i_stream_create_from_data(pool_datastack_create(),
-					  bodystructure, strlen(bodystructure));
+	input = i_stream_create_from_data(bodystructure, strlen(bodystructure));
 	(void)i_stream_read(input);
 
 	parser = imap_parser_create(input, NULL, (size_t)-1);
--- a/src/lib-imap/imap-envelope.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-imap/imap-envelope.c	Tue Jul 24 06:59:56 2007 +0300
@@ -380,8 +380,7 @@
 
 	i_assert(field < IMAP_ENVELOPE_FIELDS);
 
-	input = i_stream_create_from_data(pool_datastack_create(), envelope,
-					  strlen(envelope));
+	input = i_stream_create_from_data(envelope, strlen(envelope));
 	parser = imap_parser_create(input, NULL, (size_t)-1);
 
 	(void)i_stream_read(input);
--- a/src/lib-index/mail-cache-compress.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-index/mail-cache-compress.c	Tue Jul 24 06:59:56 2007 +0300
@@ -138,7 +138,7 @@
 	}
 
 	cache_view = mail_cache_view_open(cache, view);
-	output = o_stream_create_file(fd, default_pool, 0, FALSE);
+	output = o_stream_create_file(fd, 0, FALSE);
 
 	memset(&hdr, 0, sizeof(hdr));
 	hdr.version = MAIL_CACHE_VERSION;
--- a/src/lib-index/mailbox-list-index-sync.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-index/mailbox-list-index-sync.c	Tue Jul 24 06:59:56 2007 +0300
@@ -850,8 +850,7 @@
 	int ret = 0;
 
 	if (ctx->index->mmap_base == NULL) {
-		ctx->output = o_stream_create_file(ctx->index->fd, default_pool,
-						   0, FALSE);
+		ctx->output = o_stream_create_file(ctx->index->fd, 0, FALSE);
 		ctx->output_buf = buffer_create_dynamic(default_pool, 4096);
 		o_stream_seek(ctx->output, ctx->hdr.used_space);
 	}
--- a/src/lib-mail/istream-header-filter.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-mail/istream-header-filter.c	Tue Jul 24 06:59:56 2007 +0300
@@ -329,24 +329,22 @@
 			      header_filter_callback *callback, void *context)
 {
 	struct header_filter_istream *mstream;
-	pool_t pool;
 	unsigned int i;
 
 	i_assert((flags & (HEADER_FILTER_INCLUDE|HEADER_FILTER_EXCLUDE)) != 0);
 
-	pool = pool_alloconly_create("header filter stream", 4096);
-	mstream = p_new(pool, struct header_filter_istream, 1);
-	mstream->pool = pool;
+	mstream = i_new(struct header_filter_istream, 1);
+	mstream->pool = pool_alloconly_create("header filter stream", 4096);
 
 	mstream->input = input;
 	i_stream_ref(mstream->input);
 
 	mstream->headers = headers_count == 0 ? NULL :
-		p_new(pool, const char *, headers_count);
+		p_new(mstream->pool, const char *, headers_count);
 	for (i = 0; i < headers_count; i++) 
-		mstream->headers[i] = p_strdup(pool, headers[i]);
+		mstream->headers[i] = p_strdup(mstream->pool, headers[i]);
 	mstream->headers_count = headers_count;
-	mstream->hdr_buf = buffer_create_dynamic(pool, 1024);
+	mstream->hdr_buf = buffer_create_dynamic(mstream->pool, 1024);
 
 	mstream->callback = callback;
 	mstream->context = context;
@@ -366,5 +364,5 @@
 
 	mstream->istream.istream.blocking = input->blocking;
 	mstream->istream.istream.seekable = input->seekable;
-	return _i_stream_create(&mstream->istream, pool, -1, 0);
+	return _i_stream_create(&mstream->istream, -1, 0);
 }
--- a/src/lib-settings/settings.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-settings/settings.c	Tue Jul 24 06:59:56 2007 +0300
@@ -91,7 +91,7 @@
 	}
 
 	linenum = 0; sections = 0; root_section = 0; errormsg = NULL;
-	input = i_stream_create_file(fd, default_pool, 2048, TRUE);
+	input = i_stream_create_file(fd, 2048, TRUE);
 	for (;;) {
 		line = i_stream_read_next_line(input);
 		if (line == NULL) {
--- a/src/lib-storage/index/cydir/cydir-mail.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-storage/index/cydir/cydir-mail.c	Tue Jul 24 06:59:56 2007 +0300
@@ -113,8 +113,7 @@
 			return NULL;
 		}
 		mail->data.stream =
-			i_stream_create_file(fd, default_pool,
-					     MAIL_READ_BLOCK_SIZE, TRUE);
+			i_stream_create_file(fd, MAIL_READ_BLOCK_SIZE, TRUE);
 	}
 
 	return index_mail_init_stream(mail, hdr_size, body_size);
--- a/src/lib-storage/index/cydir/cydir-save.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-storage/index/cydir/cydir-save.c	Tue Jul 24 06:59:56 2007 +0300
@@ -85,8 +85,8 @@
 	path = cydir_get_save_path(ctx, ctx->mail_count);
 	ctx->fd = open(path, O_WRONLY | O_CREAT | O_EXCL, 0660);
 	if (ctx->fd != -1) {
-		output = o_stream_create_file(ctx->fd, default_pool, 0, FALSE);
-		ctx->output = o_stream_create_crlf(default_pool, output);
+		output = o_stream_create_file(ctx->fd, 0, FALSE);
+		ctx->output = o_stream_create_crlf(output);
 		o_stream_unref(&output);
 
 		if (received_date != (time_t)-1) {
--- a/src/lib-storage/index/dbox/dbox-file.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-storage/index/dbox/dbox-file.c	Tue Jul 24 06:59:56 2007 +0300
@@ -132,8 +132,7 @@
 		}
 
 		mbox->file->input =
-			i_stream_create_file(mbox->file->fd, default_pool,
-					     65536, FALSE);
+			i_stream_create_file(mbox->file->fd, 65536, FALSE);
 
 		if (dbox_file_read_header(mbox, mbox->file) < 0)
 			return -1;
--- a/src/lib-storage/index/dbox/dbox-mail.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-storage/index/dbox/dbox-mail.c	Tue Jul 24 06:59:56 2007 +0300
@@ -229,8 +229,7 @@
 
 		offset += mbox->file->mail_header_size;
 		mail->data.stream =
-			i_stream_create_limit(default_pool, mbox->file->input,
-					      offset,
+			i_stream_create_limit(mbox->file->input, offset,
 					      mbox->file->seeked_mail_size);
 	}
 
--- a/src/lib-storage/index/dbox/dbox-sync-expunge.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-storage/index/dbox/dbox-sync-expunge.c	Tue Jul 24 06:59:56 2007 +0300
@@ -145,7 +145,7 @@
 
 		/* try again with another file name */
 	}
-	output = o_stream_create_file(fd, default_pool, 0, FALSE);
+	output = o_stream_create_file(fd, 0, FALSE);
 	lock_path = file_dotlock_get_lock_path(dotlock);
 
 	memset(&dest_entry, 0, sizeof(dest_entry));
@@ -190,7 +190,7 @@
 		/* copy the mail */
 		full_size = mbox->file->mail_header_size +
 			mbox->file->seeked_mail_size;
-		input = i_stream_create_limit(default_pool, mbox->file->input,
+		input = i_stream_create_limit(mbox->file->input,
 					      mbox->file->seeked_offset,
 					      full_size);
 		bytes = o_stream_send_istream(output, input);
--- a/src/lib-storage/index/dbox/dbox-uidlist.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-storage/index/dbox/dbox-uidlist.c	Tue Jul 24 06:59:56 2007 +0300
@@ -353,7 +353,7 @@
 	uidlist->ino = st.st_ino;
 	uidlist->mtime = st.st_mtime;
 
-	input = i_stream_create_file(uidlist->fd, default_pool, 65536, FALSE);
+	input = i_stream_create_file(uidlist->fd, 65536, FALSE);
 
 	/* read header: <version> <uidvalidity> <next-uid>.
 	   Note that <next-uid> may be updated by UID lines, so it can't be
@@ -559,7 +559,7 @@
 		return 0;
 	}
 
-	output = o_stream_create_file(uidlist->lock_fd, default_pool, 0, FALSE);
+	output = o_stream_create_file(uidlist->lock_fd, 0, FALSE);
 
 	t_push();
 	str = t_str_new(256);
@@ -739,7 +739,7 @@
 			"lseek(%s) failed: %m", ctx->uidlist->path);
 		return -1;
 	}
-	output = o_stream_create_file(ctx->uidlist->fd, default_pool, 0, FALSE);
+	output = o_stream_create_file(ctx->uidlist->fd, 0, FALSE);
 
 	uid_start = ctx->uidlist->last_uid + 1;
 
@@ -967,9 +967,8 @@
 	file->path = i_strdup(path);
 	file->fd = fd;
 
-	file->input = i_stream_create_file(file->fd, default_pool,
-					   65536, FALSE);
-	file->output = o_stream_create_file(file->fd, default_pool, 0, FALSE);
+	file->input = i_stream_create_file(file->fd, 65536, FALSE);
+	file->output = o_stream_create_file(file->fd, 0, FALSE);
 	if ((uoff_t)st->st_size < sizeof(struct dbox_file_header)) {
 		if (dbox_file_write_header(mbox, file) < 0) {
 			dbox_file_close(file);
@@ -1152,7 +1151,7 @@
 
 	/* we'll always use CRLF linefeeds for mails (but not the header,
 	   so don't do this before dbox_file_write_header()) */
-	output = o_stream_create_crlf(default_pool, file->output);
+	output = o_stream_create_crlf(file->output);
 	o_stream_unref(&file->output);
 	file->output = output;
 
--- a/src/lib-storage/index/index-mail-headers.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-storage/index/index-mail-headers.c	Tue Jul 24 06:59:56 2007 +0300
@@ -350,9 +350,9 @@
 
 	i_assert(mail->data.parser_ctx == NULL);
 
-	tee = tee_i_stream_create(input, default_pool);
-	input = tee_i_stream_create_child(tee, default_pool);
-	input2 = tee_i_stream_create_child(tee, default_pool);
+	tee = tee_i_stream_create(input);
+	input = tee_i_stream_create_child(tee);
+	input2 = tee_i_stream_create_child(tee);
 
 	index_mail_parse_header_init(mail, NULL);
 	mail->data.parser_ctx =
@@ -710,8 +710,7 @@
 		if (mail->data.filter_stream != NULL)
 			i_stream_destroy(&mail->data.filter_stream);
 		mail->data.filter_stream =
-			i_stream_create_from_data(default_pool,
-						  str_data(dest),
+			i_stream_create_from_data(str_data(dest),
 						  str_len(dest));
 		return mail->data.filter_stream;
 	}
--- a/src/lib-storage/index/maildir/maildir-keywords.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-storage/index/maildir/maildir-keywords.c	Tue Jul 24 06:59:56 2007 +0300
@@ -133,7 +133,7 @@
 	}
 
 	maildir_keywords_clear(mk);
-	input = i_stream_create_file(fd, default_pool, 1024, FALSE);
+	input = i_stream_create_file(fd, 1024, FALSE);
 	while ((line = i_stream_read_next_line(input)) != NULL) {
 		p = strchr(line, ' ');
 		if (p == NULL) {
--- a/src/lib-storage/index/maildir/maildir-mail.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-storage/index/maildir/maildir-mail.c	Tue Jul 24 06:59:56 2007 +0300
@@ -62,8 +62,7 @@
 		return NULL;
 	}
 
-	return i_stream_create_file(fd, default_pool,
-				    MAIL_READ_BLOCK_SIZE, TRUE);
+	return i_stream_create_file(fd, MAIL_READ_BLOCK_SIZE, TRUE);
 }
 
 static int maildir_mail_stat(struct mail *mail, struct stat *st)
--- a/src/lib-storage/index/maildir/maildir-save.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-storage/index/maildir/maildir-save.c	Tue Jul 24 06:59:56 2007 +0300
@@ -377,11 +377,10 @@
 	ctx->received_date = received_date;
 	ctx->input = input;
 
-	output = o_stream_create_file(ctx->fd, system_pool, 0, FALSE);
+	output = o_stream_create_file(ctx->fd, 0, FALSE);
 	ctx->output = (ctx->mbox->storage->storage.flags &
 		       MAIL_STORAGE_FLAG_SAVE_CRLF) != 0 ?
-		o_stream_create_crlf(default_pool, output) :
-		o_stream_create_lf(default_pool, output);
+		o_stream_create_crlf(output) : o_stream_create_lf(output);
 	o_stream_unref(&output);
 
 	flags &= ~MAIL_RECENT;
--- a/src/lib-storage/index/maildir/maildir-uidlist.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-storage/index/maildir/maildir-uidlist.c	Tue Jul 24 06:59:56 2007 +0300
@@ -523,7 +523,7 @@
 							    st.st_size/8));
 	}
 
-	input = i_stream_create_file(fd, default_pool, 4096, FALSE);
+	input = i_stream_create_file(fd, 4096, FALSE);
 	i_stream_seek(input, uidlist->last_read_offset);
 
 	orig_next_uid = uidlist->next_uid;
@@ -804,7 +804,7 @@
 
 	i_assert(fd != -1);
 
-	output = o_stream_create_file(fd, default_pool, 0, FALSE);
+	output = o_stream_create_file(fd, 0, FALSE);
 	str = t_str_new(512);
 
 	if (output->offset == 0) {
--- a/src/lib-storage/index/mbox/istream-raw-mbox.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-storage/index/mbox/istream-raw-mbox.c	Tue Jul 24 06:59:56 2007 +0300
@@ -343,14 +343,14 @@
 	return &stream->statbuf;
 }
 
-struct istream *i_stream_create_raw_mbox(pool_t pool, struct istream *input,
+struct istream *i_stream_create_raw_mbox(struct istream *input,
 					 bool kludge_one_mail_only)
 {
 	struct raw_mbox_istream *rstream;
 
 	i_stream_ref(input);
 
-	rstream = p_new(pool, struct raw_mbox_istream, 1);
+	rstream = i_new(struct raw_mbox_istream, 1);
 
 	rstream->one_mail_only = kludge_one_mail_only;
 	rstream->input = input;
@@ -370,7 +370,7 @@
 
 	rstream->istream.istream.blocking = input->blocking;
 	rstream->istream.istream.seekable = input->seekable;
-	return _i_stream_create(&rstream->istream, pool, -1,
+	return _i_stream_create(&rstream->istream, -1,
 				input->real_stream->abs_start_offset);
 }
 
--- a/src/lib-storage/index/mbox/istream-raw-mbox.h	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-storage/index/mbox/istream-raw-mbox.h	Tue Jul 24 06:59:56 2007 +0300
@@ -3,7 +3,7 @@
 
 /* Create a mbox stream for parsing mbox. Reading stops before From-line,
    you'll have to call istream_raw_mbox_next() to get to next message. */
-struct istream *i_stream_create_raw_mbox(pool_t pool, struct istream *input,
+struct istream *i_stream_create_raw_mbox(struct istream *input,
 					 bool kludge_one_mail_only);
 
 /* Return offset to beginning of the "\nFrom"-line. */
--- a/src/lib-storage/index/mbox/mbox-file.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-storage/index/mbox/mbox-file.c	Tue Jul 24 06:59:56 2007 +0300
@@ -73,8 +73,7 @@
 		i_assert(mbox->mbox_fd == -1 && mbox->mbox_readonly);
 
 		mbox->mbox_stream =
-			i_stream_create_raw_mbox(default_pool,
-						 mbox->mbox_file_stream,
+			i_stream_create_raw_mbox(mbox->mbox_file_stream,
 						 one_mail_only);
 		return 0;
 	}
@@ -84,18 +83,16 @@
 			return -1;
 	}
 
-	if (mbox->mbox_writeonly) {
+	if (mbox->mbox_writeonly)
+		mbox->mbox_file_stream = i_stream_create_from_data(NULL, 0);
+	else {
 		mbox->mbox_file_stream =
-			i_stream_create_from_data(default_pool, NULL, 0);
-	} else {
-		mbox->mbox_file_stream =
-			i_stream_create_file(mbox->mbox_fd, default_pool,
+			i_stream_create_file(mbox->mbox_fd,
 					     MAIL_READ_BLOCK_SIZE, FALSE);
 	}
 
 	mbox->mbox_stream =
-		i_stream_create_raw_mbox(default_pool, mbox->mbox_file_stream,
-					 one_mail_only);
+		i_stream_create_raw_mbox(mbox->mbox_file_stream, one_mail_only);
 	return 0;
 }
 
--- a/src/lib-storage/index/mbox/mbox-mail.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-storage/index/mbox/mbox-mail.c	Tue Jul 24 06:59:56 2007 +0300
@@ -209,7 +209,7 @@
 
 		raw_stream = mbox->mbox_stream;
 		offset = istream_raw_mbox_get_header_offset(raw_stream);
-		raw_stream = i_stream_create_limit(default_pool, raw_stream,
+		raw_stream = i_stream_create_limit(raw_stream,
 						   offset, (uoff_t)-1);
 		data->stream =
 			i_stream_create_header_filter(raw_stream,
--- a/src/lib-storage/index/mbox/mbox-save.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-storage/index/mbox/mbox-save.c	Tue Jul 24 06:59:56 2007 +0300
@@ -321,8 +321,7 @@
 		if (mbox_seek_to_end(ctx, &ctx->append_offset) < 0)
 			return -1;
 
-		ctx->output = o_stream_create_file(mbox->mbox_fd, default_pool,
-						   0, FALSE);
+		ctx->output = o_stream_create_file(mbox->mbox_fd, 0, FALSE);
 	}
 	return 0;
 }
@@ -477,8 +476,8 @@
 		ctx->body_output =
 			(mbox->storage->storage.flags &
 			 MAIL_STORAGE_FLAG_SAVE_CRLF) != 0 ?
-			o_stream_create_crlf(default_pool, ctx->output) :
-			o_stream_create_lf(default_pool, ctx->output);
+			o_stream_create_crlf(ctx->output) :
+			o_stream_create_lf(ctx->output);
 		if (ctx->mail != NULL) {
 			input = index_mail_cache_parse_init(ctx->mail,
 							    ctx->input);
--- a/src/lib-storage/index/mbox/mbox-sync-rewrite.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-storage/index/mbox/mbox-sync-rewrite.c	Tue Jul 24 06:59:56 2007 +0300
@@ -26,8 +26,7 @@
 
 	i_stream_sync(sync_ctx->input);
 
-	output = o_stream_create_file(sync_ctx->write_fd, default_pool,
-				      4096, FALSE);
+	output = o_stream_create_file(sync_ctx->write_fd, 4096, FALSE);
 	i_stream_seek(sync_ctx->file_input, source);
 	if (o_stream_seek(output, dest) < 0) {
 		mbox_set_syscall_error(sync_ctx->mbox,
@@ -36,8 +35,7 @@
 		return -1;
 	}
 
-	input = i_stream_create_limit(default_pool, sync_ctx->file_input,
-				      source, size);
+	input = i_stream_create_limit(sync_ctx->file_input, source, size);
 	ret = o_stream_send_istream(output, input);
 	i_stream_unref(&input);
 
--- a/src/lib-storage/list/subscription-file.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib-storage/list/subscription-file.c	Tue Jul 24 06:59:56 2007 +0300
@@ -113,10 +113,10 @@
 	}
 
 	input = fd_in == -1 ? NULL :
-		i_stream_create_file(fd_in, default_pool,
-				     list->mailbox_name_max_length+1, TRUE);
-	output = o_stream_create_file(fd_out, default_pool,
-				      list->mailbox_name_max_length+1, FALSE);
+		i_stream_create_file(fd_in, list->mailbox_name_max_length+1,
+				     TRUE);
+	output = o_stream_create_file(fd_out, list->mailbox_name_max_length+1,
+				      FALSE);
 	found = FALSE;
 	while ((line = next_line(list, path, input,
 				 &failed, FALSE)) != NULL) {
@@ -186,10 +186,8 @@
 			ctx->failed = TRUE;
 		}
 	} else {
-		ctx->input =
-			i_stream_create_file(fd, default_pool,
-					     list->mailbox_name_max_length+1,
-					     TRUE);
+		ctx->input = i_stream_create_file(fd,
+					list->mailbox_name_max_length+1, TRUE);
 	}
 	ctx->path = i_strdup(path);
 	return ctx;
@@ -241,7 +239,7 @@
                         return NULL;
                 }
 
-		ctx->input = i_stream_create_file(fd, default_pool,
+		ctx->input = i_stream_create_file(fd,
 					ctx->list->mailbox_name_max_length+1,
 					TRUE);
         }
--- a/src/lib/file-copy.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib/file-copy.c	Tue Jul 24 06:59:56 2007 +0300
@@ -68,8 +68,8 @@
 	/* try to change the group, don't really care if it fails */
 	(void)fchown(fd_out, (uid_t)-1, st.st_gid);
 
-	input = i_stream_create_file(fd_in, default_pool, 0, FALSE);
-	output = o_stream_create_file(fd_out, default_pool, 0, FALSE);
+	input = i_stream_create_file(fd_in, 0, FALSE);
+	output = o_stream_create_file(fd_out, 0, FALSE);
 
 	while ((ret = o_stream_send_istream(output, input)) > 0) ;
 
--- a/src/lib/iostream-internal.h	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib/iostream-internal.h	Tue Jul 24 06:59:56 2007 +0300
@@ -4,7 +4,6 @@
 /* This file is private to input stream and output stream implementations */
 
 struct _iostream {
-	pool_t pool;
 	int refcount;
 
 	void (*close)(struct _iostream *stream);
@@ -12,7 +11,7 @@
 	void (*set_max_buffer_size)(struct _iostream *stream, size_t max_size);
 };
 
-void _io_stream_init(pool_t pool, struct _iostream *stream);
+void _io_stream_init(struct _iostream *stream);
 void _io_stream_ref(struct _iostream *stream);
 void _io_stream_unref(struct _iostream *stream);
 void _io_stream_close(struct _iostream *stream);
--- a/src/lib/iostream.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib/iostream.c	Tue Jul 24 06:59:56 2007 +0300
@@ -3,10 +3,8 @@
 #include "lib.h"
 #include "iostream-internal.h"
 
-void _io_stream_init(pool_t pool, struct _iostream *stream)
+void _io_stream_init(struct _iostream *stream)
 {
-	pool_ref(pool);
-	stream->pool = pool;
 	stream->refcount = 1;
 }
 
@@ -17,8 +15,6 @@
 
 void _io_stream_unref(struct _iostream *stream)
 {
-	pool_t pool;
-
 	i_assert(stream->refcount > 0);
 	if (--stream->refcount != 0)
 		return;
@@ -26,9 +22,7 @@
 	stream->close(stream);
 	stream->destroy(stream);
 
-	pool = stream->pool;
-        p_free(pool, stream);
-	pool_unref(pool);
+        i_free(stream);
 }
 
 void _io_stream_close(struct _iostream *stream)
--- a/src/lib/istream-data.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib/istream-data.c	Tue Jul 24 06:59:56 2007 +0300
@@ -24,12 +24,11 @@
 	stream->istream.v_offset = v_offset;
 }
 
-struct istream *i_stream_create_from_data(pool_t pool, const void *data,
-					  size_t size)
+struct istream *i_stream_create_from_data(const void *data, size_t size)
 {
 	struct _istream *stream;
 
-	stream = p_new(pool, struct _istream, 1);
+	stream = i_new(struct _istream, 1);
 	stream->buffer = data;
 	stream->pos = size;
 
@@ -41,7 +40,7 @@
 
 	stream->istream.blocking = TRUE;
 	stream->istream.seekable = TRUE;
-	(void)_i_stream_create(stream, pool, -1, 0);
+	(void)_i_stream_create(stream, -1, 0);
 	stream->statbuf.st_size = size;
 	return &stream->istream;
 }
--- a/src/lib/istream-file.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib/istream-file.c	Tue Jul 24 06:59:56 2007 +0300
@@ -36,7 +36,7 @@
 {
 	struct _istream *_stream = (struct _istream *) stream;
 
-	p_free(_stream->iostream.pool, _stream->w_buffer);
+	i_free(_stream->w_buffer);
 }
 
 static ssize_t _read(struct _istream *stream)
@@ -159,13 +159,13 @@
 	return &stream->statbuf;
 }
 
-struct istream *i_stream_create_file(int fd, pool_t pool,
-				     size_t max_buffer_size, bool autoclose_fd)
+struct istream *i_stream_create_file(int fd, size_t max_buffer_size,
+				     bool autoclose_fd)
 {
 	struct file_istream *fstream;
 	struct stat st;
 
-	fstream = p_new(pool, struct file_istream, 1);
+	fstream = i_new(struct file_istream, 1);
 	fstream->autoclose_fd = autoclose_fd;
 
 	fstream->istream.iostream.close = _close;
@@ -184,5 +184,5 @@
 		fstream->istream.istream.seekable = TRUE;
 	}
 
-	return _i_stream_create(&fstream->istream, pool, fd, 0);
+	return _i_stream_create(&fstream->istream, fd, 0);
 }
--- a/src/lib/istream-internal.h	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib/istream-internal.h	Tue Jul 24 06:59:56 2007 +0300
@@ -32,8 +32,8 @@
 	string_t *line_str; /* for i_stream_next_line() if w_buffer == NULL */
 };
 
-struct istream *_i_stream_create(struct _istream *_buf, pool_t pool, int fd,
-				 uoff_t abs_start_offset);
+struct istream *
+_i_stream_create(struct _istream *_buf, int fd, uoff_t abs_start_offset);
 
 void _i_stream_compress(struct _istream *stream);
 void _i_stream_grow_buffer(struct _istream *stream, size_t bytes);
--- a/src/lib/istream-limit.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib/istream-limit.c	Tue Jul 24 06:59:56 2007 +0300
@@ -108,14 +108,14 @@
 	return &stream->statbuf;
 }
 
-struct istream *i_stream_create_limit(pool_t pool, struct istream *input,
+struct istream *i_stream_create_limit(struct istream *input,
 				      uoff_t v_start_offset, uoff_t v_size)
 {
 	struct limit_istream *lstream;
 
 	i_stream_ref(input);
 
-	lstream = p_new(pool, struct limit_istream, 1);
+	lstream = i_new(struct limit_istream, 1);
 	lstream->input = input;
 	lstream->v_start_offset = v_start_offset;
 	lstream->v_size = v_size;
@@ -135,7 +135,7 @@
 
 	lstream->istream.istream.blocking = input->blocking;
 	lstream->istream.istream.seekable = input->seekable;
-	return _i_stream_create(&lstream->istream, pool, i_stream_get_fd(input),
+	return _i_stream_create(&lstream->istream, i_stream_get_fd(input),
 				input->real_stream->abs_start_offset +
 				v_start_offset);
 }
--- a/src/lib/istream-mmap.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib/istream-mmap.c	Tue Jul 24 06:59:56 2007 +0300
@@ -185,7 +185,7 @@
 	return &stream->statbuf;
 }
 
-struct istream *i_stream_create_mmap(int fd, pool_t pool, size_t block_size,
+struct istream *i_stream_create_mmap(int fd, size_t block_size,
 				     uoff_t start_offset, uoff_t v_size,
 				     bool autoclose_fd)
 {
@@ -207,7 +207,7 @@
 		}
 	}
 
-	mstream = p_new(pool, struct mmap_istream, 1);
+	mstream = i_new(struct mmap_istream, 1);
 	mstream->autoclose_fd = autoclose_fd;
 	mstream->v_size = v_size;
 
@@ -220,7 +220,7 @@
 	mstream->istream.sync = _sync;
 	mstream->istream.stat = _stat;
 
-	istream = _i_stream_create(&mstream->istream, pool, fd, start_offset);
+	istream = _i_stream_create(&mstream->istream, fd, start_offset);
 	istream->mmaped = TRUE;
 	istream->blocking = TRUE;
 	istream->seekable = TRUE;
--- a/src/lib/istream-seekable.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib/istream-seekable.c	Tue Jul 24 06:59:56 2007 +0300
@@ -17,7 +17,6 @@
 
 struct seekable_istream {
 	struct _istream istream;
-	pool_t pool;
 
 	size_t max_buffer_size;
 	char *temp_prefix;
@@ -54,8 +53,7 @@
 	for (i = 0; sstream->input[i] != NULL; i++)
 		i_stream_unref(&sstream->input[i]);
 
-	p_free(sstream->pool, sstream->temp_prefix);
-	pool_unref(sstream->pool);
+	i_free(sstream->temp_prefix);
 }
 
 static void _set_max_buffer_size(struct _iostream *stream, size_t max_size)
@@ -124,8 +122,7 @@
 
 	sstream->fd = fd;
 	sstream->fd_input =
-		i_stream_create_file(fd, sstream->pool,
-				     sstream->max_buffer_size, TRUE);
+		i_stream_create_file(fd, sstream->max_buffer_size, TRUE);
 	return 0;
 }
 
@@ -296,7 +293,7 @@
 }
 
 struct istream *
-i_stream_create_seekable(struct istream *input[], pool_t pool,
+i_stream_create_seekable(struct istream *input[],
 			 size_t max_buffer_size, const char *temp_prefix)
 {
 	struct seekable_istream *sstream;
@@ -308,14 +305,12 @@
 		i_stream_ref(input[count]);
 	i_assert(count != 0);
 
-	pool_ref(pool);
-	sstream = p_new(pool, struct seekable_istream, 1);
-	sstream->pool = pool;
-	sstream->temp_prefix = p_strdup(pool, temp_prefix);
-	sstream->buffer = buffer_create_dynamic(pool, BUF_INITIAL_SIZE);
+	sstream = i_new(struct seekable_istream, 1);
+	sstream->temp_prefix = i_strdup(temp_prefix);
+	sstream->buffer = buffer_create_dynamic(default_pool, BUF_INITIAL_SIZE);
         sstream->max_buffer_size = max_buffer_size;
 
-	sstream->input = p_new(pool, struct istream *, count + 1);
+	sstream->input = i_new(struct istream *, count + 1);
 	memcpy(sstream->input, input, sizeof(*input) * count);
 	sstream->cur_input = sstream->input[0];
 
@@ -332,5 +327,5 @@
 	sstream->istream.seek = _seek;
 	sstream->istream.stat = _stat;
 
-	return _i_stream_create(&sstream->istream, pool, -1, 0);
+	return _i_stream_create(&sstream->istream, -1, 0);
 }
--- a/src/lib/istream-seekable.h	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib/istream-seekable.h	Tue Jul 24 06:59:56 2007 +0300
@@ -7,7 +7,7 @@
    temp_prefix is used as path and filename prefix for creating the file.
    It will be appended by PID, timestamp and 128 bits of weak randomness. */
 struct istream *
-i_stream_create_seekable(struct istream *input[], pool_t pool,
+i_stream_create_seekable(struct istream *input[],
 			 size_t max_buffer_size, const char *temp_prefix);
 
 #endif
--- a/src/lib/istream-tee.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib/istream-tee.c	Tue Jul 24 06:59:56 2007 +0300
@@ -5,7 +5,6 @@
 #include "istream-tee.h"
 
 struct tee_istream {
-	pool_t pool;
 	struct istream *input;
 	struct tee_child_istream *children;
 
@@ -88,7 +87,7 @@
 			      tee->max_read_offset - tee->input->v_offset);
 
 		i_stream_unref(&tee->input);
-		p_free(tee->pool, tee);
+		i_free(tee);
 	} else {
 		tee_streams_skip(tstream->tee);
 	}
@@ -170,24 +169,22 @@
 	return i_stream_sync(tstream->tee->input);
 }
 
-struct tee_istream *tee_i_stream_create(struct istream *input, pool_t pool)
+struct tee_istream *tee_i_stream_create(struct istream *input)
 {
 	struct tee_istream *tee;
 
-	tee = p_new(pool, struct tee_istream, 1);
-	tee->pool = pool;
+	tee = i_new(struct tee_istream, 1);
 	tee->input = input;
 
 	i_stream_ref(input);
 	return tee;
 }
 
-struct istream *
-tee_i_stream_create_child(struct tee_istream *tee, pool_t pool)
+struct istream *tee_i_stream_create_child(struct tee_istream *tee)
 {
 	struct tee_child_istream *tstream;
 
-	tstream = p_new(pool, struct tee_child_istream, 1);
+	tstream = i_new(struct tee_child_istream, 1);
 	tstream->tee = tee;
 
 	tstream->istream.iostream.close = _close;
@@ -202,6 +199,6 @@
 	tstream->next = tee->children;
 	tee->children = tstream;
 
-	return _i_stream_create(&tstream->istream, pool,
+	return _i_stream_create(&tstream->istream,
 				i_stream_get_fd(tee->input), 0);
 }
--- a/src/lib/istream-tee.h	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib/istream-tee.h	Tue Jul 24 06:59:56 2007 +0300
@@ -7,9 +7,8 @@
 
    If the stream's buffer gets full because some child isn't consuming the
    data, other streams get returned 0 by i_stream_read(). */
-struct tee_istream *tee_i_stream_create(struct istream *input, pool_t pool);
+struct tee_istream *tee_i_stream_create(struct istream *input);
 
-struct istream *
-tee_i_stream_create_child(struct tee_istream *tee, pool_t pool);
+struct istream *tee_i_stream_create_child(struct tee_istream *tee);
 
 #endif
--- a/src/lib/istream.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib/istream.c	Tue Jul 24 06:59:56 2007 +0300
@@ -279,19 +279,15 @@
 	stream->buffer_size = stream->pos + bytes;
 	if (stream->buffer_size <= I_STREAM_MIN_SIZE)
 		stream->buffer_size = I_STREAM_MIN_SIZE;
-	else {
-		stream->buffer_size =
-			pool_get_exp_grown_size(stream->iostream.pool,
-						old_size, stream->buffer_size);
-	}
+	else
+		stream->buffer_size = nearest_power(stream->buffer_size);
 
 	if (stream->max_buffer_size > 0 &&
 	    stream->buffer_size > stream->max_buffer_size)
 		stream->buffer_size = stream->max_buffer_size;
 
 	stream->buffer = stream->w_buffer =
-		p_realloc(stream->iostream.pool, stream->w_buffer,
-			  old_size, stream->buffer_size);
+		i_realloc(stream->w_buffer, old_size, stream->buffer_size);
 }
 
 static void _set_max_buffer_size(struct _iostream *stream, size_t max_size)
@@ -307,8 +303,8 @@
 	return &stream->statbuf;
 }
 
-struct istream *_i_stream_create(struct _istream *_stream, pool_t pool, int fd,
-				 uoff_t abs_start_offset)
+struct istream *
+_i_stream_create(struct _istream *_stream, int fd, uoff_t abs_start_offset)
 {
 	_stream->fd = fd;
 	_stream->abs_start_offset = abs_start_offset;
@@ -325,7 +321,7 @@
 		_stream->statbuf.st_mtime =
 		_stream->statbuf.st_ctime = ioloop_time;
 
-	_io_stream_init(pool, &_stream->iostream);
+	_io_stream_init(&_stream->iostream);
 	return &_stream->istream;
 }
 
@@ -371,7 +367,7 @@
 	write(fd1, buf, sizeof(buf));
 
 	/* test reading */
-	input = i_stream_create_file(fd1, default_pool, 512, FALSE);
+	input = i_stream_create_file(fd1, 512, FALSE);
 	i_assert(i_stream_get_size(input) == sizeof(buf));
 
 	i_assert(i_stream_read_data(input, &data, &size, 0) > 0);
@@ -394,8 +390,8 @@
 	check_buffer(data, size, 900);
 
 	/* test moving data */
-	output1 = o_stream_create_file(fd1, default_pool, 512, FALSE);
-	output2 = o_stream_create_file(fd2, default_pool, 512, FALSE);
+	output1 = o_stream_create_file(fd1, 512, FALSE);
+	output2 = o_stream_create_file(fd2, 512, FALSE);
 
 	i_stream_seek(input, 1); size = sizeof(buf)-1;
 	i_assert(o_stream_send_istream(output2, input) == size);
@@ -410,8 +406,7 @@
 	i_assert(o_stream_send_istream(output1, input) == sizeof(buf));
 
 	/* test moving with limits */
-	l_input = i_stream_create_limit(default_pool, input,
-					sizeof(buf)/2, 512);
+	l_input = i_stream_create_limit(input, sizeof(buf)/2, 512);
 	i_stream_seek(l_input, 0);
 	o_stream_seek(output1, 10);
 	i_assert(o_stream_send_istream(output1, l_input) == 512);
--- a/src/lib/istream.h	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib/istream.h	Tue Jul 24 06:59:56 2007 +0300
@@ -18,14 +18,13 @@
 	struct _istream *real_stream;
 };
 
-struct istream *i_stream_create_file(int fd, pool_t pool,
-				     size_t max_buffer_size, bool autoclose_fd);
-struct istream *i_stream_create_mmap(int fd, pool_t pool, size_t block_size,
+struct istream *i_stream_create_file(int fd, size_t max_buffer_size,
+				     bool autoclose_fd);
+struct istream *i_stream_create_mmap(int fd, size_t block_size,
 				     uoff_t start_offset, uoff_t v_size,
 				     bool autoclose_fd);
-struct istream *i_stream_create_from_data(pool_t pool, const void *data,
-					  size_t size);
-struct istream *i_stream_create_limit(pool_t pool, struct istream *input,
+struct istream *i_stream_create_from_data(const void *data, size_t size);
+struct istream *i_stream_create_limit(struct istream *input,
 				      uoff_t v_start_offset, uoff_t v_size);
 
 /* i_stream_close() + i_stream_unref() */
--- a/src/lib/ostream-crlf.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib/ostream-crlf.c	Tue Jul 24 06:59:56 2007 +0300
@@ -347,12 +347,11 @@
 	return sent == 0 && instream->stream_errno != 0 ? -1 : (ssize_t)sent;
 }
 
-static struct crlf_ostream *
-o_stream_create_common(pool_t pool, struct ostream *output)
+static struct crlf_ostream *o_stream_create_common(struct ostream *output)
 {
 	struct crlf_ostream *cstream;
 
-	cstream = p_new(pool, struct crlf_ostream, 1);
+	cstream = i_new(struct crlf_ostream, 1);
 	cstream->output = output;
 	o_stream_ref(output);
 
@@ -369,20 +368,20 @@
 	return cstream;
 }
 
-struct ostream *o_stream_create_crlf(pool_t pool, struct ostream *output)
+struct ostream *o_stream_create_crlf(struct ostream *output)
 {
 	struct crlf_ostream *cstream;
 
-	cstream = o_stream_create_common(pool, output);
+	cstream = o_stream_create_common(output);
 	cstream->ostream.sendv = _sendv_crlf;
-	return _o_stream_create(&cstream->ostream, pool);
+	return _o_stream_create(&cstream->ostream);
 }
 
-struct ostream *o_stream_create_lf(pool_t pool, struct ostream *output)
+struct ostream *o_stream_create_lf(struct ostream *output)
 {
 	struct crlf_ostream *cstream;
 
-	cstream = o_stream_create_common(pool, output);
+	cstream = o_stream_create_common(output);
 	cstream->ostream.sendv = _sendv_lf;
-	return _o_stream_create(&cstream->ostream, pool);
+	return _o_stream_create(&cstream->ostream);
 }
--- a/src/lib/ostream-crlf.h	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib/ostream-crlf.h	Tue Jul 24 06:59:56 2007 +0300
@@ -2,8 +2,8 @@
 #define __OSTREAM_CRLF_H
 
 /* Replace all plain LFs with CRLF. */
-struct ostream *o_stream_create_crlf(pool_t pool, struct ostream *output);
+struct ostream *o_stream_create_crlf(struct ostream *output);
 /* Replace all CRLF pairs with plain LFs. */
-struct ostream *o_stream_create_lf(pool_t pool, struct ostream *output);
+struct ostream *o_stream_create_lf(struct ostream *output);
 
 #endif
--- a/src/lib/ostream-file.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib/ostream-file.c	Tue Jul 24 06:59:56 2007 +0300
@@ -78,7 +78,7 @@
 {
 	struct file_ostream *fstream = (struct file_ostream *)stream;
 
-	p_free(fstream->ostream.iostream.pool, fstream->buffer);
+	i_free(fstream->buffer);
 }
 
 static void _set_max_buffer_size(struct _iostream *stream, size_t max_size)
@@ -322,9 +322,7 @@
 {
 	size_t size, new_size, end_size;
 
-	size = pool_get_exp_grown_size(fstream->ostream.iostream.pool,
-				       fstream->buffer_size,
-                                       fstream->buffer_size + bytes);
+	size = nearest_power(fstream->buffer_size + bytes);
 	if (size > fstream->max_buffer_size) {
 		/* limit the size */
 		size = fstream->max_buffer_size;
@@ -339,8 +337,7 @@
 	if (size <= fstream->buffer_size)
 		return;
 
-	fstream->buffer = p_realloc(fstream->ostream.iostream.pool,
-				    fstream->buffer,
+	fstream->buffer = i_realloc(fstream->buffer,
 				    fstream->buffer_size, size);
 
 	if (fstream->tail <= fstream->head && !IS_STREAM_EMPTY(fstream)) {
@@ -737,15 +734,14 @@
 }
 
 struct ostream *
-o_stream_create_file(int fd, pool_t pool, size_t max_buffer_size,
-		     bool autoclose_fd)
+o_stream_create_file(int fd, size_t max_buffer_size, bool autoclose_fd)
 {
 	struct file_ostream *fstream;
 	struct ostream *ostream;
 	struct stat st;
 	off_t offset;
 
-	fstream = p_new(pool, struct file_ostream, 1);
+	fstream = i_new(struct file_ostream, 1);
 	fstream->fd = fd;
 	fstream->max_buffer_size = max_buffer_size;
 	fstream->autoclose_fd = autoclose_fd;
@@ -763,7 +759,7 @@
 	fstream->ostream.sendv = _sendv;
 	fstream->ostream.send_istream = _send_istream;
 
-	ostream = _o_stream_create(&fstream->ostream, pool);
+	ostream = _o_stream_create(&fstream->ostream);
 
 	offset = lseek(fd, 0, SEEK_CUR);
 	if (offset >= 0) {
--- a/src/lib/ostream-internal.h	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib/ostream-internal.h	Tue Jul 24 06:59:56 2007 +0300
@@ -26,6 +26,6 @@
 	void *context;
 };
 
-struct ostream *_o_stream_create(struct _ostream *_stream, pool_t pool);
+struct ostream *_o_stream_create(struct _ostream *_stream);
 
 #endif
--- a/src/lib/ostream.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib/ostream.c	Tue Jul 24 06:59:56 2007 +0300
@@ -157,10 +157,10 @@
 	return ret;
 }
 
-struct ostream *_o_stream_create(struct _ostream *_stream, pool_t pool)
+struct ostream *_o_stream_create(struct _ostream *_stream)
 {
 	_stream->ostream.real_stream = _stream;
 
-	_io_stream_init(pool, &_stream->iostream);
+	_io_stream_init(&_stream->iostream);
 	return &_stream->ostream;
 }
--- a/src/lib/ostream.h	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/lib/ostream.h	Tue Jul 24 06:59:56 2007 +0300
@@ -24,8 +24,7 @@
 /* Create new output stream from given file descriptor.
    If max_buffer_size is 0, an "optimal" buffer size is used (max 128kB). */
 struct ostream *
-o_stream_create_file(int fd, pool_t pool, size_t max_buffer_size,
-		     bool autoclose_fd);
+o_stream_create_file(int fd, size_t max_buffer_size, bool autoclose_fd);
 
 /* o_stream_close() + o_stream_unref() */
 void o_stream_destroy(struct ostream **stream);
--- a/src/login-common/login-proxy.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/login-common/login-proxy.c	Tue Jul 24 06:59:56 2007 +0300
@@ -121,11 +121,10 @@
 
 	/* connect successful */
 	proxy->server_input =
-		i_stream_create_file(proxy->server_fd, default_pool,
-				     MAX_PROXY_INPUT_SIZE, FALSE);
+		i_stream_create_file(proxy->server_fd, MAX_PROXY_INPUT_SIZE,
+				     FALSE);
 	proxy->server_output =
-		o_stream_create_file(proxy->server_fd, default_pool,
-				     (size_t)-1, FALSE);
+		o_stream_create_file(proxy->server_fd, (size_t)-1, FALSE);
 
 	io_remove(&proxy->server_io);
 	proxy->server_io =
--- a/src/login-common/master.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/login-common/master.c	Tue Jul 24 06:59:56 2007 +0300
@@ -165,7 +165,7 @@
 	env_clean();
 
 	/* read environment variable lines until empty line comes */
-	input = i_stream_create_file(fd, default_pool, 8192, FALSE);
+	input = i_stream_create_file(fd, 8192, FALSE);
 	do {
 		switch (i_stream_read(input)) {
 		case -1:
--- a/src/master/auth-process.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/master/auth-process.c	Tue Jul 24 06:59:56 2007 +0300
@@ -297,10 +297,8 @@
 	p->pid = pid;
 	p->fd = fd;
 	p->io = io_add(fd, IO_READ, auth_process_input, p);
-	p->input = i_stream_create_file(fd, default_pool,
-					MAX_INBUF_SIZE, FALSE);
-	p->output = o_stream_create_file(fd, default_pool, MAX_OUTBUF_SIZE,
-					 FALSE);
+	p->input = i_stream_create_file(fd, MAX_INBUF_SIZE, FALSE);
+	p->output = o_stream_create_file(fd, MAX_OUTBUF_SIZE, FALSE);
 	p->requests = hash_create(default_pool, default_pool, 0, NULL, NULL);
 
 	group->process_count++;
--- a/src/master/log.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/master/log.c	Tue Jul 24 06:59:56 2007 +0300
@@ -179,7 +179,7 @@
 
 	log_io = i_new(struct log_io, 1);
 	log_io->refcount = 1;
-	log_io->stream = i_stream_create_file(fd[0], default_pool, 1024, TRUE);
+	log_io->stream = i_stream_create_file(fd[0], 1024, TRUE);
 	log_io->max_lines_per_sec =
 		max_lines_per_sec != 0 ? max_lines_per_sec : (unsigned int)-1;
 
--- a/src/master/login-process.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/master/login-process.c	Tue Jul 24 06:59:56 2007 +0300
@@ -449,7 +449,7 @@
 	p->pid = pid;
 	p->fd = fd;
 	p->io = io_add(fd, IO_READ, login_process_input, p);
-	p->output = o_stream_create_file(fd, default_pool,
+	p->output = o_stream_create_file(fd,
 					 sizeof(struct master_login_reply)*10,
 					 FALSE);
 	child_process_add(pid, &p->process);
--- a/src/plugins/acl/acl-backend-vfile-acllist.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/plugins/acl/acl-backend-vfile-acllist.c	Tue Jul 24 06:59:56 2007 +0300
@@ -83,7 +83,7 @@
 	backend->acllist_mtime = st.st_mtime;
 	acllist_clear(backend, st.st_size);
 
-	input = i_stream_create_file(fd, default_pool, (size_t)-1, FALSE);
+	input = i_stream_create_file(fd, (size_t)-1, FALSE);
 	while ((line = i_stream_read_next_line(input)) != NULL) {
 		acllist.mtime = 0;
 		for (p = line; *p >= '0' && *p <= '9'; p++)
@@ -208,7 +208,7 @@
 	fd = safe_mkstemp(path, mode, uid, gid);
 	if (fd == -1)
 		return -1;
-	output = o_stream_create_file(fd, default_pool, 0, FALSE);
+	output = o_stream_create_file(fd, 0, FALSE);
 
 	ret = 0;
 	acllist_clear(backend, 0);
--- a/src/plugins/acl/acl-backend-vfile.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/plugins/acl/acl-backend-vfile.c	Tue Jul 24 06:59:56 2007 +0300
@@ -345,7 +345,7 @@
 	if (aclobj->aclobj.backend->debug)
 		i_info("acl vfile: reading file %s", path);
 
-	input = i_stream_create_file(fd, default_pool, 4096, FALSE);
+	input = i_stream_create_file(fd, 4096, FALSE);
 
 	if (!array_is_created(&aclobj->rights)) {
 		aclobj->rights_pool =
--- a/src/plugins/expire/auth-client.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/plugins/expire/auth-client.c	Tue Jul 24 06:59:56 2007 +0300
@@ -46,10 +46,8 @@
 	}
 
 	conn->fd = fd;
-	conn->input =
-		i_stream_create_file(fd, default_pool, MAX_INBUF_SIZE, FALSE);
-	conn->output =
-		o_stream_create_file(fd, default_pool, MAX_OUTBUF_SIZE, FALSE);
+	conn->input = i_stream_create_file(fd, MAX_INBUF_SIZE, FALSE);
+	conn->output = o_stream_create_file(fd, MAX_OUTBUF_SIZE, FALSE);
 	conn->io = io_add(fd, IO_READ, auth_input, conn);
 
 	o_stream_send_str(conn->output, "VERSION\t1\t0\n");
--- a/src/plugins/fts-squat/squat-test.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/plugins/fts-squat/squat-test.c	Tue Jul 24 06:59:56 2007 +0300
@@ -59,7 +59,7 @@
 		return 1;
 
 	build_ctx = squat_trie_build_init(trie, &last_uid);
-	input = i_stream_create_file(fd, default_pool, 0, FALSE);
+	input = i_stream_create_file(fd, 0, FALSE);
 	while ((line = i_stream_read_next_line(input)) != NULL) {
 		if (last != input->v_offset/(1024*100)) {
 			fprintf(stderr, "\r%ukB", (unsigned)(input->v_offset/1024));
--- a/src/plugins/fts-squat/squat-trie.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/plugins/fts-squat/squat-trie.c	Tue Jul 24 06:59:56 2007 +0300
@@ -1474,7 +1474,7 @@
 		return -1;
 	}
 
-	ctx->output = o_stream_create_file(trie->fd, default_pool, 0, FALSE);
+	ctx->output = o_stream_create_file(trie->fd, 0, FALSE);
 	o_stream_cork(ctx->output);
 	if (hdr.used_file_size == 0) {
 		o_stream_send(ctx->output, &hdr, sizeof(hdr));
@@ -1799,7 +1799,7 @@
 	}
 
 	ctx->trie = trie;
-	ctx->output = o_stream_create_file(ctx->fd, default_pool, 0, FALSE);
+	ctx->output = o_stream_create_file(ctx->fd, 0, FALSE);
 	ctx->node_count = trie->hdr->node_count;
 
 	/* write a dummy header first */
--- a/src/plugins/fts-squat/squat-uidlist.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/plugins/fts-squat/squat-uidlist.c	Tue Jul 24 06:59:56 2007 +0300
@@ -580,8 +580,7 @@
 			return -1;
 	}
 
-	uidlist->output = o_stream_create_file(uidlist->fd, default_pool,
-					       0, FALSE);
+	uidlist->output = o_stream_create_file(uidlist->fd, 0, FALSE);
 	o_stream_cork(uidlist->output);
 	if (uidlist->hdr.used_file_size < sizeof(uidlist->hdr)) {
 		/* creating a new file, write a dummy header */
@@ -761,7 +760,7 @@
 		ctx->failed = TRUE;
 		i_error("open(%s) failed: %m", ctx->tmp_path);
 	} else {
-		ctx->output = o_stream_create_file(fd, default_pool, 0, TRUE);
+		ctx->output = o_stream_create_file(fd, 0, TRUE);
 		o_stream_send(ctx->output, &ctx->hdr, sizeof(ctx->hdr));
 	}
 
--- a/src/plugins/trash/trash-plugin.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/plugins/trash/trash-plugin.c	Tue Jul 24 06:59:56 2007 +0300
@@ -262,7 +262,7 @@
 	p_clear(config_pool);
 	p_array_init(&trash_boxes, config_pool, INIT_TRASH_MAILBOX_COUNT);
 
-	input = i_stream_create_file(fd, default_pool, (size_t)-1, FALSE);
+	input = i_stream_create_file(fd, (size_t)-1, FALSE);
 	while ((line = i_stream_read_next_line(input)) != NULL) {
 		/* <priority> <mailbox name> */
 		name = strchr(line, ' ');
--- a/src/plugins/zlib/istream-zlib.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/plugins/zlib/istream-zlib.c	Tue Jul 24 06:59:56 2007 +0300
@@ -35,7 +35,7 @@
 {
 	struct _istream *_stream = (struct _istream *) stream;
 
-	p_free(_stream->iostream.pool, _stream->w_buffer);
+	i_free(_stream->w_buffer);
 }
 
 static ssize_t _read(struct _istream *stream)
@@ -193,12 +193,12 @@
 	zstream->cached_size = (uoff_t)-1;
 }
 
-struct istream *i_stream_create_zlib(int fd, pool_t pool)
+struct istream *i_stream_create_zlib(int fd)
 {
 	struct zlib_istream *zstream;
 	struct stat st;
 
-	zstream = p_new(pool, struct zlib_istream, 1);
+	zstream = i_new(struct zlib_istream, 1);
 	zstream->fd = fd;
 	zstream->file = gzdopen(fd, "r");
 	zstream->cached_size = (uoff_t)-1;
@@ -218,5 +218,5 @@
 		zstream->istream.istream.seekable = TRUE;
 	}
 
-	return _i_stream_create(&zstream->istream, pool, fd, 0);
+	return _i_stream_create(&zstream->istream, fd, 0);
 }
--- a/src/plugins/zlib/istream-zlib.h	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/plugins/zlib/istream-zlib.h	Tue Jul 24 06:59:56 2007 +0300
@@ -1,6 +1,6 @@
 #ifndef __ISTREAM_ZLIB_H
 #define __ISTREAM_ZLIB_H
 
-struct istream *i_stream_create_zlib(int fd, pool_t pool);
+struct istream *i_stream_create_zlib(int fd);
 
 #endif
--- a/src/plugins/zlib/zlib-plugin.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/plugins/zlib/zlib-plugin.c	Tue Jul 24 06:59:56 2007 +0300
@@ -41,10 +41,8 @@
 			int fd;
 
 			fd = open(path, O_RDONLY);
-			if (fd != -1) {
-				input = zlib_input =
-					i_stream_create_zlib(fd, default_pool);
-			}
+			if (fd != -1)
+				input = zlib_input = i_stream_create_zlib(fd);
 		}
 	}
 
--- a/src/pop3-login/client.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/pop3-login/client.c	Tue Jul 24 06:59:56 2007 +0300
@@ -65,10 +65,8 @@
 
 static void client_open_streams(struct pop3_client *client, int fd)
 {
-	client->input = i_stream_create_file(fd, default_pool,
-					     MAX_INBUF_SIZE, FALSE);
-	client->output = o_stream_create_file(fd, default_pool,
-					      MAX_OUTBUF_SIZE, FALSE);
+	client->input = i_stream_create_file(fd, MAX_INBUF_SIZE, FALSE);
+	client->output = o_stream_create_file(fd, MAX_OUTBUF_SIZE, FALSE);
 }
 
 static void client_start_tls(struct pop3_client *client)
--- a/src/pop3/client.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/pop3/client.c	Tue Jul 24 06:59:56 2007 +0300
@@ -140,10 +140,8 @@
 	client = i_new(struct client, 1);
 	client->fd_in = fd_in;
 	client->fd_out = fd_out;
-	client->input = i_stream_create_file(fd_in, default_pool,
-					     MAX_INBUF_SIZE, FALSE);
-	client->output = o_stream_create_file(fd_out, default_pool,
-					      (size_t)-1, FALSE);
+	client->input = i_stream_create_file(fd_in, MAX_INBUF_SIZE, FALSE);
+	client->output = o_stream_create_file(fd_out, (size_t)-1, FALSE);
 	o_stream_set_flush_callback(client->output, client_output, client);
 
 	client->io = io_add(fd_in, IO_READ, client_input, client);
--- a/src/util/rawlog.c	Tue Jul 24 06:49:00 2007 +0300
+++ b/src/util/rawlog.c	Tue Jul 24 06:59:56 2007 +0300
@@ -240,19 +240,16 @@
 	proxy = i_new(struct rawlog_proxy, 1);
 	proxy->server_fd = server_fd;
 	proxy->server_input =
-		i_stream_create_file(server_fd, default_pool,
-				     MAX_PROXY_INPUT_SIZE, FALSE);
+		i_stream_create_file(server_fd, MAX_PROXY_INPUT_SIZE, FALSE);
 	proxy->server_output =
-		o_stream_create_file(server_fd, default_pool,
-				     (size_t)-1, FALSE);
+		o_stream_create_file(server_fd, (size_t)-1, FALSE);
 	proxy->server_io = io_add(server_fd, IO_READ, server_input, proxy);
 	o_stream_set_flush_callback(proxy->server_output, server_output, proxy);
 
 	proxy->client_in_fd = client_in_fd;
 	proxy->client_out_fd = client_out_fd;
 	proxy->client_output =
-		o_stream_create_file(client_out_fd, default_pool,
-				     (size_t)-1, FALSE);
+		o_stream_create_file(client_out_fd, (size_t)-1, FALSE);
 	proxy->client_io = io_add(proxy->client_in_fd, IO_READ,
 				  client_input, proxy);
 	o_stream_set_flush_callback(proxy->client_output, client_output, proxy);