summaryrefslogtreecommitdiff
path: root/send.h (follow)
Commit message (Collapse)AuthorAge
* vss: Simplify initialize_fec_client().Andre Noll2026-04-11
| | | | | ->init_fec always points to udp_init_fec(), so make the function mandatory and remove the conditional.
* Switch to SPDX identifiers.Andre Noll2026-03-17
| | | | | | | | Generated with sed -i 's|Copyright.*Andre Noll.*|SPDX-License-Identifier: GPL-2.0 */|g' *.c *.h followed by manually tweaking the result a bit. No license change intended.
* Remove dccp remnants in comments.Andre Noll2026-03-01
| | | | | | | These two paragraphs were introduced by the doxygen topic branch. This branch was merged before the rm_dccp branch, so the text correctly referred to dccp. We missed to resolve this semantic conflict when the rm_dccp branch was merged because the merge did not result in a textual conflict.
* http_send.c: Move header_sent to struct private_http_sender_data.Andre Noll2026-01-26
| | | | | The udp sender does not need it. Convert it to bool and initialize it because the private_data structure of the http sender is allocated without zeroing.
* http_send.c: Move chunk queue into struct private_http_sender_data.Andre Noll2026-01-26
| | | | | | | | | | | The udp sender does not need it, so it should not be part of the sender-independent sender_client structure. Since shutdown_client() needs to derive the private_http_sender_data structure from the ->private_data pointer of the sender_client pointer, the declaration of struct private_http_sender_data has to move up. Since this structure depends on the http_client_status enumeration, the declaration of the enumeration needs to move up as well.
* struct sender: Remove unused sched pointer argument of ->post_monitor().Andre Noll2026-01-26
| | | | | Only the http sender implements ->post_monitor(), and does not use the argument.
* struct sender: Remove unused chunks_sent parameter of ->send().Andre Noll2026-01-26
| | | | | Only the http sender sets ->send() (to http_send()), and this function ignores the parameter.
* Move struct sender_status into http_send.c.Andre Noll2026-01-26
| | | | | It is only used there. In particular, the virtual streaming system does not need to know it.
* Move send_common.c into http_send.c.Andre Noll2026-01-26
| | | | | | | | | | | | With dccp gone, almost everything of send_common.c is specific to the http sender. The only exception is parse_fec_url(), which is called from com_sender() of command.c and from udp_send.c. Move this function to server.c and the rest to http_send.c. Make the latter static and dedoxify them. The generic_ function prefix indicates that the function works for both the http and the dccp transport. With dccp gone, this has become meaningless. We keep the prefix, though, to keep the patch small.
* Remove dccp.Andre Noll2026-01-26
| | | | | | | | | | | This removes all traces of dccp, specifically dccp_recv.c and dccp_send.c. The flowops related functions of net.c can go away as well, as flowops were only needed for the dccp transport. A few other functions are simplified by dropping the flowops or protocol parameter. Further cleanups are possible, but are deferred to subsequent commits. In particular, some functions of send_common.c are only called by the http transport now. These can be moved to http_send.c and then be made static.
* acl: Make default_deny a boolean.Andre Noll2025-11-16
| | | | It's used as a boolean, after all.
* Improve sender documentation.Andre Noll2025-10-08
| | | | | | The new detailed description of send.h and the SENDER_SUBCOMMANDS macro, and a bunch of small improvements to the data structures and the public functions of send_common.c.
* Compile with -Wsuggest-attribute=malloc.Andre Noll2023-12-24
| | | | | | | | | | | | We already employ this attribute extensively to help the compiler improve optimization. However, a few malloc-like functions were not yet marked with __malloc. Fix that and enable the warning to make sure that new malloc-like functions get marked. Since not all supported compilers know about this warning option, we need to check at compile time whether the option is supported. Thanks to the existing cc-option make(1) function, this is a simple one-liner for Makefile.real.
* Rename ->{pre,post}_select methods to ->{pre,post}_monitor.Andre Noll2022-08-25
| | | | | | | The word "monitor" is neutral and continues to be correct after the switch from select(2) to poll(2). Pure rename, nothing to see here.
* Misc documentation cleanups related to select().Andre Noll2022-08-25
| | | | | Assorted comment cleanups which avoid to talk about select(2) and fd sets. No code changes.
* send: Avoid select-specific arguments in {pre,post}_select().Andre Noll2022-08-25
| | | | | | | | | | Just pass a pointer to struct sched instead of the fd sets. Since two of the prototypes declared in send.h now refer to this structure, sched.h must be included before send.h. The udp sender implements neither ->pre_select() nor ->post_select(), so we only need to fix the order in which send.h and sched.h are included.
* net: Drop fd_set parameter from para_accept().Andre Noll2022-08-25
| | | | | | As for read_nonblock(), the parameter is dispensable because it is only used for an optimization to avoid a system call. Get rid of it because it hinders the conversion from select(2) to poll(2).
* vss: Fix harmless memory leaks at exit.Andre Noll2019-12-08
| | | | | | | The leaks were introduced in commit 4fbe16430b47 (server: Add --http-listen-address and --dccp-listen-address) from last year. Found by valgrind.
* send.h: Document cpp magic.Andre Noll2019-10-12
| | | | | These macros are not completely trivial, so give the interested reader an idea about how the macros help to avoid code duplication.
* Merge branch 'refs/heads/t/listen-address'Andre Noll2018-05-28
|\ | | | | | | | | | | | | | | | | | | | | | | A short series which adds options for para_server that allow the user to specify the listening addresses of the passive sockets. The resolution of the conflicts in server.c and send_common.c have been well tested and were cooking for a couple of weeks. * refs/heads/t/listen-address: server: Add --http-listen-address and --dccp-listen-address. server: Implement --listen-address for control service.
| * server: Add --http-listen-address and --dccp-listen-address.Andre Noll2018-04-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the http and the dccp sender accept connections on all IP addresses. This commit makes it possible to configure the senders to listen only on the specified subset of addresses. To make this work, the sender_status structure has to be extended to store an array of file descriptors rather than just a single one. Several places need to iterate over all listening sockets of the sender. The new FOR_EACH_LISTEN_FD macro helps to avoid duplicating the corresponding loop. The status part of the sender command now prints the listening addresses instead of just on/off. This is why we also maintain the ascii representation of the listening addresses in the sender_status structure and introduce the format_url() helper to format host/port pairs.
* | Merge branch 'refs/heads/t/clean_server_exit'Andre Noll2018-05-20
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This series removes many memory leaks of para_server by refactoring the shutdown and signal handling code. Most of the leaks happen only at shutdown and are hence harmless. But it is still good to plug the leaks because this puts more focus on real memory leaks in the valgrind output. The merge conflicted rather badly due to the changes introduced with the crypt branch that was merged last week. The resolution has been thoroughly tested, though. * refs/heads/t/clean_server_exit: (32 commits) command.c: Document return value of handle_connect(). user_list: Make list head static. afs: Allow database switching on sighup. afs: Free current mood or playlist on exit. afs: Free status items on exit. afs: Shutdown signals on exit. server: Free parse result also in afs. afs: Deplete user list at startup. server: Free audio file header on exit. sender: Deplete ACLs on exit. Remove some unused includes from {dccp,http}_send.c. server: Make argument of user_list_init() constant. server: Deplete user list on exit. server: Combine user_list_init() and populate(). server: Move para_fgets() to user_list.c. server: Initialize user list at compile time. server: Rename functions related to user lists. server: Constify return value of lookup_user(). server: Let stat command handler perform cleanup on signals. server: Have afs process close the current mood on exit(). ...
| * sender: Deplete ACLs on exit.Andre Noll2018-03-13
| | | | | | | | | | This teaches the dccp and the http sender to empty their access control lists during shutdown, avoiding some (harmless) memory leaks at exit.
| * server: Cleanly shut down senders on exit.Andre Noll2018-03-13
| | | | | | | | | | | | | | | | | | | | | | This introduces ->shutdown for struct sender. Each of the three senders implements the new method to close file descriptors and to deallocate the resources occupied by the sender. The method is only called on exit via the new vss_shutdown() from both server and command handler context after schedule() returns. We need to introduce another helper, process_is_command_handler(), to distinguish between the two callers.
| * server: Make array of senders constant.Andre Noll2018-03-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we define an array of static non-constant sender structures in vss.c with only ->init being initialized at compile time. At startup the ->init method of each sender must fill out the other function pointers of the structure. This approach is kind of pointless, as these pointers are known at compile time and never change. This patch changes the three senders to define a non-static constant sender structure instead. The vss maintains an array of pointers to these structures. Since the new sender structures are non-static, they need to be doxified. We use the opportunity to provide an overview of each sender. The patch also introduces FOR_EACH_SENDER(), a macro which is used several times to replace the open-coded loops we had before.
* | send_common: Improve error diagnostics of generic_com_on().Andre Noll2018-04-17
|/ | | | | | | | | | | | Currently the function returns an error code but does not log a message on errors. The callers, http_send_init() and dccp_send_init(), print the strerror text with no indication that it is was generic_com_on() which caused the error. This commit moves the log messages from the callers to generic_com_on() and changes the return type of generic_com_on() to void because both callers now ignore the return value. The new log messages include a text which tells the user what went wrong.
* Shorten copyright notice.Andre Noll2017-09-22
| | | | | | | | | | | | | | | | | | | | | The GPLv2 line does not add any additional information, so drop it. This leaves a single line of legalese text for most files, which is about the amount of screen real estate it deserves. This patch was created with the following script (plus some manual fixups): awk '{ if (NR <= 5) { gs = gensub(/.*Copyright.* ([0-9]+).*Andre Noll.*/, "\\1", "g") if (gs != $0) year = gs next } if (NR == 6 && year != "") printf("/* Copyright (C) %s Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */\n", year) print }'
* doxygen: Add \ref to references.Andre Noll2017-06-25
| | | | | This way doxygen issues a warning if the file/function/structure no longer exists and a stale reference remains.
* Convert para_server to lopsub.Andre Noll2017-03-26
| | | | | | | | | | | | | | | | | | | | This is the last executable to be converted to lopsub. acl_init() is removed from acl.c, and the initialization of the access control list is moved to init_sender_status() of send_common.c. It now takes an lls_opt_result argument and calls acl_add_entry() for each argument given. The latter function needs to be made public. In dccp_send.c we check the FEC parameters and change the gengetopt config structure to contain the default values if invalid FEC parameters were given. With lopsub this is no longer possible as the lls_parse_result structure is opaque. We copy the FEC parameters to a dccp_fec_client structure anyway, so is it easiest to move the check there. The patch removes the unused gengetopt option files but leaves the gengetopt infrastructure of the build system in place. The build system will be cleaned up in subsequent patches.
* Avoid duplication of sender subcommands.Andre Noll2015-11-13
| | | | | | | | | | | | | | | | | | The list of sender subcommands (add, delete, allow, deny, on, off) is defined as an enumeration in send.h. This list is duplicated in check_sender_args() of command.c which contains the six subcommands as C-strings to be matched against the first word of the sender command line. For the code to work properly it is essential that the two subcommand lists are identical, which is a bad design that is quite error prone. Fortunately it is easy to avoid the duplication with a little preprocessor fu. Since the subcommands are spelled in lower case and there is no toupper function in CPP, we need to change the subcommand part of the enumeration constants to lower case. The bulk of the patch consists in trivial changes of all the users of these constants.
* Update year in copyright headers.Andre Noll2015-01-12
| | | | | | | | | | | | | | | | Done with files=$(git grep -l 'Copyright (C) [0-9]\{4\}\(-2014\)* Andre Noll') sed --in-place= -e 's/Copyright (C) \([0-9]\{4\}\)-2014 Andre Noll/Copyright (C) \1 Andre Noll/1' $files In previous years we ran a similar script to set the second year in the range to the current year. This is kind of silly, so let's get rid of this useless information. This commit replaces "Copyright (C) A-B" by "Copyright (C) A" in all file headers, i.e. only the first year (A) is left in. Accurate information including time stamps for each change can be obtained from the git history.
* Merge branch 'refs/heads/t/server_cmds'Andre Noll2014-10-09
|\ | | | | | | | | | | | | | | | | | | | | | | | | Was cooking for three weeks. * Add sender subcommand "status". * com_si(): Don't print git version string. * Doxify the sender_subcommand enum. * Overhaul help texts of server and afs commands. * com_sender: Replace memcpy by struct copy. Conflicts: command.c
| * Add sender subcommand "status".Andre Noll2014-08-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the si (server info) command prints information about each sender, like the number of connected clients and the access control lists. As this information is related to senders, the sender command seems to be a better fit. This commit introduces the new sender subcommand "status" for this purpose and changes com_si() to not print the sender information any more, making the output of com_si() bounded. It also renames the ->info() function of the senders to ->status() to make it clear that this function is related to the new status subcommand. The Networking paragraph of the manual is adjusted accordingly and now contains an example of the status command.
| * Doxify the sender_subcommand enum.Andre Noll2014-08-14
| | | | | | | | This adds comments to all sender commands and switches to a named enum.
* | doc: Change email address to maan@tuebingen.mpg.deAndre Noll2014-08-18
|/ | | | | | | | | | | | | | The mail server on systemlinux.org was down for more than a week lately, so let's use an alternative official address. This commit changes all maan@systemlinux.org addresses to maan@tuebingen.mpg.de. Most .c and .h files contain the email address in the copyright header, so they must all be patched. Three other files contain the address for a different reason: * README lists email and git, gitweb and home page URLs * configure.ac needs it for configure -h * version.c contains it for the -V option of all commands
* Change copyright year to 2014.Andre Noll2014-02-22
| | | | | | | | | This year, we're really on time. The changes in this patch were created by the following silly script: files=$(git grep -l 'Copyright (C) [0-9]\{4\}\(-2013\)* Andre Noll') sed --in-place= -e 's/Copyright (C) \([0-9]\{4\}\)-2013 Andre Noll/Copyright (C) \1-2014 Andre Noll/1' $files sed --in-place= -e 's/Copyright (C) 2013 Andre Noll/Copyright (C) 2013-2014 Andre Noll/1' $files
* Change copyright year to 2013.Andre Noll2013-03-25
| | | | Better late than never.
* Change year in copyright message to 2012.Andre Noll2012-01-07
|
* send: Make ->send_fec() return void.Andre Noll2011-12-18
| | | | | There is only one caller, vss_send(), which ignores the return value. So there is no point in returning an error code from this method.
* Merge branch 't/periodic_header_optional'Andre Noll2011-01-22
|\
| * vss: Let the transport specify whether periodic headers are necessary.Andre Noll2010-11-27
| | | | | | | | | | | | | | | | This adds the new flag need_periodic_header to struct fec_client_parms. It is true for the UDP transport and false for the DCCP transport. vss checks this flag in need_audio_header() and does not send the header periodically if the flag is false.
* | Replace 2010 in copyright message by 2011.Andre Noll2011-01-17
|/
* Remove FEC parameter max_slice_bytes.Andre Noll2010-10-31
| | | | | | | | It is no longer a FEC parameter as its value is determined at runtime from the MPS of the connection. So replace ->max_slice_bytes of struct fec_client_parms by the new ->mps field of struct fec_client.
* sender: add a hook to resolve target namesGerrit Renker2010-06-23
| | | | | | | This adds a function pointer to interpret and resolve a given URL string in a target-specific manner, filling in the target's defaults if omitted. The hook is used for the add/delete commands, currently implemented for UDP.
* Move send_chunk() from send_common.c to http_send.c.Andre Noll2010-06-09
| | | | | | | Due to the previous changes, this function is no longer a generic function as it is only used by the http sender. So move it to http_send.c and make it static, along with the queue_chunk_or_shutdown() helper which is only called from send_chunk().
* cleanup: remove redundant 'max length' argumentGerrit Renker2010-06-07
| | | | | | | | This removes the redundant 'max_size_bytes' argument of * write_nonblocking(), * send_queued_chunks(), and * send_chunk(), since it was set to 0 in all cases.
* sender: clean up old FEC APIGerrit Renker2010-06-07
| | | | | | | After the preceding two patches integrated the new function pointers, this patch removes the now obsolete open() and send_fec() pointers which are no longer referenced anywhere. It also reorders send.h to get rid of forward declarations.
* vss: unify calls to the FEC layerGerrit Renker2010-06-07
| | | | | | | | | | | | | | | | | This reorganizes the internal vss data structures a bit to unify calls to the FEC layer across different senders: * each sender supplies its sender_client data via the 'sc' pointer; * the init_fec()/send_fec() function pointers are now parameters (so that a global variable is not needed); * both these functions then operate on the supplied sender_client data; * the transport layer can then interpret the sender_client data in specific ways, e.g. by accessing sc->private_data; * a new 'ready' flag has been added to track transport-layer state; * max_slice_size as paramter has been restored (for overriding MPS value). Note: this is one patch out of several. It comments out now-incompatible changes in the API for the sake of being able to compile. However, the new global API requires the whole set of patches to be applied.
* Basic infrastructure changes for FEC/DCCP support.Andre Noll2010-06-07
| | | | | | | | | | | | | | | This patch allows to add a FEC client without specifying the FEC parameters. Instead, these parameters are set at stream start time via the new ->open() method of the senders. It is desirable to defer ssetting the FEC parameters to allow dynamic determination of the slice size. We need an established connection to find out the best value for the slice size, but the UDP sender currently has to fix the slice size at target add time, which is too early. The slice size for the UDP and the DCCP sender are currently hardcoded values; this will be fixed by subsequent patches.
* Rework para_accept().Andre Noll2010-04-25
| | | | | | | | | Make it take an fd_set pointer and check the fd for readability within para_accept() rather than in each caller. Also, don't return an error on EAGAIN. Fix all callers accordingly. Most of them become a bit simpler due to this change.