Store Range:
header
This commit is contained in:
parent
70b9a513ad
commit
6d0492e35a
@ -114,6 +114,8 @@ int ffmpeg_remuxer_open(ffmpeg_remuxer_t *remuxer)
|
||||
|
||||
int ffmpeg_remuxer_close(ffmpeg_remuxer_t *remuxer)
|
||||
{
|
||||
if (remuxer->output_context)
|
||||
av_write_trailer(remuxer->output_context);
|
||||
ffmpeg_remuxer_close_avcontext(&remuxer->input_context);
|
||||
ffmpeg_remuxer_close_avcontext(&remuxer->output_context);
|
||||
av_packet_free(&remuxer->packet);
|
||||
|
11
http/http.c
11
http/http.c
@ -1,6 +1,9 @@
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
@ -13,8 +16,6 @@
|
||||
#include "http/http.h"
|
||||
#include "opts/log.h"
|
||||
|
||||
#define BUFSIZE 256
|
||||
|
||||
static int http_listen(int port, int maxcons)
|
||||
{
|
||||
struct sockaddr_in server = {0};
|
||||
@ -58,6 +59,8 @@ static void http_process(http_worker_t *worker, FILE *stream)
|
||||
return;
|
||||
}
|
||||
|
||||
worker->range_header[0] = 0;
|
||||
|
||||
// Consume headers
|
||||
for(int i = 0; i < 50; i++) {
|
||||
char line[BUFSIZE];
|
||||
@ -65,6 +68,10 @@ static void http_process(http_worker_t *worker, FILE *stream)
|
||||
return;
|
||||
if (line[0] == '\r' && line[1] == '\n')
|
||||
break;
|
||||
|
||||
if (strcasestr(line, "Range:") == line) {
|
||||
strcpy(worker->range_header, line);
|
||||
}
|
||||
}
|
||||
|
||||
worker->current_method = NULL;
|
||||
|
@ -11,6 +11,8 @@ typedef struct http_worker_s http_worker_t;
|
||||
|
||||
typedef void (*http_method_fn)(struct http_worker_s *worker, FILE *stream);
|
||||
|
||||
#define BUFSIZE 256
|
||||
|
||||
typedef struct http_method_s {
|
||||
const char *name;
|
||||
http_method_fn func;
|
||||
@ -29,7 +31,8 @@ typedef struct http_worker_s {
|
||||
int client_fd;
|
||||
struct sockaddr_in client_addr;
|
||||
char *client_host;
|
||||
char client_method[256];
|
||||
char client_method[BUFSIZE];
|
||||
char range_header[BUFSIZE];
|
||||
|
||||
http_method_t *current_method;
|
||||
} http_worker_t;
|
||||
|
Loading…
x
Reference in New Issue
Block a user