Loading go-apps/meep-loc-serv/server/loc-serv.go +4 −4 Original line number Diff line number Diff line Loading @@ -1327,6 +1327,7 @@ func deregisterDistance(subsIdStr string) { mutex.Lock() defer mutex.Unlock() distanceSubscriptionMap[subsId] = nil distanceSubscriptionMap[subsId] = nil } func registerDistance1(distanceSub *UserDistanceSubscription, subsIdStr string) { Loading Loading @@ -2495,7 +2496,6 @@ func distanceSubPost(w http.ResponseWriter, r *http.Request) { newSubsId := nextDistanceSubscriptionIdAvailable nextDistanceSubscriptionIdAvailable++ subsIdStr := strconv.Itoa(newSubsId) distanceSub.ResourceURL = hostUrl.String() + basePath + "subscriptions/distance/" + subsIdStr distanceSub.Links = &Links{ Self: &LinkType{ Href: hostUrl.String() + basePath + "subscriptions/distance/" + subsIdStr, Loading Loading @@ -2558,7 +2558,7 @@ func distanceSubPut(w http.ResponseWriter, r *http.Request) { return } */ if distanceSub.ResourceURL == "" { if distanceSub.Links.Self.Href == "" { log.Error("Mandatory ResourceURL parameter not present") errHandlerProblemDetails(w, "Mandatory ResourceURL parameter not present", http.StatusBadRequest) return Loading @@ -2566,7 +2566,7 @@ func distanceSubPut(w http.ResponseWriter, r *http.Request) { subsIdParamStr := vars["subscriptionId"] selfUrl := strings.Split(distanceSub.ResourceURL, "/") selfUrl := strings.Split(distanceSub.Links.Self.Href, "/") subsIdStr := selfUrl[len(selfUrl)-1] //Body content not matching parameters Loading Loading @@ -2597,7 +2597,7 @@ func distanceSubPut(w http.ResponseWriter, r *http.Request) { _ = rc.JSONSetEntry(baseKey+typeDistanceSubscription+":"+subsIdStr, ".", convertDistanceSubscriptionToJson1(distanceSub)) //store the dynamic states of the subscription notifSent := distanceSubscriptionMap[subsId].NbNotificationsSent notifSent := distanceSubscriptionMap1[subsId].NbNotificationsSent deregisterDistance(subsIdStr) registerDistance1(distanceSub, subsIdStr) distanceSubscriptionMap1[subsId].NbNotificationsSent = notifSent Loading go-apps/meep-loc-serv/server/model_user_distance_subscription.go +1 −2 Original line number Diff line number Diff line Loading @@ -11,7 +11,6 @@ package server type UserDistanceSubscription struct { Links *Links `json:"_links,omitempty"` ResourceURL string `json:"resourceURL,omitempty"` // URI exposed by the client on which to receive notifications via HTTP. See note 1. CallbackReference *CallbackReference `json:"callbackReference"` // Check location immediately after establishing notification. Loading Loading
go-apps/meep-loc-serv/server/loc-serv.go +4 −4 Original line number Diff line number Diff line Loading @@ -1327,6 +1327,7 @@ func deregisterDistance(subsIdStr string) { mutex.Lock() defer mutex.Unlock() distanceSubscriptionMap[subsId] = nil distanceSubscriptionMap[subsId] = nil } func registerDistance1(distanceSub *UserDistanceSubscription, subsIdStr string) { Loading Loading @@ -2495,7 +2496,6 @@ func distanceSubPost(w http.ResponseWriter, r *http.Request) { newSubsId := nextDistanceSubscriptionIdAvailable nextDistanceSubscriptionIdAvailable++ subsIdStr := strconv.Itoa(newSubsId) distanceSub.ResourceURL = hostUrl.String() + basePath + "subscriptions/distance/" + subsIdStr distanceSub.Links = &Links{ Self: &LinkType{ Href: hostUrl.String() + basePath + "subscriptions/distance/" + subsIdStr, Loading Loading @@ -2558,7 +2558,7 @@ func distanceSubPut(w http.ResponseWriter, r *http.Request) { return } */ if distanceSub.ResourceURL == "" { if distanceSub.Links.Self.Href == "" { log.Error("Mandatory ResourceURL parameter not present") errHandlerProblemDetails(w, "Mandatory ResourceURL parameter not present", http.StatusBadRequest) return Loading @@ -2566,7 +2566,7 @@ func distanceSubPut(w http.ResponseWriter, r *http.Request) { subsIdParamStr := vars["subscriptionId"] selfUrl := strings.Split(distanceSub.ResourceURL, "/") selfUrl := strings.Split(distanceSub.Links.Self.Href, "/") subsIdStr := selfUrl[len(selfUrl)-1] //Body content not matching parameters Loading Loading @@ -2597,7 +2597,7 @@ func distanceSubPut(w http.ResponseWriter, r *http.Request) { _ = rc.JSONSetEntry(baseKey+typeDistanceSubscription+":"+subsIdStr, ".", convertDistanceSubscriptionToJson1(distanceSub)) //store the dynamic states of the subscription notifSent := distanceSubscriptionMap[subsId].NbNotificationsSent notifSent := distanceSubscriptionMap1[subsId].NbNotificationsSent deregisterDistance(subsIdStr) registerDistance1(distanceSub, subsIdStr) distanceSubscriptionMap1[subsId].NbNotificationsSent = notifSent Loading
go-apps/meep-loc-serv/server/model_user_distance_subscription.go +1 −2 Original line number Diff line number Diff line Loading @@ -11,7 +11,6 @@ package server type UserDistanceSubscription struct { Links *Links `json:"_links,omitempty"` ResourceURL string `json:"resourceURL,omitempty"` // URI exposed by the client on which to receive notifications via HTTP. See note 1. CallbackReference *CallbackReference `json:"callbackReference"` // Check location immediately after establishing notification. Loading