server: read/write now goes through connection fn's
[fw/openocd] / src / server / tcl_server.c
index 9aaee5c6cc4f0f94ff3bcab08199b316ba12dec8..7d84de7320ba735465f6f094eec2732b2353d8bd 100644 (file)
@@ -57,7 +57,7 @@ int tcl_output(struct connection *connection, const void *data, ssize_t len)
        if (tclc->tc_outerror)
                return ERROR_SERVER_REMOTE_CLOSED;
 
-       wlen = write_socket(connection->fd, data, len);
+       wlen = connection_write(connection, data, len);
 
        if (wlen == len)
                return ERROR_OK;
@@ -92,7 +92,7 @@ static int tcl_input(struct connection *connection)
        struct tcl_connection *tclc;
        unsigned char in[256];
 
-       rlen = read_socket(connection->fd, &in, sizeof(in));
+       rlen = connection_read(connection, &in, sizeof(in));
        if (rlen <= 0) {
                if (rlen < 0)
                        LOG_ERROR("error during read: %s", strerror(errno));