Tentative de récupération de fichier (problème: récupération bloquante)

This commit is contained in:
2022-03-08 17:44:10 +01:00
parent b030af03c9
commit 38a177aa51
7 changed files with 34 additions and 32 deletions

View File

@@ -2,17 +2,17 @@ package managers
import (
"StoreBackEnd/pkg/protocol/repository"
"bufio"
"net"
)
type RequestManager struct {
Repository *repository.ProtocolRepository
}
func (receiver RequestManager) Execute(request string, reader *bufio.Reader) string {
func (receiver RequestManager) Execute(request string, reader net.Conn) string {
// On lis ce que l'on reçoit
result, executed, readCb := receiver.Repository.ExecuteReader(request)
println("TESTTESTETTETT")
// On renvoie la réponse (Comment pour fichier ?)
if executed {
if readCb != nil {
@@ -23,8 +23,6 @@ func (receiver RequestManager) Execute(request string, reader *bufio.Reader) str
}
return result
} else {
println("HMMM")
// TODO : Renvoyer qu'une erreur est survenue
return "Error occurred while execute command"
}
}