while (cmd != NULL) {
/* Pseudo-command for switching to "binary output"; */
if (strcmp(cmd, "__binary") == 0) {
- args->tty_binary_output = true;
+ stream->data = (void *)io_mode_binary;
cmd = strtok(NULL, "\n");
continue;
}
}
/* Simpler output in binary mode */
- if (args->tty_binary_output) {
+ if (stream->data == (void *)io_mode_binary) {
size_t len_s = strlen(message);
if (len_s > UINT32_MAX) {
cmd = strtok(NULL, "\n");
free(client);
return;
}
+ client->data = (void *) io_mode_text;
uv_read_start((uv_stream_t *)client, io_tty_alloc, io_tty_process_input);
/* Write command line */
if (!args->quiet) {
struct tls_ctx;
struct tls_client_ctx;
+enum io_stream_mode {
+ io_mode_text = 0,
+ io_mode_binary = 1,
+};
+
/** Bind address into a file-descriptor (only, no libuv). type is e.g. SOCK_DGRAM */
int io_bind(const struct sockaddr *addr, int type, const endpoint_flags_t *flags);
/** Initialize a UDP handle and start listening. */