Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip reflection for most types #369

Merged
merged 1 commit into from
Jun 12, 2016
Merged

Skip reflection for most types #369

merged 1 commit into from
Jun 12, 2016

Conversation

miekg
Copy link
Owner

@miekg miekg commented Jun 11, 2016

Make the reflection types a black list:

CAA, HIP, IPSECKEY, NSEC3, NSEC, SIG, TSIG, URI,

All other types don't use reflection anymore.

Return a pointer to the header when there is no rdata, this restores old
behavior. The rest of the conversion mostly hangs on getting size-hex
right, but then packStruct and packStructValue and the unpack variant
can be killed.

Generate pack and unpack for all embedded types as well.

@miekg
Copy link
Owner Author

miekg commented Jun 11, 2016

@asergeyev this works, except for:

% go t                                                                                                                   ~/g/src/github.com/miekg/dns cleanup-noreflect +
--- FAIL: TestPrivateByteSlice (0.00s)
    privaterr_test.go:84: offset is not matching to length of Private RR: 17!=40
    privaterr_test.go:89: got error unpacking ISBN: dns: buffer size too small
FAIL
exit status 1

I'm afraid I've changed some (hidden) semantics on the Len() stuff. Could you check wth is going on here? Thanks!

@miekg
Copy link
Owner Author

miekg commented Jun 12, 2016

@asergeyev nvm, the pack for the privaterr type didn't pack the header. Working. Now failing elsewhere, but not as severe.

Make the reflection types a black list (these types use (or should use)
the tag 'size-xxx' in their struct definition.s

HIP, IPSECKEY, NSEC3, TSIG

All other types don't use reflection anymore.

* Return a pointer to the header when there is no rdata, this restores old
  behavior. The rest of the conversion mostly hangs on getting size-hex
  right, but then packStruct and packStructValue and the unpack variant
  can be killed.
* Generate pack and unpack for all embedded types as well.
* Fix PrivateRRs, register an unpack function as well, when you register
  a new PrivateRR.
* Add the tag octet, nsec, []domains and more  to msg_helper.go
@miekg miekg force-pushed the cleanup-noreflect branch from 38d1fd6 to c4ff723 Compare June 12, 2016 15:00
@miekg miekg merged commit 6ae3b9f into master Jun 12, 2016
@miekg miekg deleted the cleanup-noreflect branch February 15, 2017 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant