Changeset 7144

Show
Ignore:
Timestamp:
02/09/10 00:01:28 (7 months ago)
Author:
dbaelde
Message:

Fix #remaining in input.harbor/http: infinity when relaying, and the amount
of buffered data only when not streaming.
Also fix the max>buffer check: the case of equality is also non-functional.

Location:
trunk/liquidsoap/src/sources
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/liquidsoap/src/sources/harbor_input.ml

    r7122 r7144  
    3636  inherit Generated.source 
    3737            (Generator.create ~overfull:(`Drop_old max_ticks) `Undefined) 
    38             ~empty_on_abort:false ~bufferize 
     38            ~empty_on_abort:false ~bufferize as generated 
    3939 
    4040  val mutable relaying = false 
     
    195195  method is_taken = relaying 
    196196 
     197  method remaining = 
     198    if relaying then 
     199      if buffering then 0 else -1 
     200    else 
     201      generated#remaining 
     202 
    197203end 
    198204 
     
    304310         let bufferize = Lang.to_float (List.assoc "buffer" p) in 
    305311         let max = Lang.to_float (List.assoc "max" p) in 
    306          if bufferize > max then 
     312         if bufferize >= max then 
    307313           raise (Lang.Invalid_value 
    308314                    (List.assoc "max" p, 
  • trunk/liquidsoap/src/sources/http_source.ml

    r7122 r7144  
    194194    Generated.source 
    195195      (Generator.create ~overfull:(`Drop_old max_ticks) `Undefined) 
    196       ~empty_on_abort:false ~bufferize 
     196      ~empty_on_abort:false ~bufferize as generated 
    197197 
    198198  method stype = Source.Fallible 
     
    448448  method sleep = poll_should_stop <- true 
    449449 
     450  method remaining = 
     451    if relaying then 
     452      if buffering then 0 else -1 
     453    else 
     454      generated#remaining 
     455 
    450456end 
    451457 
     
    546552       let timeout = Lang.to_float (List.assoc "timeout" p) in 
    547553       let max = Lang.to_float (List.assoc "max" p) in 
    548        if bufferize > max then 
     554       if bufferize >= max then 
    549555         raise (Lang.Invalid_value 
    550556                  (List.assoc "max" p,