Comment 4 for bug 1369626

Revision history for this message
Ralph Lange (ralph-lange) wrote :

Ah - sorry, I was thinking in knots, distracted, offset, and stupid.

What I meant was :
Instead, the code in oldChannelNotify.cpp could probably be simplified by adding a new method that takes an additional flag triggering the notify on the IOC, and making *_put() and *_put_callback() macros that call the new method supplying the pointer or NULL as the callback and setting the flag argument.
Looking more closely, this might not simplify too much. With the additional obfuscating macro layer, it's probably a draw.

My main concern was that adding a putCallback structure on the client with a NULL pointer, which is bound to segfault the client when the notify completes, does not look convincing.

With respect to regarding a NULL pointer as an error for put_callback(), I think we are free to decide.
It was not returning an error in the past, but it was reliably crashing the client. I think we can safely assume no one was using a NULL pointer as a feature.
I also see no use case for using put_callback() without a callback. For consistency, I would make NULL an error, as with get_callback().

I like your patch - maybe also remove the unnecessary (* ) in getCallback.cpp as you did in putCallback.cpp