#include "server.h"
#include "serverpool.h"
#include "input.h"
-#include "httpinput.h"
#include "stats.h"
#include "version.h"
#include "state.pb.h"
acceptor = deserialized_acceptor_it->second;
deserialized_acceptors->erase(deserialized_acceptor_it);
} else {
- int server_sock = create_server_socket(port);
+ int server_sock = create_server_socket(port, TCP_SOCKET);
acceptor = new Acceptor(server_sock, port);
}
acceptor->run();
if (input->get_url() != src) {
fprintf(stderr, "INFO: Stream '%s' has changed URL from '%s' to '%s', restarting input.\n",
stream_id.c_str(), input->get_url().c_str(), src.c_str());
+ input->close_socket();
delete input;
input = NULL;
}
deserialized_inputs->erase(deserialized_input_it);
}
if (input == NULL) {
- input = new HTTPInput(stream_id, src);
+ input = create_input(stream_id, src);
+ if (input == NULL) {
+ fprintf(stderr, "ERROR: did not understand URL '%s', clients will not get any data.\n",
+ src.c_str());
+ continue;
+ }
}
input->run();
inputs.push_back(input);
for (int i = 0; i < loaded_state.inputs_size(); ++i) {
deserialized_inputs.insert(make_pair(
loaded_state.inputs(i).stream_id(),
- new HTTPInput(loaded_state.inputs(i))));
+ create_input(loaded_state.inputs(i))));
}
// Convert the acceptor from older serialized formats.