From 74de8c9416f716a2d90f836b5878d2ac5aba0c41 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Wed, 12 Dec 2018 22:48:04 +0000 Subject: [PATCH] Consistent function naming for metadata --- src/yggdrasil/router.go | 6 +++--- src/yggdrasil/session.go | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/yggdrasil/router.go b/src/yggdrasil/router.go index 8ac59d8..b0655eb 100644 --- a/src/yggdrasil/router.go +++ b/src/yggdrasil/router.go @@ -433,7 +433,7 @@ func (r *router) handleProto(packet []byte) { case wire_SessionMetaRequest: fallthrough case wire_SessionMetaResponse: - r.handleMeta(bs, &p.FromKey) + r.handleMetadata(bs, &p.FromKey) case wire_DHTLookupRequest: r.handleDHTReq(bs, &p.FromKey) case wire_DHTLookupResponse: @@ -479,13 +479,13 @@ func (r *router) handleDHTRes(bs []byte, fromKey *boxPubKey) { } // Decodes meta request -func (r *router) handleMeta(bs []byte, fromKey *boxPubKey) { +func (r *router) handleMetadata(bs []byte, fromKey *boxPubKey) { req := sessionMeta{} if !req.decode(bs) { return } req.SendPermPub = *fromKey - r.core.sessions.handleMeta(&req) + r.core.sessions.handleMetadata(&req) } // Passed a function to call. diff --git a/src/yggdrasil/session.go b/src/yggdrasil/session.go index a7bed8a..6a49d58 100644 --- a/src/yggdrasil/session.go +++ b/src/yggdrasil/session.go @@ -501,12 +501,12 @@ func (ss *sessions) handlePing(ping *sessionPing) { // often than 15 minutes since receiving the last metadata) //if time.Since(sinfo.metaResTime).Minutes() > 15 { // if time.Since(sinfo.metaReqTime).Minutes() > 1 { - // ss.sendMeta(sinfo, false) + // ss.sendMetadata(sinfo, false) // } //} } -func (ss *sessions) sendMeta(sinfo *sessionInfo, isResponse bool) { +func (ss *sessions) sendMetadata(sinfo *sessionInfo, isResponse bool) { ss.myMetadataMutex.RLock() meta := sessionMeta{ IsResponse: isResponse, @@ -531,7 +531,7 @@ func (ss *sessions) sendMeta(sinfo *sessionInfo, isResponse bool) { } // Handles a meta request/response. -func (ss *sessions) handleMeta(meta *sessionMeta) { +func (ss *sessions) handleMetadata(meta *sessionMeta) { // Get the corresponding session (or create a new session) sinfo, isIn := ss.getByTheirPerm(&meta.SendPermPub) // Check the session firewall @@ -547,7 +547,7 @@ func (ss *sessions) handleMeta(meta *sessionMeta) { sinfo.theirMetadata = meta.Metadata sinfo.metaResTime = time.Now() } else { - ss.sendMeta(sinfo, true) + ss.sendMetadata(sinfo, true) } }