~ubuntu-branches/ubuntu/trusty/rygel/trusty

« back to all changes in this revision

Viewing changes to tests/rygel-http-seek_http-get.vala

  • Committer: Package Import Robot
  • Author(s): Andreas Henriksson
  • Date: 2011-12-16 15:21:25 UTC
  • mfrom: (14.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20111216152125-qgn31dkfmhouhrf0
Upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
                     int64        start,
41
41
                     int64        stop,
42
42
                     int64        step,
43
 
                     int64        total_length) {
 
43
                     int64        total_length) throws HTTPSeekError {
44
44
        this.msg = msg;
45
45
        this.start = start;
46
46
        this.stop = stop;
47
47
        this.length = length;
48
48
        this.total_length = total_length;
49
49
 
 
50
        if (start < 0 || start > total_length) {
 
51
            throw new HTTPSeekError.OUT_OF_RANGE (_("Out Of Range Start '%ld'"),
 
52
                                                  start);
 
53
        }
 
54
        if (stop < 0 || stop > total_length) {
 
55
            throw new HTTPSeekError.OUT_OF_RANGE (_("Out Of Range Stop '%ld'"),
 
56
                                                  stop);
 
57
        }
 
58
 
50
59
        if (length > 0) {
51
60
            this.stop = stop.clamp (start + 1, length - 1);
52
61
        }