mer-hybris / libgbinder

GLib-style interface to binder
BSD 3-Clause "New" or "Revised" License
50 stars 42 forks source link

[gbinder] Handle changing the rpc protocol during execution #98

Closed aleasto closed 2 years ago

aleasto commented 2 years ago

When calling gbinder_ipc_new with a different protocol for the same device node, we would end up getting the old cached GBinderIpc object referencing the old protocol. Make sure to update it.

I'm not sure if this is an acceptable solution, or if we should instead recreate the object and replace it in the hash table.

ServiceManager already handles this by using different hash tables for the different GBinderServiceManagerClass.

aleasto commented 2 years ago

Was having issues with the previous version. This works better. Still don't know if it's correct.

monich commented 2 years ago

No, it's not quite correct. The key in gbinder_ipc_table must be some sort of device+protocol combination since that is what now uniquely identifies the RPC endpoint. Kind of like how it's done in libgbinder-radio.

monich commented 2 years ago

OK, thanks!

monich commented 2 years ago

FYI: c1ff25f (I slightly amended your commit)