-
Notifications
You must be signed in to change notification settings - Fork 97
Fix SEGV when using dynamic addresses. #198
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thank you!
l.target = new(target) | ||
} | ||
return l.target | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with init methods, but I'd like to avoid getters returning pointers that are then modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These aren't initers, this is constructing a blank object demand. There are many places where you want to set a target/source field, but first have to make sure the target/source exists. I think a method for that is better than repeating the if target == nil {} logic everywhere - that's how the SEGV was caused - in one place someone forgot it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I stated, I disagree and won't be merging this.
m.Accept() | ||
}() | ||
|
||
s, err := ssn.NewSender(amqp.LinkAddress(r.Address())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err
isn't checked
Fixes vcabbage#197 Signed-off-by: Alan Conway <aconway@redhat.com>
e721817
to
8ccff98
Compare
example_server_test.go: very simple one-queue broker, tests basic send/receive. - Lots of unfinished stuff: grep for FIXME to see known holes. - Needs much more testing, performance profiling etc. Depends on the following pending PRs, must be re-based after they merge: - vcabbage#204 Improved debug logging. - vcabbage#203 Make conn.Close() wait till shutdown is complete. - vcabbage#201 Rename Client to Conn - vcabbage#198 Fix SEGV when using dynamic addresses. Signed-off-by: Alan Conway <aconway@redhat.com>
Fixed all comments except for the on-demand construction getters for target/source objects, which I think are better than manually repeating the |
example_server_test.go: very simple one-queue broker, tests basic send/receive. - Lots of unfinished stuff: grep for FIXME to see known holes. - Needs much more testing, performance profiling etc. Depends on the following pending PRs, must be re-based after they merge: - vcabbage#204 Improved debug logging. - vcabbage#203 Make conn.Close() wait till shutdown is complete. - vcabbage#201 Rename Client to Conn - vcabbage#198 Fix SEGV when using dynamic addresses. Signed-off-by: Alan Conway <aconway@redhat.com>
Fixes #197
Signed-off-by: Alan Conway aconway@redhat.com