Add TLS failure check

This commit is contained in:
calzoneman 2015-07-30 21:11:30 -07:00
parent 92b0747c0b
commit b0f65ded80

View file

@ -159,7 +159,7 @@ exports.ffprobe = function ffprobe(filename, cb) {
Logger.errlog.log("Possible runaway ffprobe process for file " + filename);
fflog("Killing ffprobe for " + filename + " after " + (TIMEOUT/1000) + " seconds");
childErr = new Error("File query exceeded time limit of 10 seconds");
child.kill('SIGKILL');
child.kill("SIGKILL");
}, TIMEOUT);
child.on("error", function (err) {
@ -172,6 +172,11 @@ exports.ffprobe = function ffprobe(filename, cb) {
child.stderr.on("data", function (data) {
stderr += data;
if (stderr.match(/the tls connection was non-properly terminated/i)) {
fflog("Killing ffprobe for " + filename + " due to TLS error");
childErr = new Error("Remote server closed connection unexpectedly");
child.kill("SIGKILL");
}
});
child.on("close", function (code) {
@ -239,7 +244,8 @@ exports.query = function (filename, cb) {
return cb("Link uses a protocol unsupported by this server's " +
"version of ffmpeg");
if (err.message.match(/exceeded time limit/)) {
if (err.message.match(/exceeded time limit/) ||
err.message.match(/remote server closed/i)) {
return cb(err.message);
}