1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00

Feature: Seed PRNG with yp replies

This commit is contained in:
Philipp Schafft 2020-10-22 10:49:21 +00:00
parent 95cb2fcc8e
commit 299d86d18d

View File

@ -30,6 +30,7 @@
#include "cfgfile.h" #include "cfgfile.h"
#include "stats.h" #include "stats.h"
#include "listensocket.h" #include "listensocket.h"
#include "prng.h"
#ifdef WIN32 #ifdef WIN32
#define snprintf _snprintf #define snprintf _snprintf
@ -111,6 +112,8 @@ static size_t handle_returned_header (void *ptr, size_t size, size_t nmemb, void
ypdata_t *yp = stream; ypdata_t *yp = stream;
size_t bytes = size * nmemb; size_t bytes = size * nmemb;
prng_write(ptr, bytes);
/* ICECAST_LOG_DEBUG("header from YP is \"%.*s\"", bytes, ptr); */ /* ICECAST_LOG_DEBUG("header from YP is \"%.*s\"", bytes, ptr); */
if (strncasecmp (ptr, "YPResponse: 1", 13) == 0) if (strncasecmp (ptr, "YPResponse: 1", 13) == 0)
yp->cmd_ok = 1; yp->cmd_ok = 1;