[dovecot-cvs] dovecot/src/imap client.c,1.17,1.18 rawlog.c,1.7,1.8
cras at procontrol.fi
cras at procontrol.fi
Thu Dec 19 03:02:37 EET 2002
- Previous message: [dovecot-cvs] dovecot/src/auth userinfo-pam.c,1.9,1.10 userinfo-passwd-file.c,1.17,1.18 userinfo-passwd.c,1.9,1.10 userinfo-vpopmail.c,1.10,1.11
- Next message: [dovecot-cvs] dovecot/src/lib-imap imap-parser.c,1.25,1.26
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/dovecot/src/imap
In directory danu:/tmp/cvs-serv11467/imap
Modified Files:
client.c rawlog.c
Log Message:
Buffer related cleanups. Use PATH_MAX instead of hardcoded 1024 for paths.
Added str_path() and str_ppath() functions. i_snprintf() now returns only -1
or 0 depending on if buffer got full. dec2str() returns the string allocated
from data stack. Instead of just casting to (long) or (int), we now use
dec2str() with printf-like functions. Added o_stream_send_str(). Added
strocpy() and replaced all strcpy()s and strncpy()s with it.
Pretty much untested, hope it doesn't break too badly :)
Index: client.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/client.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- client.c 18 Dec 2002 15:15:41 -0000 1.17
+++ client.c 19 Dec 2002 01:02:35 -0000 1.18
@@ -120,7 +120,7 @@
if (client->output->closed)
return;
- (void)o_stream_send(client->output, data, strlen(data));
+ (void)o_stream_send_str(client->output, data);
(void)o_stream_send(client->output, "\r\n", 2);
}
@@ -134,9 +134,9 @@
if (tag == NULL || *tag == '\0')
tag = "*";
- (void)o_stream_send(client->output, tag, strlen(tag));
+ (void)o_stream_send_str(client->output, tag);
(void)o_stream_send(client->output, " ", 1);
- (void)o_stream_send(client->output, data, strlen(data));
+ (void)o_stream_send_str(client->output, data);
(void)o_stream_send(client->output, "\r\n", 2);
}
Index: rawlog.c
===================================================================
RCS file: /home/cvs/dovecot/src/imap/rawlog.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- rawlog.c 12 Dec 2002 18:57:47 -0000 1.7
+++ rawlog.c 19 Dec 2002 01:02:35 -0000 1.8
@@ -116,14 +116,16 @@
if (strftime(timestamp, sizeof(timestamp), "%Y%m%d-%H%M%S", tm) <= 0)
i_fatal("strftime() failed");
- fname = t_strdup_printf("%s/%s-%d.in", path, timestamp, (int)getpid());
+ fname = t_strdup_printf("%s/%s-%s.in", path, timestamp,
+ dec2str(getpid()));
log_in = open(fname, O_CREAT|O_EXCL|O_WRONLY, 0600);
if (log_in == -1) {
i_warning("rawlog_open: open() failed for %s: %m", fname);
return;
}
- fname = t_strdup_printf("%s/%s-%d.out", path, timestamp, (int)getpid());
+ fname = t_strdup_printf("%s/%s-%s.out", path, timestamp,
+ dec2str(getpid()));
log_out = open(fname, O_CREAT|O_EXCL|O_WRONLY, 0600);
if (log_out == -1) {
i_warning("rawlog_open: open() failed for %s: %m", fname);
@@ -152,8 +154,8 @@
}
close(sfd[1]);
- process_title_set(t_strdup_printf("[%s:%d rawlog]", getenv("USER"),
- (int)parent_pid));
+ process_title_set(t_strdup_printf("[%s:%s rawlog]", getenv("USER"),
+ dec2str(parent_pid)));
/* child */
client_in = *hin;
- Previous message: [dovecot-cvs] dovecot/src/auth userinfo-pam.c,1.9,1.10 userinfo-passwd-file.c,1.17,1.18 userinfo-passwd.c,1.9,1.10 userinfo-vpopmail.c,1.10,1.11
- Next message: [dovecot-cvs] dovecot/src/lib-imap imap-parser.c,1.25,1.26
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list