void record(int(*open_fn)(char *), char *url, char *outfile, int duration)
{
void record(int(*open_fn)(char *), char *url, char *outfile, int duration)
{
do {
if ((bytes = recv(in, buffer, CHUNKSIZE, 0)) < 1) {
/* TODO: Insert better connection-loss recovery here */
do {
if ((bytes = recv(in, buffer, CHUNKSIZE, 0)) < 1) {
/* TODO: Insert better connection-loss recovery here */