From: Arran Cudbard-Bell Date: Wed, 7 Jun 2017 16:44:04 +0000 (-0400) Subject: Remove fd and status from fr_io_t X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c5ecb386e0d1fc9e71dfebc6c604bdaad97beca;p=thirdparty%2Ffreeradius-server.git Remove fd and status from fr_io_t --- diff --git a/src/lib/io/io.h b/src/lib/io/io.h index 561e40acbc5..ccc3f17707f 100644 --- a/src/lib/io/io.h +++ b/src/lib/io/io.h @@ -233,20 +233,11 @@ typedef struct fr_io_op_t { fr_io_nak_t nak; //!< Function to send a NAK. } fr_io_op_t; -typedef enum fr_io_status_t { - FR_IO_STATUS_INIT = 0, //!< Initialing I/O path. - FR_IO_STATUS_ESTABLISHED, - FR_IO_STATUS_FAILED -} fr_io_status_t; - typedef struct fr_io fr_io_t; struct fr_io { - fr_io_status_t status; //!< Status of I/O path. - - int fd; void *ctx; //!< I/O path specific context. fr_io_op_t const *op; //!< I/O path functions. - fr_io_t *parent; //!< Parent (if applicable) + void *parent; //!< Parent usually the proto_* ctx. }; #ifndef _FR_RADIUSD_H diff --git a/src/lib/io/network.c b/src/lib/io/network.c index d7d88e28495..5d43307f7cc 100644 --- a/src/lib/io/network.c +++ b/src/lib/io/network.c @@ -799,7 +799,7 @@ void fr_network(fr_network_t *nr) // call write function again at some later date. } - fr_log(nr->log, L_DBG, "Sending reply to socket %d", cd->io->fd); + fr_log(nr->log, L_DBG, "Sending reply to socket %d", cd->io->op->fd(cd->io->ctx)); fr_message_done(&cd->m); } } diff --git a/src/tests/util/radius1_test.c b/src/tests/util/radius1_test.c index b5b2120a8c9..7e90aa0f83e 100644 --- a/src/tests/util/radius1_test.c +++ b/src/tests/util/radius1_test.c @@ -344,7 +344,6 @@ static void master_process(TALLOC_CTX *ctx) rad_assert(pc != NULL); pc->salen = sizeof(pc->src); - cd->io->fd = -1; cd->priority = 0; cd->io->ctx = pc; cd->io->op = &transport; diff --git a/src/tests/util/worker_test.c b/src/tests/util/worker_test.c index 27a6a48c330..52e01f93955 100644 --- a/src/tests/util/worker_test.c +++ b/src/tests/util/worker_test.c @@ -258,7 +258,6 @@ static void master_process(void) cd->m.when = fr_time(); - cd->io->fd = -1; cd->priority = 0; cd->io->ctx = NULL; cd->io->op = &transport;