mirror of
https://github.com/rumanzo/bt2qbt.git
synced 2024-09-19 23:31:37 +02:00
Fix incorrect counting of tasks in the utorrent 2.X that caused gorutine deadlock in some cases.
This commit is contained in:
parent
a3beacbd5a
commit
ad4036291b
@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
|
"bytes"
|
||||||
"crypto/sha1"
|
"crypto/sha1"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
@ -20,7 +21,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
"bytes"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func ASCIIconvert(s string) string {
|
func ASCIIconvert(s string) string {
|
||||||
@ -534,7 +534,7 @@ func main() {
|
|||||||
fmt.Println("Press Enter to start")
|
fmt.Println("Press Enter to start")
|
||||||
fmt.Scanln()
|
fmt.Scanln()
|
||||||
log.Println("Started")
|
log.Println("Started")
|
||||||
totaljobs := len(resumefile) - 2
|
totaljobs := len(resumefile)
|
||||||
numjob := 1
|
numjob := 1
|
||||||
var oldtags string
|
var oldtags string
|
||||||
var newtags []string
|
var newtags []string
|
||||||
@ -561,6 +561,8 @@ func main() {
|
|||||||
boundedChannel <- true
|
boundedChannel <- true
|
||||||
go logic(key, value.(map[string]interface{}), &bitdir, &with_label, &with_tags, &qbitdir, comChannel,
|
go logic(key, value.(map[string]interface{}), &bitdir, &with_label, &with_tags, &qbitdir, comChannel,
|
||||||
errChannel, positionnum, &wg, boundedChannel)
|
errChannel, positionnum, &wg, boundedChannel)
|
||||||
|
} else {
|
||||||
|
totaljobs--
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
go func() {
|
go func() {
|
||||||
|
Loading…
Reference in New Issue
Block a user