diff options
author | Edward Rudd <urkle@outoforder.cc> | 2008-10-26 01:53:49 (GMT) |
---|---|---|
committer | Edward Rudd <urkle@outoforder.cc> | 2008-10-26 01:53:49 (GMT) |
commit | fc70e99444b2852f45303d9bf55332f247ec6b4f (patch) | |
tree | b74c53e122b67b9b6b82ddbdf02c4fb12e9236de /utility/logparse.c | |
parent | ede07b5bec9a17f2fe208abdf12e72209b79780c (diff) |
finish transaction implementation
if a single log file aborts DO NOT keep going
switch to using libtool for linking (so rpath is set)
Diffstat (limited to 'utility/logparse.c')
-rw-r--r-- | utility/logparse.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/utility/logparse.c b/utility/logparse.c index ac70ee2..923b581 100644 --- a/utility/logparse.c +++ b/utility/logparse.c | |||
@@ -359,6 +359,9 @@ apr_status_t parse_logfile(config_t *cfg, const char *filename) | |||
359 | } | 359 | } |
360 | 360 | ||
361 | line = 0; | 361 | line = 0; |
362 | // Start Transaction | ||
363 | database_trans_start(cfg,tp); | ||
364 | |||
362 | do { | 365 | do { |
363 | rv = apr_file_gets(buff, 1024, file); | 366 | rv = apr_file_gets(buff, 1024, file); |
364 | if (rv == APR_SUCCESS) { | 367 | if (rv == APR_SUCCESS) { |
@@ -396,6 +399,7 @@ apr_status_t parse_logfile(config_t *cfg, const char *filename) | |||
396 | rv = parse_processline(targp, cfg, line, targv, targc); | 399 | rv = parse_processline(targp, cfg, line, targv, targc); |
397 | if (rv != APR_SUCCESS) { | 400 | if (rv != APR_SUCCESS) { |
398 | int i; | 401 | int i; |
402 | database_trans_abort(cfg); | ||
399 | logging_log(cfg, LOGLEVEL_ERROR, "Line %d(%d): %s", line, | 403 | logging_log(cfg, LOGLEVEL_ERROR, "Line %d(%d): %s", line, |
400 | targc, buff); | 404 | targc, buff); |
401 | for (i = 0; targv[i]; i++) { | 405 | for (i = 0; targv[i]; i++) { |
@@ -403,14 +407,20 @@ apr_status_t parse_logfile(config_t *cfg, const char *filename) | |||
403 | targv[i]); | 407 | targv[i]); |
404 | } | 408 | } |
405 | } | 409 | } |
410 | } else { | ||
411 | rv = APR_SUCCESS; | ||
412 | break; | ||
406 | } | 413 | } |
407 | } while (rv == APR_SUCCESS); | 414 | } while (rv == APR_SUCCESS); |
408 | apr_file_close(file); | 415 | apr_file_close(file); |
416 | // Finish Transaction | ||
417 | database_trans_stop(cfg,tp); | ||
418 | |||
409 | apr_pool_destroy(tp); | 419 | apr_pool_destroy(tp); |
410 | logging_log(cfg, LOGLEVEL_NOTICE, | 420 | logging_log(cfg, LOGLEVEL_NOTICE, |
411 | "PARSER: Finish Parsing Log File '%s'. Lines: %d", filename, line); | 421 | "PARSER: Finish Parsing Log File '%s'. Lines: %d", filename, line); |
412 | 422 | ||
413 | return APR_SUCCESS; | 423 | return rv; |
414 | } | 424 | } |
415 | 425 | ||
416 | apr_status_t parse_processline(apr_pool_t *ptemp, config_t *cfg, int line, | 426 | apr_status_t parse_processline(apr_pool_t *ptemp, config_t *cfg, int line, |