[dovecot-cvs] dovecot/src/master auth-process.c,1.15,1.16 login-process.c,1.17,1.18 settings.c,1.26,1.27

cras at procontrol.fi cras at procontrol.fi
Fri Dec 6 03:09:26 EET 2002


Update of /home/cvs/dovecot/src/master
In directory danu:/tmp/cvs-serv6082/master

Modified Files:
	auth-process.c login-process.c settings.c 
Log Message:
Renamed IBuffer and OBuffer to IStream and OStream which describes their
functionality better. I tried to keep the variable names and comments also
sensible.



Index: auth-process.c
===================================================================
RCS file: /home/cvs/dovecot/src/master/auth-process.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- auth-process.c	1 Dec 2002 15:39:21 -0000	1.15
+++ auth-process.c	6 Dec 2002 01:09:23 -0000	1.16
@@ -5,7 +5,7 @@
 #include "env-util.h"
 #include "fd-close-on-exec.h"
 #include "network.h"
-#include "obuffer.h"
+#include "ostream.h"
 #include "restrict-access.h"
 #include "restrict-process-size.h"
 #include "auth-process.h"
@@ -24,7 +24,7 @@
 	pid_t pid;
 	int fd;
 	IO io;
-	OBuffer *outbuf;
+	OStream *output;
 
 	unsigned int reply_pos;
 	char reply_buf[sizeof(AuthCookieReplyData)];
@@ -127,7 +127,7 @@
 	p->pid = pid;
 	p->fd = fd;
 	p->io = io_add(fd, IO_READ, auth_process_input, p);
-	p->outbuf = o_buffer_create_file(fd, default_pool,
+	p->output = o_stream_create_file(fd, default_pool,
 					 sizeof(AuthCookieRequestData)*100,
 					 IO_PRIORITY_DEFAULT, FALSE);
 
@@ -159,7 +159,7 @@
 
 	(void)unlink(t_strconcat(set_login_dir, "/", p->name, NULL));
 
-	o_buffer_unref(p->outbuf);
+	o_stream_unref(p->output);
 	io_remove(p->io);
 	(void)close(p->fd);
 	i_free(p->name);
@@ -285,7 +285,7 @@
 	req.id = id;
 	memcpy(req.cookie, cookie, AUTH_COOKIE_SIZE);
 
-	if (o_buffer_send(process->outbuf, &req, sizeof(req)) < 0)
+	if (o_stream_send(process->output, &req, sizeof(req)) < 0)
 		auth_process_destroy(process);
 
 	push_request(process, id, callback, context);

Index: login-process.c
===================================================================
RCS file: /home/cvs/dovecot/src/master/login-process.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- login-process.c	3 Dec 2002 00:28:01 -0000	1.17
+++ login-process.c	6 Dec 2002 01:09:23 -0000	1.18
@@ -3,7 +3,7 @@
 #include "common.h"
 #include "ioloop.h"
 #include "network.h"
-#include "obuffer.h"
+#include "ostream.h"
 #include "fdpass.h"
 #include "fd-close-on-exec.h"
 #include "env-util.h"
@@ -25,7 +25,7 @@
 	pid_t pid;
 	int fd;
 	IO io;
-	OBuffer *outbuf;
+	OStream *output;
 	unsigned int listening:1;
 	unsigned int destroyed:1;
 };
@@ -81,7 +81,7 @@
 	reply.id = request->login_id;
 
 	process = request->process;
-	if (o_buffer_send(process->outbuf, &reply, sizeof(reply)) < 0)
+	if (o_stream_send(process->output, &reply, sizeof(reply)) < 0)
 		login_process_destroy(process);
 
 	(void)close(request->fd);
@@ -182,7 +182,7 @@
 	p->fd = fd;
 	p->listening = TRUE;
 	p->io = io_add(fd, IO_READ, login_process_input, p);
-	p->outbuf = o_buffer_create_file(fd, default_pool,
+	p->output = o_stream_create_file(fd, default_pool,
 					 sizeof(MasterReply)*10,
 					 IO_PRIORITY_DEFAULT, FALSE);
 
@@ -215,7 +215,7 @@
 	if (p->listening)
 		listening_processes--;
 
-	o_buffer_close(p->outbuf);
+	o_stream_close(p->output);
 	io_remove(p->io);
 	(void)close(p->fd);
 
@@ -232,7 +232,7 @@
 	if (--p->refcount > 0)
 		return;
 
-	o_buffer_unref(p->outbuf);
+	o_stream_unref(p->output);
 	i_free(p);
 }
 

Index: settings.c
===================================================================
RCS file: /home/cvs/dovecot/src/master/settings.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- settings.c	3 Dec 2002 13:31:39 -0000	1.26
+++ settings.c	6 Dec 2002 01:09:23 -0000	1.27
@@ -1,7 +1,7 @@
 /* Copyright (C) 2002 Timo Sirainen */
 
 #include "lib.h"
-#include "ibuffer.h"
+#include "istream.h"
 #include "settings.h"
 
 #include <stdio.h>
@@ -433,7 +433,7 @@
 
 void settings_read(const char *path)
 {
-	IBuffer *inbuf;
+	IStream *input;
 	const char *errormsg;
 	char *line, *key, *p;
 	int fd, linenum;
@@ -445,11 +445,11 @@
 		i_fatal("Can't open configuration file %s: %m", path);
 
 	linenum = 0;
-	inbuf = i_buffer_create_file(fd, default_pool, 2048, TRUE);
+	input = i_stream_create_file(fd, default_pool, 2048, TRUE);
 	for (;;) {
-		line = i_buffer_next_line(inbuf);
+		line = i_stream_next_line(input);
 		if (line == NULL) {
-			if (i_buffer_read(inbuf) <= 0)
+			if (i_stream_read(input) <= 0)
 				break;
                         continue;
 		}
@@ -494,7 +494,7 @@
 		}
 	};
 
-	i_buffer_unref(inbuf);
+	i_stream_unref(input);
 
         settings_verify();
 }




More information about the dovecot-cvs mailing list