Skip to content

Commit

Permalink
remove NO_PAYLOAD type
Browse files Browse the repository at this point in the history
  • Loading branch information
jie committed Nov 9, 2023
1 parent c195274 commit 8e6619e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
3 changes: 0 additions & 3 deletions gossiper/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ func (ctx *GossiperContext) Generate_Gossip_Object_FRAG(g definition.Gossip_obje
func (ctx *GossiperContext) Remove_Payload(g definition.Gossip_object) definition.Gossip_object {
g.Payload[1] = ""
g.Payload[2] = ""
if g.Type == definition.REV_INIT {
g.Type = "REV_NO_PAYLOAD"
}
return g
}

Expand Down
10 changes: 2 additions & 8 deletions gossiper/gossiper_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,7 @@ func Gossip_request_handler(c *GossiperContext, w http.ResponseWriter, r *http.R
gid := notification.GossipID
obj := c.GetObject(gid, definition.REV_INIT)
if obj.Payload[0] != "" {
dstendpoint := ""
switch obj.Type {
case definition.REV_INIT:
dstendpoint = "/gossip/rev_init"
case definition.REV_FRAG:
dstendpoint = "/gossip/rev_frag"
}
dstendpoint := "/gossip/rev_init"
msg, _ := json.Marshal(obj)
c.Counter2_lock.Lock()
c.Total_traffic_sent += len(msg)
Expand Down Expand Up @@ -149,7 +143,7 @@ func Gossip_object_handler(c *GossiperContext, w http.ResponseWriter, r *http.Re
if bytecount > int64(c.Optimization_threshold) && gossip_obj.Type == definition.REV_INIT {
c.SavePayload(gossip_obj)
}
if bytecount > int64(c.Optimization_threshold) && (gossip_obj.Type == definition.REV_FRAG || gossip_obj.Type == "REV_NO_PAYLOAD") {
if bytecount > int64(c.Optimization_threshold) && (gossip_obj.Type == definition.REV_FRAG) {
gossip_obj = c.ReconstructPayload(gossip_obj)
}
// Verify the object is valid, if invalid we just ignore it
Expand Down

0 comments on commit 8e6619e

Please sign in to comment.