}
}
-static void client_bio_activate(fr_bio_packet_t *client)
+static void client_bio_connected(fr_bio_packet_t *client)
{
fr_radius_client_bio_info_t const *info;
* paused or resumed when the socket becomes writeable.
*/
client_config.packet_cb_cfg = (fr_bio_packet_cb_funcs_t) {
- .activate = client_bio_activate,
+ .connected = client_bio_connected,
.failed = client_bio_failed,
.write_blocked = client_bio_write_pause,
typedef ssize_t (*fr_bio_read_t)(fr_bio_t *bio, void *packet_ctx, void *buffer, size_t size);
typedef ssize_t (*fr_bio_write_t)(fr_bio_t *bio, void *packet_ctx, const void *buffer, size_t size);
-typedef int (*fr_bio_io_t)(fr_bio_t *bio); /* activate / shutdown callbacks */
+typedef int (*fr_bio_io_t)(fr_bio_t *bio); /* connected / shutdown callbacks */
-typedef void (*fr_bio_callback_t)(fr_bio_t *bio); /* activate / shutdown callbacks */
+typedef void (*fr_bio_callback_t)(fr_bio_t *bio); /* connected / shutdown callbacks */
typedef struct {
- fr_bio_callback_t activate; //!< called when the BIO is ready to be used
+ fr_bio_callback_t connected; //!< called when the BIO is ready to be used
fr_bio_callback_t shutdown; //!< called when the BIO is being shut down
fr_bio_callback_t eof; //!< called when the BIO is at EOF
fr_bio_callback_t failed; //!< called when the BIO fails
/*
* Somehow (magically) we can satisfy the read from our buffer. Do so. Note that we do NOT run
- * the activation callback, as there is still data in our buffer
+ * the connected callback, as there is still data in our buffer
*/
if (size < used) {
(void) fr_bio_buf_read(&my->buffer, buffer, size);
(void) fr_bio_buf_read(&my->buffer, buffer, used);
/*
- * Call the users activation function, which might remove us from the proxy chain.
+ * Call the users "socket is now usable" function, which might remove us from the proxy chain.
*/
- if (my->cb.activate) my->cb.activate(bio);
+ if (my->cb.connected) my->cb.connected(bio);
return used;
}
/*
* Inform all BIOs about the write pause / resume callbacks
*
- * @todo - these callbacks are set AFTER the BIOs have been initialized, so the activate()
+ * @todo - these callbacks are set AFTER the BIOs have been initialized, so the connected()
* callback is never set, and therefore is never run. We should add all of the callbacks to the
* various bio "cfg" data structures.
*/
if (my->common.cb.eof) my->common.cb.eof(&my->common);
}
-/** Callback for when the FD is activated, i.e. connected.
+/** Callback for when the FD is connected, and the application can use it
*
*/
-static void fr_radius_client_bio_activate(fr_bio_t *bio)
+static void fr_radius_client_bio_connected(fr_bio_t *bio)
{
fr_radius_client_fd_bio_t *my = bio->uctx;
if (my->ev) talloc_const_free(&my->ev);
/*
- * Tell the application that the connection has been activated.
+ * Tell the application that the connection has been connected, and is now usable.
*/
- my->common.cb.activate(&my->common);
+ my->common.cb.connected(&my->common);
}
/** We failed to connect in the given timeout, the connection is dead.
{
fr_radius_client_fd_bio_t *my = talloc_get_type_abort(uctx, fr_radius_client_fd_bio_t);
- fr_assert(my->common.cb.activate);
+ fr_assert(my->common.cb.connected);
fr_assert(!my->retry || (my->info.retry_info->el == el));
fr_assert(my->info.fd_info->socket.fd == fd);
/*
- * The socket is already connected, go activate it. This happens when the FD bio opens an
- * unconnected socket. It calls our activation routine before the application has a chance to
+ * The socket is already connected, tell the application. This happens when the FD bio opens an
+ * unconnected socket. It calls our connected routine before the application has a chance to
* call our connect routine.
*/
if (my->info.connected) return;
/*
- * We don't pass the callbacks to fr_bio_fd_alloc(), so it can't call our activate routine.
+ * We don't pass the callbacks to fr_bio_fd_alloc(), so it can't call our connected routine.
* As a result, we have to check if the FD is open, and then call it ourselves.
*/
if (my->info.fd_info->state == FR_BIO_FD_STATE_OPEN) {
- fr_radius_client_bio_activate(my->fd);
+ fr_radius_client_bio_connected(my->fd);
return;
}
fr_assert((cb->write_blocked != NULL) == (cb->write_resume != NULL));
fr_assert((cb->read_blocked != NULL) == (cb->read_resume != NULL));
- bio_cb.activate = fr_radius_client_bio_activate;
+ bio_cb.connected = fr_radius_client_bio_connected;
bio_cb.write_blocked = fr_radius_client_bio_write_blocked;
bio_cb.write_resume = fr_radius_client_bio_write_resume;