Skip to content

Commit

Permalink
print more info
Browse files Browse the repository at this point in the history
  • Loading branch information
jie committed Nov 9, 2023
1 parent b72b637 commit 62940d8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gossiper/gossiper_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,16 @@ func Gossip_request_handler(c *GossiperContext, w http.ResponseWriter, r *http.R
c.Counter1_lock.Unlock()
gid := notification.GossipID
obj := c.GetObject(gid, definition.REV_INIT)
fmt.Println(notification)
fmt.Println(gid)
fmt.Println(obj.Payload)
if obj.Payload[0] != "" {
dstendpoint := "/gossip/rev_init"
msg, _ := json.Marshal(obj)
c.Counter2_lock.Lock()
c.Total_traffic_sent += len(msg)
c.Counter2_lock.Unlock()
url := notification.Sender
fmt.Println(obj.Payload)
resp, err := http.Post("http://"+url+dstendpoint, "application/json", bytes.NewBuffer(msg))
if err != nil {
if strings.Contains(err.Error(), "Client.Timeout") ||
Expand Down Expand Up @@ -444,6 +446,7 @@ func Send_obj_to_Gossipers(c *GossiperContext, gossip_obj definition.Gossip_obje
var notification Gossip_Notification
notification.GossipID = gossip_obj.GetID()
notification.Sender = c.Gossiper_crypto_config.SelfID.String()
fmt.Println(notification)
msg, _ := json.Marshal(notification)
bytecount = len(msg)
c.Counter2_lock.Lock()
Expand Down

0 comments on commit 62940d8

Please sign in to comment.