diff options
author | cbdev <cb@cbcdn.com> | 2020-04-27 22:50:47 +0200 |
---|---|---|
committer | cbdev <cb@cbcdn.com> | 2020-04-27 22:50:47 +0200 |
commit | 1d8ed32bf769bc99095cd32ec166e681437607f0 (patch) | |
tree | bc94fd3a0245e91c15659916fc1c3591c7fb44b7 /backends/openpixelcontrol.c | |
parent | d4714dfdd5c6e2d165d1ad9327fdce69a1b2b85b (diff) | |
parent | c0bb55ff08faf2f89af947090d1c9bc412927d9f (diff) | |
download | midimonster-1d8ed32bf769bc99095cd32ec166e681437607f0.tar.gz midimonster-1d8ed32bf769bc99095cd32ec166e681437607f0.tar.bz2 midimonster-1d8ed32bf769bc99095cd32ec166e681437607f0.zip |
Merge branch 'master' into debian/master
Diffstat (limited to 'backends/openpixelcontrol.c')
-rw-r--r-- | backends/openpixelcontrol.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/backends/openpixelcontrol.c b/backends/openpixelcontrol.c index 168e077..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; } @@ -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; @@ -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 |