diff options
Diffstat (limited to 'src/gnunet/service/gns/module.go')
-rw-r--r-- | src/gnunet/service/gns/module.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/gnunet/service/gns/module.go b/src/gnunet/service/gns/module.go index 0f4781d..02d69a1 100644 --- a/src/gnunet/service/gns/module.go +++ b/src/gnunet/service/gns/module.go | |||
@@ -113,10 +113,10 @@ func NewModule(ctx context.Context, c *core.Core) (m *Module) { | |||
113 | // Filter returns the event filter for the service | 113 | // Filter returns the event filter for the service |
114 | func (m *Module) Filter() *core.EventFilter { | 114 | func (m *Module) Filter() *core.EventFilter { |
115 | f := core.NewEventFilter() | 115 | f := core.NewEventFilter() |
116 | f.AddMsgType(message.GNS_LOOKUP) | 116 | f.AddMsgType(enums.MSG_GNS_LOOKUP) |
117 | f.AddMsgType(message.GNS_LOOKUP_RESULT) | 117 | f.AddMsgType(enums.MSG_GNS_LOOKUP_RESULT) |
118 | f.AddMsgType(message.GNS_REVERSE_LOOKUP) | 118 | f.AddMsgType(enums.MSG_GNS_REVERSE_LOOKUP) |
119 | f.AddMsgType(message.GNS_REVERSE_LOOKUP_RESULT) | 119 | f.AddMsgType(enums.MSG_GNS_REVERSE_LOOKUP_RESULT) |
120 | return f | 120 | return f |
121 | } | 121 | } |
122 | 122 | ||
@@ -299,8 +299,8 @@ func (m *Module) ResolveRelative( | |||
299 | // the longest-living record in the current set. | 299 | // the longest-living record in the current set. |
300 | expires := util.AbsoluteTimeNow() | 300 | expires := util.AbsoluteTimeNow() |
301 | for _, rec := range set.Records { | 301 | for _, rec := range set.Records { |
302 | if rec.Expires.Compare(expires) > 0 { | 302 | if rec.Expire.Compare(expires) > 0 { |
303 | expires = rec.Expires | 303 | expires = rec.Expire |
304 | } | 304 | } |
305 | } | 305 | } |
306 | set.Records = append(set.Records, m.newLEHORecord(inst.Query, expires)) | 306 | set.Records = append(set.Records, m.newLEHORecord(inst.Query, expires)) |
@@ -340,7 +340,7 @@ func (m *Module) ResolveRelative( | |||
340 | set = message.NewRecordSet() | 340 | set = message.NewRecordSet() |
341 | for _, rec := range records { | 341 | for _, rec := range records { |
342 | // is this the record type we are looking for? | 342 | // is this the record type we are looking for? |
343 | if kind.HasType(enums.GNSType(rec.Type)) { | 343 | if kind.HasType(enums.GNSType(rec.RType)) { |
344 | // add it to the result | 344 | // add it to the result |
345 | if rec = hdlrs.FinalizeRecord(rec); rec != nil { | 345 | if rec = hdlrs.FinalizeRecord(rec); rec != nil { |
346 | set.AddRecord(rec) | 346 | set.AddRecord(rec) |
@@ -363,7 +363,7 @@ func (m *Module) ResolveRelative( | |||
363 | // asking for explicitly. | 363 | // asking for explicitly. |
364 | if set.Count > 0 { | 364 | if set.Count > 0 { |
365 | for _, rec := range records { | 365 | for _, rec := range records { |
366 | if !kind.HasType(enums.GNSType(rec.Type)) && (int(rec.Flags)&enums.GNS_FLAG_SUPPL) != 0 { | 366 | if !kind.HasType(enums.GNSType(rec.RType)) && (int(rec.Flags)&enums.GNS_FLAG_SUPPL) != 0 { |
367 | set.AddRecord(rec) | 367 | set.AddRecord(rec) |
368 | } | 368 | } |
369 | } | 369 | } |
@@ -472,9 +472,9 @@ func (m *Module) Lookup( | |||
472 | // newLEHORecord creates a new supplemental GNS record of type LEHO. | 472 | // newLEHORecord creates a new supplemental GNS record of type LEHO. |
473 | func (m *Module) newLEHORecord(name string, expires util.AbsoluteTime) *message.ResourceRecord { | 473 | func (m *Module) newLEHORecord(name string, expires util.AbsoluteTime) *message.ResourceRecord { |
474 | rr := new(message.ResourceRecord) | 474 | rr := new(message.ResourceRecord) |
475 | rr.Expires = expires | 475 | rr.Expire = expires |
476 | rr.Flags = uint32(enums.GNS_FLAG_SUPPL) | 476 | rr.Flags = uint32(enums.GNS_FLAG_SUPPL) |
477 | rr.Type = uint32(enums.GNS_TYPE_LEHO) | 477 | rr.RType = uint32(enums.GNS_TYPE_LEHO) |
478 | rr.Size = uint32(len(name) + 1) | 478 | rr.Size = uint32(len(name) + 1) |
479 | rr.Data = make([]byte, rr.Size) | 479 | rr.Data = make([]byte, rr.Size) |
480 | copy(rr.Data, []byte(name)) | 480 | copy(rr.Data, []byte(name)) |