chore: minor tweaks

This commit is contained in:
0x1a8510f2 2023-01-15 09:08:07 +00:00
parent 9e9abb10c8
commit b3e94b6e06
Signed by: 0x1a8510f2
GPG Key ID: 1C692E355D76775D
2 changed files with 4 additions and 4 deletions

View File

@ -201,7 +201,7 @@ mainloop:
// can do.
continue mainloop
}
s.Heartbeat(packet.Peer, packetData)
go s.Heartbeat(packet.Peer, packetData)
case proto.ROUTE_RESPONSE:
packetData := proto.PacketRes{}
err = proto.Unmarshal(&packetData, peerPublicKey, packet.Data)
@ -210,7 +210,7 @@ mainloop:
// can do.
continue mainloop
}
s.Response(packet.Peer, packetData)
go s.Response(packet.Peer, packetData)
}
}
}

View File

@ -109,7 +109,7 @@ func (pm *manager) Start() {
// Read the payload from request body.
data, err := io.ReadAll(r.Body)
if err != nil {
w.WriteHeader(400)
w.WriteHeader(http.StatusBadRequest)
return
}
@ -122,7 +122,7 @@ func (pm *manager) Start() {
}
// Respond so the requester doesn't have to wait for the queue to empty.
w.WriteHeader(200)
w.WriteHeader(http.StatusNoContent)
// Add to the queue.
pm.rxq <- p