]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Remove fd and status from fr_io_t
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 7 Jun 2017 16:44:04 +0000 (12:44 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 7 Jun 2017 16:44:04 +0000 (12:44 -0400)
src/lib/io/io.h
src/lib/io/network.c
src/tests/util/radius1_test.c
src/tests/util/worker_test.c

index 561e40acbc5461a3d7dd5a3a07c0e4699ec9715e..ccc3f17707ff9a50df1694444f67c812b10066ae 100644 (file)
@@ -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
index d7d88e28495a96cb85978d41d4e4b2b10e2c6bd6..5d43307f7cc84eb9388882d3286d40c9c5a1b853 100644 (file)
@@ -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);
        }
 }
index b5b2120a8c9586464e9743723ce4671ee7adc782..7e90aa0f83e632b676263543fb389b6692889162 100644 (file)
@@ -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;
index 27a6a48c330a7049c94f7dccb45ce3b804f67b67..52e01f93955cc694ed98d3f888f7552e0c1bc2bf 100644 (file)
@@ -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;