Masanobu Yasui authored on 2008/12/15 11:02:05
Showing 1 changed files
... ...
@@ -315,25 +315,22 @@ static void msend_req_send_stat_delete_report(mfile *m)
315 315
     if(ack_check(m, MAKUO_RECVSTATE_DELETEOK) == 1){
316 316
       if(m->comm){
317 317
         if(m->comm->loglevel == 0){
318
-          cprintf(0, m->comm, "%s[delete:%s]\r\n", dryrun, m->fn);
318
+          cprintf(0, m->comm, "%s[delete:%s]\n", dryrun, m->fn);
319 319
         }
320 320
       }
321 321
     }
322 322
   }
323 323
 
324
-  if(!m->sendto){
325
-    for(t=members;t;t=t->next){
326
-      if(r = get_hoststate(t, m)){
327
-        if(*r == MAKUO_RECVSTATE_DELETEOK){
328
-          cprintf(1, m->comm, "%sdelete %s:%s\r\n", dryrun, t->hostname, m->fn);
329
-        }
324
+  for(t=members;t;t=t->next){
325
+    if(m->sendto){
326
+      if(t != member_get(&(m->addr.sin_addr))){
327
+        continue;
330 328
       }
331 329
     }
332
-  }else{
333
-    t = member_get(&(m->addr.sin_addr));
334 330
     if(r = get_hoststate(t, m)){
335 331
       if(*r == MAKUO_RECVSTATE_DELETEOK){
336
-        cprintf(1, m->comm, "%sdelete %s:%s\r\n", dryrun, t->hostname, m->fn);
332
+        cprintf(1, m->comm, "%sdelete %s:%s\n", dryrun, t->hostname, m->fn);
333
+        lprintf(1, "%s: %sdelete %s:%s\n", __func__, dryrun, t->hostname, m->fn);
337 334
       }
338 335
     }
339 336
   }
... ...
@@ -350,31 +347,30 @@ static void msend_req_send_stat_update_report(mfile *m)
350 350
     if(ack_check(m, MAKUO_RECVSTATE_UPDATE) == 1){
351 351
       if(m->comm){
352 352
         if(m->comm->loglevel == 0){
353
-          cprintf(0, m->comm, "%s[update:%s]\r\n", dryrun, m->fn);
353
+          cprintf(0, m->comm, "%s[update:%s]\n", dryrun, m->fn);
354 354
         }
355 355
       }
356 356
     }
357 357
   }
358 358
 
359
-  if(m->sendto){
360
-    t = member_get(&(m->addr.sin_addr));
359
+  for(t=members;t;t=t->next){
360
+    if(m->sendto){
361
+      if(t != member_get(&(m->addr.sin_addr))){
362
+        continue;
363
+      }
364
+    }
361 365
     if(r = get_hoststate(t, m)){
362
-      if(*r == MAKUO_RECVSTATE_UPDATE)
366
+      if(*r == MAKUO_RECVSTATE_UPDATE){
363 367
         cprintf(1, m->comm, "%supdate %s:%s\r\n", dryrun, t->hostname, m->fn);
364
-      if(*r == MAKUO_RECVSTATE_SKIP)
368
+        lprintf(1, "%s: %supdate %s:%s\n", __func__, dryrun, t->hostname, m->fn);
369
+      }
370
+      if(*r == MAKUO_RECVSTATE_SKIP){
365 371
         cprintf(2, m->comm, "%sskip   %s:%s\r\n", dryrun, t->hostname, m->fn);
366
-      if(*r == MAKUO_RECVSTATE_READONLY)
372
+        lprintf(2, "%s: %sskip   %s:%s\n", __func__, dryrun, t->hostname, m->fn);
373
+      }
374
+      if(*r == MAKUO_RECVSTATE_READONLY){
367 375
         cprintf(2, m->comm, "%sskipro %s:%s\r\n", dryrun, t->hostname, m->fn);
368
-    }
369
-  }else{
370
-    for(t=members;t;t=t->next){
371
-      if(r = get_hoststate(t, m)){
372
-        if(*r == MAKUO_RECVSTATE_UPDATE)
373
-          cprintf(1, m->comm, "%supdate %s:%s\r\n", dryrun, t->hostname, m->fn);
374
-        if(*r == MAKUO_RECVSTATE_SKIP)
375
-          cprintf(2, m->comm, "%sskip   %s:%s\r\n", dryrun, t->hostname, m->fn);
376
-        if(*r == MAKUO_RECVSTATE_READONLY)
377
-          cprintf(2, m->comm, "%sskipro %s:%s\r\n", dryrun, t->hostname, m->fn);
376
+        lprintf(2, "%s: %sskipro %s:%s\n", __func__, dryrun, t->hostname, m->fn);
378 377
       }
379 378
     }
380 379
   }