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

sendCap: check for nil exports table/entries #113

Merged
merged 1 commit into from
Apr 4, 2018

Conversation

zenhack
Copy link
Contributor

@zenhack zenhack commented Apr 3, 2018

Fixes #112

Note that I'm not terribly confident that this is the best thing to do; it seems like maybe exports should be initialized to an empty slice up front somwhere (doing it lazily here feels wrong) but I'm fuzzy on where that would be.

Copy link
Contributor

@zombiezen zombiezen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. It would be nice to have a test for this, but all the ideas I have for triggering it would be pretty burdensome to ask you to write, so we can skip.

rpc/export.go Outdated
@@ -95,7 +95,13 @@ func (c *Conn) sendCap(d rpccp.CapDescriptor, client *capnp.Client, state capnp.
// TODO(someday): Check for pipeline client on question for receiverAnswer.

// Default to sender-hosted (export).
if c.exports == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't necessary, the for loop would just skip over it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Verified

This commit was signed with the committer’s verified signature.
jsternberg Jonathan A. Sternberg
@zombiezen zombiezen merged commit 2ea433a into capnproto:v3 Apr 4, 2018
@zenhack zenhack deleted the fix-112 branch April 4, 2018 04:52
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.

None yet

2 participants