summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroskwon <kos@dev3>2014-06-29 07:12:10 (GMT)
committeroskwon <kos@dev3>2014-06-29 07:12:10 (GMT)
commitb55a219498eeceb63a98dcfdc7597b7c40d6977c (patch)
treeb25b257b1294285d54d45c61bec5a3282ff3843f
parent6a65bf73299e93bad0258e881e7ddb470fb955a9 (diff)
Support backward compatibility.
-rw-r--r--src/Http.cpp19
-rw-r--r--src/Http.h3
-rw-r--r--src/main.cpp1
3 files changed, 19 insertions, 4 deletions
diff --git a/src/Http.cpp b/src/Http.cpp
index 1f410c0..161b288 100644
--- a/src/Http.cpp
+++ b/src/Http.cpp
@@ -62,8 +62,13 @@ bool HttpHeader::parse_request(std::string header)
}
}
- if (page == "/file_stream") {
- type = HttpHeader::TRANSCODING_FILE;
+ if (page == "/file") {
+ if (page_params["check"] == "valid") {
+ type = HttpHeader::TRANSCODING_FILE_CHECK;
+ }
+ else {
+ type = HttpHeader::TRANSCODING_FILE;
+ }
}
else if (page == "/m3u") {
type = HttpHeader::M3U;
@@ -87,6 +92,14 @@ std::string HttpHeader::build_response(Mpeg *source)
std::ostringstream oss;
switch(type) {
+ case HttpHeader::TRANSCODING_FILE_CHECK: {
+ oss << http_ok;
+ oss << http_connection;
+ oss << "Content-Type: text/plain\r\n";
+ oss << http_server;
+ oss << http_done;
+ }
+ break;
case HttpHeader::TRANSCODING_FILE: {
std::string range = params["Range"];
off_t seek_offset = 0, content_length = 0;
@@ -130,7 +143,7 @@ std::string HttpHeader::build_response(Mpeg *source)
std::ostringstream m3u_oss;
m3u_oss << "#EXTM3U\n";
m3u_oss << "#EXTVLCOPT--http-reconnect=true\n";
- m3u_oss << "http://" << params["Host"] << "/file_stream?file=" << page_params["file"];
+ m3u_oss << "http://" << params["Host"] << "/file?file=" << page_params["file"];
if (page_params["position"] != "") {
m3u_oss << "&position=" << page_params["position"];
}
diff --git a/src/Http.h b/src/Http.h
index 69f7a09..6c54d95 100644
--- a/src/Http.h
+++ b/src/Http.h
@@ -21,7 +21,8 @@ public:
UNKNOWN = 0,
TRANSCODING_LIVE,
TRANSCODING_FILE,
- M3U
+ M3U,
+ TRANSCODING_FILE_CHECK
};
int type;
diff --git a/src/main.cpp b/src/main.cpp
index 4d5da36..93197bd 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -105,6 +105,7 @@ int main(int argc, char **argv)
throw(e);
}
break;
+ case HttpHeader::TRANSCODING_FILE_CHECK:
case HttpHeader::M3U:
try {
std::string response = header.build_response((Mpeg*) source);