paraslash Paraslash Audio Streaming
About   News   Download   Documentation   Development

Functions
recv_common.c File Reference

common functions of para_recv and para_audiod More...

#include <regex.h>
#include <inttypes.h>
#include <lopsub.h>
#include "recv_cmd.lsg.h"
#include "para.h"
#include "error.h"
#include "list.h"
#include "sched.h"
#include "buffer_tree.h"
#include "recv.h"
#include "string.h"

Functions

int check_receiver_arg (const char *ra, struct lls_parse_result **lprp)
 Check if the given string is a valid receiver specifier. More...
 
void print_receiver_helps (bool detailed)
 Print out the help texts to all receivers. More...
 
int generic_recv_pre_monitor (struct sched *s, struct receiver_node *rn)
 Request a minimal timeout in case of buffer tree errors. More...
 

Detailed Description

common functions of para_recv and para_audiod

Function Documentation

◆ check_receiver_arg()

int check_receiver_arg ( const char *  ra,
struct lls_parse_result **  lprp 
)

Check if the given string is a valid receiver specifier.

Parameters
rastring of the form receiver_name [options...]
lprpFilled in on success, undefined else.

This function checks whether ra starts with the name of a receiver, optionally followed by options for that receiver. If a valid receiver name was found the remaining part of ra is passed to the receiver's config parser.

If a NULL pointer or an empty string is passed as the first argument, the hhtp receiver with no options is assumed.

Returns
On success the number of the receiver is returned. On errors, the function calls exit(EXIT_FAILURE).

References alloc(), create_argv(), free_argv(), lls(), PARA_EMERG_LOG, PARA_ERROR_LOG, para_strdup(), para_strerror(), and RECV_CMD.

◆ print_receiver_helps()

void print_receiver_helps ( bool  detailed)

Print out the help texts to all receivers.

Parameters
detailedWhether to print the short or the detailed help.

References FOR_EACH_RECEIVER, and RECV_CMD.

◆ generic_recv_pre_monitor()

int generic_recv_pre_monitor ( struct sched s,
struct receiver_node rn 
)

Request a minimal timeout in case of buffer tree errors.

Parameters
sThe scheduler instance.
rnThe buffer tree node is derived from this.

If the buffer tree node of the given receiver node is in error or EOF state, a minimal I/O timeout is requested from the scheduler. Otherwise, the function does nothing. No file descriptors are asked to be monitored.

Returns
The status of of the receiver node's buffer tree node. That is, the return value of the underlying call to btr_node_status().

References btr_node_status(), BTR_NT_ROOT, receiver_node::btrn, and sched_min_delay().