]> git.gag.com Git - fw/openocd/blobdiff - src/server/tcl_server.c
server: read/write now goes through connection fn's
[fw/openocd] / src / server / tcl_server.c
index 06f67ab76b82c0e128456ab8d844e44a2f75e766..7d84de7320ba735465f6f094eec2732b2353d8bd 100644 (file)
@@ -57,7 +57,8 @@ 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;
 
@@ -91,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));