Преглед изворни кода

always use --keep-connection mode

Gil Pedersen пре 13 година
родитељ
комит
befa3778de
1 измењених фајлова са 6 додато и 3 уклоњено
  1. 6 3
      bin/hlsdump

+ 6 - 3
bin/hlsdump

@@ -22,7 +22,6 @@ hlsdump.version('0.0.0')
      return parseInt(val, 0);
    })
    .option('-s, --sync', 'clock sync using stream PCR')
-   .option('-k, --keep-connection', 'don\'t give up once connected')
    .option('-f, --full-stream', 'fetch all stream data')
    .option('-c, --concurrent <count>', 'fetch using concurrent connections', parseInt)
    .option('-a, --user-agent <string>', 'HTTP User-Agent')
@@ -76,8 +75,12 @@ r.on('readable', function() {
   grabnext();
 });
 
-r.on('error', function(err) {
-  console.error('reader error', err.stack || err);
+r.once('index', function() {
+  // wait until first index is returned before attaching error listener.
+  // this will enable initials errors to throw
+  r.on('error', function(err) {
+    console.error('reader error', err.stack || err);
+  });
 });
 
 r.on('end', function() {