Railo
  1. Railo
  2. RAILO-1967

CFCONTENT range=yes => HTTP Status 200 is sent

    Details

    • Similar Issues:
      Show 10 results 

      Description

      Serving a file with <cfcontent range=yes> seems to sent the wrong status (200 instead of 206) for partial content. Line 208/209.

      HEAD requests (instead of GET) on <cfcontent range=yes> do not flush the headers, but send out the whole content. [currently I have a CF based workaround for that]

      Maybe it would make sense to improve Line 201: len=length-ranges[i].from+1; instead of len=-1;

      I'm still not sure, if this fixes all problems I have with content-ranges.

        Activity

        Hide
        Michael Forell
        added a comment -

        Hello Michael!

        this error can lead to massive stability problems, as IOUtily's copy(inputstream, outputstream, long, long) uses read(bytes), which seems to lock the file. If a user reads a file very slowly and with many locked threads, the server will not respond anymore!

        Regards
        Michael

        Show
        Michael Forell
        added a comment - Hello Michael! this error can lead to massive stability problems, as IOUtily's copy(inputstream, outputstream, long, long) uses read(bytes), which seems to lock the file. If a user reads a file very slowly and with many locked threads, the server will not respond anymore! Regards Michael
        Hide
        Michael Offner
        added a comment -

        Hi Michael
        yes streams get locked when java reads/writes from/to them, there is no way around this.
        http://docs.oracle.com/javase/1.4.2/docs/api/java/io/InputStream.html#read(byte[])

        i'm not sure what you exactly mean with this:
        "If a user reads a file very slowly and with many locked threads, the server will not respond anymore!"

        IOUtil copy or in the end the method read is not your problem, access to steams is exclusive and this is right this way.

        i think we have to draw a bigger picture here.

        please try me to explain what happens based on facts.

        Show
        Michael Offner
        added a comment - Hi Michael yes streams get locked when java reads/writes from/to them, there is no way around this. http://docs.oracle.com/javase/1.4.2/docs/api/java/io/InputStream.html#read(byte[ ]) i'm not sure what you exactly mean with this: "If a user reads a file very slowly and with many locked threads, the server will not respond anymore!" IOUtil copy or in the end the method read is not your problem, access to steams is exclusive and this is right this way. i think we have to draw a bigger picture here. please try me to explain what happens based on facts.
        Hide
        Michael Offner
        added a comment -

        testcase attached that test if simultan request to a cfcontent using the same picture is working, result is, is is working

        Show
        Michael Offner
        added a comment - testcase attached that test if simultan request to a cfcontent using the same picture is working, result is, is is working
        Hide
        Michael Offner
        added a comment -

        testcase attached with partial content returned, works as expected

        Show
        Michael Offner
        added a comment - testcase attached with partial content returned, works as expected
        Hide
        Michael Offner
        added a comment -
        Show
        Michael Offner
        added a comment - changed status code for particular response https://github.com/getrailo/railo/commit/055a7f949641e453c3df77a2e2806add964daae7

          People

          • Assignee:
            Michael Offner
            Reporter:
            Michael Forell
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: