]> git.lizzy.rs Git - go-anidb.git/blobdiff - udp/sendqueue.go
mylistadd: Only add if the file isn't on mylist yet
[go-anidb.git] / udp / sendqueue.go
index b469ad94e719d92f6173ca72a1e8dc47efb4bde9..87276daf23ccea0a4d9e050516acfafb137bb9d6 100755 (executable)
@@ -4,11 +4,6 @@ import (
        "time"
 )
 
-type packet struct {
-       /*...*/
-       sent chan bool
-}
-
 type enqueuedPacket struct {
        packet
        queue chan packet
@@ -35,9 +30,10 @@ const (
        throttleDecInterval = 10 * time.Second
 )
 
-func sendPacket(p packet, c chan packet) {
+func sendPacket(p packet, c chan packet) chan bool {
        p.sent = make(chan bool, 2)
        globalQueue.enqueue <- enqueuedPacket{packet: p, queue: c}
+       return p.sent
 }
 
 func (gq *sendQueueState) sendQueueDispatch() {