diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-02-21 18:26:51 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-02-21 18:26:51 +0200 |
commit | 0b63c31eadfe5d4e94c7014bd0f3bd4370783d19 (patch) | |
tree | 9feb30a2c64d785d5e59fecd06429413e9f4d398 /src/mail.c | |
parent | 1213cf065e9b3a5fb45d00276b3d168462838c17 (diff) | |
download | wydawca-0b63c31eadfe5d4e94c7014bd0f3bd4370783d19.tar.gz wydawca-0b63c31eadfe5d4e94c7014bd0f3bd4370783d19.tar.bz2 |
Implement timers and destination URLs.
* gconf/gconf-gram.y (stmt_end): Make sure end callback is called in the
same environment as the begin one.
* src/vtab.c, src/null.c, src/timer.c: New files.
* src/Makefile.am (wydawca_SOURCES): Add new files.
* src/config.c (cb_mailer): Remove useless check.
(cb_destination_url): New function.
(directory_kw): Change handling of the destination keyword.
(cb_directory): Rewrite final checks.
* src/directive.c, /src/process.c, src/triplet.c: Add timers.
* src/diskio.c (move_file, archive_file, symlink_file, rmsymlink_file): Prefix
with dir_.
* src/mail.c (mail_stats): Add timer meta-variables.
* src/wydawca.c (make_stat_expansion): Change definition.
* src/wydawca.h (struct virt_tab): New data type.
(struct directory_pair.dest_url): New member.
* tests/upload-dry.at: Update expected output.
Diffstat (limited to 'src/mail.c')
-rw-r--r-- | src/mail.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -202,10 +202,11 @@ resolve_message_template (const char *name) | |||
202 | void | 202 | void |
203 | mail_stats () | 203 | mail_stats () |
204 | { | 204 | { |
205 | struct metadef exp[MAX_STAT + 2]; | 205 | struct metadef *exp; |
206 | time_t t; | 206 | time_t t; |
207 | const char *tmpl; | 207 | const char *tmpl; |
208 | char *text; | 208 | char *text; |
209 | size_t tc; | ||
209 | 210 | ||
210 | if (!admin_stat_message || !stat_mask_p (mail_admin_mask) || !mailer) | 211 | if (!admin_stat_message || !stat_mask_p (mail_admin_mask) || !mailer) |
211 | return; | 212 | return; |
@@ -230,13 +231,13 @@ mail_stats () | |||
230 | if (dry_run_mode) | 231 | if (dry_run_mode) |
231 | return; | 232 | return; |
232 | 233 | ||
234 | tc = timer_get_count () * 3; | ||
235 | exp = make_stat_expansion (tc + 1); | ||
233 | time (&t); | 236 | time (&t); |
234 | memset (exp, 0, sizeof (exp)); | ||
235 | exp[0].kw = "date"; | 237 | exp[0].kw = "date"; |
236 | exp[0].value = exp[0].storage = xstrdup (ctime (&t)); | 238 | exp[0].value = exp[0].storage = xstrdup (ctime (&t)); |
237 | exp[0].value [strlen (exp[0].value) - 1] = 0; | 239 | exp[0].value [strlen (exp[0].value) - 1] = 0; |
238 | 240 | timer_fill_meta (exp + 1, tc); | |
239 | make_stat_expansion (exp + 1); | ||
240 | 241 | ||
241 | tmpl = resolve_message_template (admin_stat_message); | 242 | tmpl = resolve_message_template (admin_stat_message); |
242 | if (!tmpl) | 243 | if (!tmpl) |
@@ -251,6 +252,8 @@ mail_stats () | |||
251 | 252 | ||
252 | free (text); | 253 | free (text); |
253 | meta_free (exp); | 254 | meta_free (exp); |
255 | timer_free_meta (exp + 1, tc); | ||
256 | free (exp); | ||
254 | } | 257 | } |
255 | 258 | ||
256 | mu_address_t | 259 | mu_address_t |