diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2014-08-11 19:08:02 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2014-08-11 19:08:02 +0800 |
commit | 143a4f99353f3bf57b6b0718772a13a02562f8c5 (patch) | |
tree | a9394d4479622d8249d8a4127381eaa29bd486ef | |
parent | e33dc2c95fea92c242bc68a73e10eb4050e12a16 (diff) | |
download | pttbbs-143a4f99353f3bf57b6b0718772a13a02562f8c5.tar pttbbs-143a4f99353f3bf57b6b0718772a13a02562f8c5.tar.gz pttbbs-143a4f99353f3bf57b6b0718772a13a02562f8c5.tar.bz2 pttbbs-143a4f99353f3bf57b6b0718772a13a02562f8c5.tar.lz pttbbs-143a4f99353f3bf57b6b0718772a13a02562f8c5.tar.xz pttbbs-143a4f99353f3bf57b6b0718772a13a02562f8c5.tar.zst pttbbs-143a4f99353f3bf57b6b0718772a13a02562f8c5.zip |
postd: Correct transfer data size and revise output messages.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@6062 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/daemon/postd/rebuild.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/pttbbs/daemon/postd/rebuild.c b/pttbbs/daemon/postd/rebuild.c index 056bb110..1f761d99 100644 --- a/pttbbs/daemon/postd/rebuild.c +++ b/pttbbs/daemon/postd/rebuild.c @@ -74,7 +74,7 @@ int PostAddRecord(int s, const char *board, const fileheader_t *fhdr, content[content_len] = 0; fclose(fp); - written_data += sizeof(content_len) + content_len; + *written_data += sizeof(content_len) + content_len; if (towrite(s, &content_len, sizeof(content_len)) < 0 || towrite(s, content, content_len) < 0) { success = 0; @@ -102,7 +102,8 @@ void rebuild_board(int bid GCC_UNUSED, boardheader_t *bp, int is_remote) FILE *fp; size_t output_bytes = 0; fileheader_t fhdr; - printf("Rebuilding board: %s\n", bp->brdname); + printf("Rebuilding board: %s ", bp->brdname); + debug("\n"); int64_t ts_start, ts_sync, ts_end; setbfile(dot_dir, bp->brdname, ".DIR"); @@ -162,8 +163,10 @@ void rebuild_board(int bid GCC_UNUSED, boardheader_t *bp, int is_remote) if (ts_end == ts_sync) ts_end++; data_rate = output_bytes / ((double)ts_end - ts_start) / (double) 1024; data_rate *= 1000; - printf(" Total %d entries (%ld bytes, %.2fKB/s), Exec: %.1fs, Sync: %.1fs\n", + printf(" Total %d entries (%ld bytes, %.2fKB/s)," + " %s server exec: %.1fs, sync: %.1fs\n", num, output_bytes, data_rate, + is_remote ? "remote" : "local", (ts_sync - ts_start) / (double)1000, (ts_end - ts_sync) / (double)1000); close(s); @@ -198,7 +201,7 @@ int main(int argc, const char **argv) if (argc > 1 && strchr(argv[1], ':')) { server = argv[1]; is_remote = (server[0] != ':'); - printf("Changed server to%s: %s\n", is_remote ? " REMOTE": "", server); + debug("Changed server to%s: %s\n", is_remote ? " REMOTE": "", server); argc--, argv++; } |