version 1.413, 2021/12/06 10:08:42 |
version 1.414, 2021/12/10 12:42:37 |
|
|
size_t size = EVBUFFER_LENGTH(tty->out); |
size_t size = EVBUFFER_LENGTH(tty->out); |
struct timeval tv = { .tv_usec = TTY_BLOCK_INTERVAL }; |
struct timeval tv = { .tv_usec = TTY_BLOCK_INTERVAL }; |
|
|
|
if (size == 0) |
|
tty->flags &= ~TTY_NOBLOCK; |
|
else if (tty->flags & TTY_NOBLOCK) |
|
return (0); |
|
|
if (size < TTY_BLOCK_START(tty)) |
if (size < TTY_BLOCK_START(tty)) |
return (0); |
return (0); |
|
|
|
|
encoded = xmalloc(size); |
encoded = xmalloc(size); |
|
|
b64_ntop(buf, len, encoded, size); |
b64_ntop(buf, len, encoded, size); |
|
tty->flags |= TTY_NOBLOCK; |
tty_putcode_ptr2(tty, TTYC_MS, "", encoded); |
tty_putcode_ptr2(tty, TTYC_MS, "", encoded); |
tty->client->redraw = EVBUFFER_LENGTH(tty->out); |
|
|
|
free(encoded); |
free(encoded); |
} |
} |
|
|
void |
void |
tty_cmd_rawstring(struct tty *tty, const struct tty_ctx *ctx) |
tty_cmd_rawstring(struct tty *tty, const struct tty_ctx *ctx) |
{ |
{ |
|
tty->flags |= TTY_NOBLOCK; |
tty_add(tty, ctx->ptr, ctx->num); |
tty_add(tty, ctx->ptr, ctx->num); |
tty_invalidate(tty); |
tty_invalidate(tty); |
} |
} |