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

Done

parent 21e8befc
No related branches found
No related tags found
No related merge requests found
...@@ -74,28 +74,28 @@ func receiveReq(c *gin.Context) { ...@@ -74,28 +74,28 @@ func receiveReq(c *gin.Context) {
msgId = idMsgInt msgId = idMsgInt
parent = transmitterId parent = transmitterId
foundRsc = false foundRsc = false
}
for _, x := range arrFile { for _, x := range arrFile {
if x == c.Param("ressource") { if x == c.Param("ressource") {
if !foundRsc { if !foundRsc {
go sendFound(c.Param("ressource"), idServ) go sendFound(c.Param("ressource"), idServ)
}
foundRsc = true
break
} }
foundRsc = true
break
} }
}
tlv = tlv - 1 tlv = tlv - 1
if tlv != 0 { if tlv != 0 {
for i := 0; i < len(albums); i++ { for i := 0; i < len(albums); i++ {
//Open Neighb reg of this node //Open Neighb reg of this node
if albums[i].ID == idServ { if albums[i].ID == idServ {
for j := 0; j < len(albums[i].Neighb); j++ { for j := 0; j < len(albums[i].Neighb); j++ {
if transmitterId != albums[i].Neighb[j] && parent != 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")) 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) printErr(err)
fmt.Println(resp.Status) 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