Commit Graph

104 Commits

Author SHA1 Message Date
Martin Pulec
ec90eb0468 fix hd-rum-transcode crash
crashes since the commit ab5d2a5ca (2025-06-17)

That commit started to enforce existence of control socket, which is
not true in case of the reflector.

fixes ab5d2a5ca

closes GH-461
2025-08-13 09:04:53 +02:00
Martin Pulec
29063abc6d control_socket: suppress Windows warning
winsock2.h (include from utils/net.h) should be included prior to
windows.h, otherwise windows.h includes winsock.h (version 1), that
is incompatible. WIN32_LEAN_AND_MEAN causes some headers not being
included with windows.h (including winsock.h).
2025-06-20 14:59:19 +02:00
Martin Pulec
cda3d1b860 control_socket.cpp: IWYU 2025-06-18 08:49:44 +02:00
Martin Pulec
5c103173b1 control_socket: add magic + asserts 2025-06-18 08:49:44 +02:00
Martin Pulec
c31e1ffbcc control_socket: use logger instead of fprintf
- the errors will be red
- prefixed by MOD_NAME
2025-06-17 11:37:30 +02:00
Martin Pulec
497d6f5b17 fix other occurences of missing NL 2025-06-17 11:37:30 +02:00
Martin Pulec
fd08c583eb improved including in few files 2024-10-11 16:13:39 +02:00
Martin Pulec
56a6dc78b0 replace remaining WIN32 platform macros
see the commit HEAD@{2}
2024-05-13 12:56:53 +02:00
Martin Piatka
8c1b1d3a37 control_socket: Make reported audio ch count configurable
And raise the default to 16. Refers to GH-366
2024-01-22 14:56:19 +01:00
Martin Pulec
297661cd2a control_socket: fixed a leak
fixes CID 417382
2023-10-04 08:56:20 +02:00
Martin Pulec
7fc14c3d51 control: added commands to (un)mute audio
In addition to already existing "mute", that toggled mutte for the
receiver, [un]mute-{sender,receiver} was added, which mutes or unmutes
the sender or receiver.
2023-09-27 09:24:47 +02:00
Martin Pulec
4f362ac85f keycontrol interactive help: pretty-print
\+ render footnote at the end instead of inline
2023-09-25 16:29:04 +02:00
Martin Pulec
8a50ff4d2e audio messages: rename MUTE->MUTE_TOGGLE
* the MUTE commands are actually mute-toggle
2023-09-25 16:29:03 +02:00
Martin Pulec
9c015f96ad audio control: refactorize a bit
Moved all audio commands handled by control socket to single function.
2023-09-25 16:28:48 +02:00
Martin Pulec
fc491d02ec removed play/pause stuff
this stuff is no longer used (has been used by CoUniverse)
2023-06-29 16:30:30 +02:00
Martin Pulec
602095e38a fixed some further snprintf warns
fixes warnings with Xcode 14.3 as in previous commit

+ allocate +1 in Log_output buffer - snprintf(MULL, 0...) returns number
  of bytes without terminating '\0'. std::string storage isn't guaranteed
  to be NULL-terminated (std::string("").at(0) throws an exception). The
  buffer is somewhere preallocated 256 which prevents problem but it's
  better not to rely upon it.
+ comment out some unused function in LDGM that also triggered the
  warning but looked a bit suspicious so it was not clear how to fix
2023-04-12 12:52:07 +02:00
Martin Pulec
21b8e2e40f control socket: moved a init msg to control_start
When in control_init, it has been displayed eg. even on '-d gl:help'
while it was not accurate since the control_thread was newer run,
anyways.
2022-10-24 08:09:08 +02:00
Martin Pulec
0b157dae41 control socket: removed a duplicite function
already defined in utils/net.c
2022-10-21 09:07:42 +02:00
Martin Piatka
3acc296291 control_socket: Print listening port
This is useful when binding to a random port (--control-port 0)
2022-10-18 12:11:10 +02:00
Martin Pulec
a56a8c9c0b Fixed MSG_NOSIGNAL compat (defined in macOS 2022-03-30 16:51:34 +02:00
Martin Piatka
668df44a8e control_socket: Disallow "port n compress" messages 2022-02-02 13:47:39 +01:00
Martin Pulec
1b3b27eb7c Updated copyright dates for modified files 2021-11-08 15:43:14 +01:00
Martin Pulec
e90cdeb647 Removed msg_change_fec_data, use msg_universal
Removed msg_change_fec_data, use msg_universal instead.

This is a more versatile solution allowing further extensions without
a need to modify the global structure at an expese of worse type control.
As a replacement, a tag starting msg_universal::text is used/suggested.
2021-10-05 09:16:59 +02:00
Martin Piatka
eab94c12c0 Remove some unused includes
Removes some unused includes reported by include-what-you-use
2021-06-08 15:22:25 +02:00
Martin Pulec
efd2c70235 Platform pipe: use plain pipe if TCP compat fails
Use plain pipe if the TCP compat fails in Linux. This fixes a problem
when there is unavailable loopback connection (eg. running in a separate
network namespace with unassigned loopback address).
2020-11-10 14:04:28 +01:00
Martin Pulec
4132666cf2 Control socket: fixes
Fixed Win + fail on all errors
2020-08-24 16:17:01 +02:00
Martin Pulec
aa03b5d26f Control socket: perror->socket_error 2020-08-24 16:16:10 +02:00
Martin Pulec
48895b0783 ADD_TO_PARAM: salt is no longer needed
UNIQUE_NAME is used instead of the salt
2020-06-09 14:02:37 +02:00
Martin Pulec
07309035a5 Control: warn about unknown command 2020-04-21 18:27:57 +02:00
Martin Pulec
236f5b0589 Make: added target check and distcheck
+ added check for CppUnit
2019-11-19 08:22:50 +01:00
Martin Pulec
4c71573a89 Fixed first series of Coverity bugs 2019-11-09 17:20:37 +01:00
Martin Pulec
31d9809fcd Updated documentation
Updated authors, copyright to 3-clause BSD (where possible) and file-level Doxygen
2019-11-09 13:47:11 +01:00
Martin Pulec
822e8bf226 Print control help 2019-06-26 16:25:49 +02:00
Martin Pulec
6af07ef3e1 Allow control commands from UG terminal 2019-06-26 16:25:49 +02:00
Martin Pulec
ba632fe791 Main: improved help printing 2019-06-26 16:25:49 +02:00
Martin Pulec
087d9242cd Control socked: fixed socklen 2019-06-26 13:27:41 +02:00
Martin Pulec
cba809e293 Control socket: respect IP version selection
If user requests either -4 or -6 from command-line, the same value is
used for the control socket.
2019-06-07 15:13:08 +02:00
Martin Pulec
467cb49bd0 Control socket: use IPv4 if IPv6 not available 2019-06-07 15:12:59 +02:00
Martin Pulec
7db96528cf Name threads 2019-05-30 11:38:05 +02:00
Milos Liska
19938cfb79 Trivial compilation warning fix
src/control_socket.cpp: In function ‘void* control_thread(void*)’:
src/control_socket.cpp:574:44: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1009 [-Wformat-truncation=]
                 snprintf(buf, sizeof(buf), "(unknown path: %s)", path);
                                            ^~~~~~~~~~~~~~~~~~~~  ~~~~
src/control_socket.cpp:574:25: note: ‘snprintf’ output between 17 and 1040 bytes into a destination of size 1024
                 snprintf(buf, sizeof(buf), "(unknown path: %s)", path);
2018-10-17 19:32:42 +02:00
Martin Pulec
af700a8c8e Another small fixes 2018-08-28 10:08:56 +02:00
Martin Pulec
5567493bc6 Changed prototype of is_addr_loopback() 2018-08-24 09:13:06 +02:00
Martin Pulec
a7830d3bc2 Fixed few warnings 2018-07-24 09:38:47 +02:00
Martin Pulec
1e1017ec1a Control socket: make remote connections nonblock.
Use non-blocking socket for network connections since all sockets are
written sequentially. When one gets stuck it blocks the whole stack
(can be a case when a lot of data is produced - eg. statistics).
2018-04-24 10:51:49 +02:00
Martin Pulec
d30fb765a8 Control: report stats for audio 2018-04-24 09:59:32 +02:00
Martin Pulec
c65a90d7c5 Keyboard control: show port of control socket 2017-06-21 10:12:14 +02:00
Martin Pulec
4cd91b5387 Control socket: better error check 2017-03-17 12:21:55 +01:00
Martin Pulec
feae858c65 Validate optional commandline parameters 2017-02-23 16:30:43 +01:00
Martin Pulec
1c02c5e8b0 New way of documenting additional params (--param)
All parameters can now be listed with '--params help'.
2017-02-20 11:27:30 +01:00
Martin Pulec
c16a74d135 MSW: compat
Cleared mainly harmless warnings.
2017-02-15 10:19:12 +01:00