paraslash Paraslash Audio Streaming
About   News   Download   Documentation   Development

Macros | Enumerations | Variables
http_send.c File Reference

paraslash's http sender More...

#include <netinet/in.h>
#include <sys/socket.h>
#include <regex.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <sys/un.h>
#include <netdb.h>
#include <lopsub.h>
#include "server.lsg.h"
#include "para.h"
#include "error.h"
#include "string.h"
#include "afh.h"
#include "net.h"
#include "server.h"
#include "http.h"
#include "list.h"
#include "sched.h"
#include "send.h"
#include "vss.h"
#include "close_on_fork.h"
#include "fd.h"
#include "chunk_queue.h"

Macros

#define HTTP_ERR_MSG   "HTTP/1.0 400 Bad Request\n"
 Message sent to clients that do not send a valid get request. More...
 

Enumerations

enum  http_client_status { HTTP_CONNECTED, HTTP_GOT_GET_REQUEST, HTTP_STREAMING, HTTP_INVALID_GET_REQUEST }
 The possible states of a client from the server's POV. More...
 

Variables

const struct sender http_sender
 The HTTP sender. More...
 

Detailed Description

paraslash's http sender

Macro Definition Documentation

◆ HTTP_ERR_MSG

#define HTTP_ERR_MSG   "HTTP/1.0 400 Bad Request\n"

Message sent to clients that do not send a valid get request.

Enumeration Type Documentation

◆ http_client_status

The possible states of a client from the server's POV.

Enumerator
HTTP_CONNECTED 

We accepted the connection on the tcp socket.

HTTP_GOT_GET_REQUEST 

Successfully received the get request.

HTTP_STREAMING 

Connection is ready for sending audio data.

HTTP_INVALID_GET_REQUEST 

We didn't receive a valid get request.

Variable Documentation

◆ http_sender

const struct sender http_sender
Initial value:
= {
.name = "http",
.init = http_send_init,
.shutdown = http_shutdown,
.pre_monitor = http_pre_monitor,
.post_monitor = http_post_monitor,
.send = http_send,
.shutdown_clients = http_shutdown_clients,
.client_cmds = {
[SENDER_on] = http_com_on,
[SENDER_off] = http_com_off,
[SENDER_deny] = http_com_deny,
[SENDER_allow] = http_com_allow,
},
.status = http_status,
}

The HTTP sender.

This is the only sender which does not FEC-encode the stream. This is not necessary because HTTP sits on top of TCP, a reliable transport which retransmits lost packets automatically. The sender employs per-client queues which queue chunks of audio data if they can not be sent immediately because the write operation would block. Most methods of the sender are implemented as wrappers for the generic functions defined in send_common.c.

SENDER_on
@ SENDER_on
Activate the sender.
Definition: send.h:27
SENDER_off
@ SENDER_off
Deactivate the sender.
Definition: send.h:27
SENDER_allow
@ SENDER_allow
Allow connections from given IP address(es).
Definition: send.h:27
SENDER_deny
@ SENDER_deny
Deny connections from given IP address(es).
Definition: send.h:27
generic_sender_help
__malloc char * generic_sender_help(void)
Get the generic help text.
Definition: send_common.c:416