Redundant SSL fd's
Closed this issue · 2 comments
kousu commented
fb_mqtt_write gets the SSL socket with fd = ssl_getfd(priv->ssl);
and then passes it to fb_mqtt_cb_write, which promptly totally ignores it. Does this need to be like this? Is there a bigger pattern I'm missing? It seems like all the fb_mqtt_cb_ methods take an fd argument, and most ignore them, except for fb_mqtt_cb_open which actually does use fd, but handles it internally.
dequis commented
ssl_getfd()
just returns the value of a member of the ssl struct, it doesn't create a new fd. This is a non-issue. A few extra opcodes at worst.
The pattern is the b_event_handler
signature, which is shared across all b_input_add
callbacks:
typedef gboolean (*b_event_handler)(gpointer data, gint fd, b_input_condition cond);
kousu commented
b_event_handler
is what I was missing. Thank you.