mirror of https://github.com/calzoneman/sync.git
Add TLS failure check
This commit is contained in:
parent
92b0747c0b
commit
b0f65ded80
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue