Skip to content
Snippets Groups Projects
Commit cafeafa5 authored by ivan.rigo's avatar ivan.rigo
Browse files

Done

parent 21e8befc
Branches
No related tags found
No related merge requests found
......@@ -74,28 +74,28 @@ func receiveReq(c *gin.Context) {
msgId = idMsgInt
parent = transmitterId
foundRsc = false
}
for _, x := range arrFile {
if x == c.Param("ressource") {
if !foundRsc {
go sendFound(c.Param("ressource"), idServ)
for _, x := range arrFile {
if x == c.Param("ressource") {
if !foundRsc {
go sendFound(c.Param("ressource"), idServ)
}
foundRsc = true
break
}
foundRsc = true
break
}
}
tlv = tlv - 1
if tlv != 0 {
for i := 0; i < len(albums); i++ {
//Open Neighb reg of this node
if albums[i].ID == idServ {
for j := 0; j < len(albums[i].Neighb); j++ {
if transmitterId != albums[i].Neighb[j] && parent != albums[i].Neighb[j] {
resp, err := http.Get("http://localhost:" + strconv.Itoa(basePort+albums[i].Neighb[j]) + "/req/" + idServ + "/" + strconv.Itoa(tlv) + "/" + strconv.Itoa(msgId) + "/" + c.Param("ressource"))
printErr(err)
fmt.Println(resp.Status)
tlv = tlv - 1
if tlv != 0 {
for i := 0; i < len(albums); i++ {
//Open Neighb reg of this node
if albums[i].ID == idServ {
for j := 0; j < len(albums[i].Neighb); j++ {
if parent != albums[i].Neighb[j] {
resp, err := http.Get("http://localhost:" + strconv.Itoa(basePort+albums[i].Neighb[j]) + "/req/" + idServ + "/" + strconv.Itoa(tlv) + "/" + strconv.Itoa(msgId) + "/" + c.Param("ressource"))
printErr(err)
fmt.Println(resp.Status)
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment