Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-1044

ServerAdapter contentLength vs contentCount

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 1.1.2
    • logback-access
    • None

    Description

      Hi,

      I noticed that the implementation of ServerAdapter.getContentLength() is not the same for Tomcat and Jetty :

      • Tomcat's one use response.getContentLength()
      • Jetty's one use response.getContentCount()

      Both expose response.getContentLength() and response.getContentCount(), and I understand that contentLength is the value from the response's header, while contentCount is the number of bytes actually written to the output stream.

      So I think that ServerAdapter.getContentLength() should always use the underlying response.getContentLength(), and maybe we can add another method ServerAdapter.getContentCount() is people want to retrieve this value too.

      What do you think ?

      Attachments

        Activity

          People

            logback-dev Logback dev list
            vbehar Vincent Behar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: