From 636a9592eab1963c2b1a77bd59eaff317fa55b75 Mon Sep 17 00:00:00 2001 From: cbdev Date: Tue, 17 Mar 2020 01:09:52 +0100 Subject: Fix registry apply bug, fix openpixelcontrol broadcast --- backends/openpixelcontrol.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'backends/openpixelcontrol.c') diff --git a/backends/openpixelcontrol.c b/backends/openpixelcontrol.c index 168e077..2a5e01f 100644 --- a/backends/openpixelcontrol.c +++ b/backends/openpixelcontrol.c @@ -495,11 +495,11 @@ static ssize_t openpixel_client_headerdata(instance* inst, openpixel_client* cli } else{ client->buffer = openpixel_buffer_find(data, client->hdr.strip, 1); - } - //if no buffer or mode mismatch, ignore data - if(client->buffer < 0 - || data->mode != client->hdr.mode){ - client->buffer = -2; //mark for ignore + //if no buffer or mode mismatch, ignore data + if(client->buffer < 0 + || data->mode != client->hdr.mode){ + client->buffer = -2; //mark for ignore + } } client->left = be16toh(client->hdr.length); client->offset = 0; -- cgit v1.2.3 From 8773fca1f7d2ffed68b6af4967b537d989a1e5b5 Mon Sep 17 00:00:00 2001 From: cbdev Date: Mon, 20 Apr 2020 20:38:58 +0200 Subject: Print platform-specific error messages for socket calls --- backends/openpixelcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backends/openpixelcontrol.c') diff --git a/backends/openpixelcontrol.c b/backends/openpixelcontrol.c index 2a5e01f..1f8d46a 100644 --- a/backends/openpixelcontrol.c +++ b/backends/openpixelcontrol.c @@ -534,7 +534,7 @@ static int openpixel_client_handle(instance* inst, int fd){ ssize_t bytes = recv(fd, buffer, sizeof(buffer), 0); if(bytes <= 0){ if(bytes < 0){ - LOGPF("Failed to receive from client: %s", strerror(errno)); + LOGPF("Failed to receive from client: %s", mmbackend_socket_strerror(errno)); } //close the connection -- cgit v1.2.3 From a8be76f20b3eaa20b53e1cda7686845a08cef32b Mon Sep 17 00:00:00 2001 From: cbdev Date: Thu, 23 Apr 2020 23:38:36 +0200 Subject: Split mDNS socket into v4/v6 --- backends/openpixelcontrol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backends/openpixelcontrol.c') diff --git a/backends/openpixelcontrol.c b/backends/openpixelcontrol.c index 1f8d46a..f2dde23 100644 --- a/backends/openpixelcontrol.c +++ b/backends/openpixelcontrol.c @@ -48,7 +48,7 @@ static int openpixel_configure_instance(instance* inst, char* option, char* valu return 1; } - data->dest_fd = mmbackend_socket(host, port, SOCK_STREAM, 0, 0); + data->dest_fd = mmbackend_socket(host, port, SOCK_STREAM, 0, 0, 1); if(data->dest_fd >= 0){ return 0; } @@ -62,7 +62,7 @@ static int openpixel_configure_instance(instance* inst, char* option, char* valu return 1; } - data->listen_fd = mmbackend_socket(host, port, SOCK_STREAM, 1, 0); + data->listen_fd = mmbackend_socket(host, port, SOCK_STREAM, 1, 0, 1); if(data->listen_fd >= 0 && !listen(data->listen_fd, SOMAXCONN)){ return 0; } -- cgit v1.2.3