File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -439,18 +439,18 @@ func run() {
439
439
} else {
440
440
sendLoop ()
441
441
}
442
+
443
+ close (done )
442
444
}
443
445
444
446
func sendLoop () {
445
447
for {
446
448
s := scanLine ("" )
447
449
if s == quitCommand {
448
450
fmt .Println ("Quit command received" )
449
- close (done )
450
- break
451
+ return
451
452
}
452
453
sendMsg ([]byte (s ))
453
-
454
454
if * asymmetricMode {
455
455
// print your own message for convenience,
456
456
// because in asymmetric mode it is impossible to decrypt it
@@ -466,13 +466,11 @@ func sendFilesLoop() {
466
466
s := scanLine ("" )
467
467
if s == quitCommand {
468
468
fmt .Println ("Quit command received" )
469
- close (done )
470
- break
469
+ return
471
470
}
472
471
b , err := ioutil .ReadFile (s )
473
472
if err != nil {
474
473
fmt .Printf (">>> Error: %s \n " , err )
475
- continue
476
474
} else {
477
475
h := sendMsg (b )
478
476
if (h == common.Hash {}) {
@@ -491,15 +489,13 @@ func fileReaderLoop() {
491
489
watcher2 := shh .GetFilter (asymFilterID )
492
490
if watcher1 == nil && watcher2 == nil {
493
491
fmt .Println ("Error: neither symmetric nor asymmetric filter is installed" )
494
- close (done )
495
492
return
496
493
}
497
494
498
495
for {
499
496
s := scanLine ("" )
500
497
if s == quitCommand {
501
498
fmt .Println ("Quit command received" )
502
- close (done )
503
499
return
504
500
}
505
501
raw , err := ioutil .ReadFile (s )
You can’t perform that action at this time.
0 commit comments