Dear Cognoscenti,

We have recently been getting a few requests with abnormal Range request
headers.  For example

          Accept-Language: zh-cn,zh-hk,zh-tw,en-us
          User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
          Accept: */*
          Host: www.mydomain.com
          Connection: Keep-Alive
          Range: bytes=-335544320--1162852624
          Accept-Encoding: gzip
          X-Forwarded-For: 124.115.0.146

This results in an exception like this:

java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at com.caucho.vfs.WriteStream.write(WriteStream.java:301)
at
com.caucho.server.connection.ResponseStream.writeNext(ResponseStream.java:445)

at
com.caucho.server.connection.ToByteResponseStream.write(ToByteResponseStream.java:336)

at
com.caucho.server.connection.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:67)

at com.caucho.vfs.ReadStream.writeToStream(ReadStream.java:899)
at com.caucho.servlets.FileServlet.handleRange(FileServlet.java:498)
at com.caucho.servlets.FileServlet.service(FileServlet.java:325)
at
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)

at
com.caucho.server.webapp.NamedDispatcherImpl.forward(NamedDispatcherImpl.java:108)

at com.mydomain.www.MyServlet.doGet(BaseServlet.java:167)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:114)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:91)
at
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)

at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187)

at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:265)

at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:273)
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:682)
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:730)
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:649)
at java.lang.Thread.run(Thread.java:595)
   *Description*
    2009-11-14 14:21:58,125 ERROR [http-httpd-12180-7$799557599]
estalea.bucket.servlet.BaseServlet : HTTPRequest      Request: GET /
Session Id: none      Attributes:           javax.servlet.error.servlet_name
= resin-file      Headers:           Accept-Language:
zh-cn,zh-hk,zh-tw,en-us           User-Agent: Mozilla/4.0 (compatible; MSIE
6.0; Windows NT 5.1)           Accept: */*           Host: ojrq.net
 Connection: Keep-Alive           Range: bytes=-335544320--1162852624
   Accept-Encoding: gzip           X-Forwarded-For: 124.115.0.146      Host:
10.16.4.8 at address 10.16.4.8      java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method) at
com.caucho.vfs.WriteStream.write(WriteStream.java:301) at
com.caucho.server.connection.ResponseStream.writeNext(ResponseStream.java:445)
at
com.caucho.server.connection.ToByteResponseStream.write(ToByteResponseStream.java:336)
at
com.caucho.server.connection.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:67)
at com.caucho.vfs.ReadStream.writeToStream(ReadStream.java:899) at
com.caucho.servlets.FileServlet.handleRange(FileServlet.java:498) at
com.caucho.servlets.FileServlet.service(FileServlet.java:325) at
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
at
com.caucho.server.webapp.NamedDispatcherImpl.forward(NamedDispatcherImpl.java:108)
at
estalea.ir.tracking.click.BrandedUrlServlet.doService(BrandedUrlServlet.java:64)
at estalea.bucket.servlet.BaseServlet.serviceWrapper(BaseServlet.java:191)
at estalea.bucket.servlet.BaseServlet.doGet(BaseServlet.java:167) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:114) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:91) at
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187)
at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:265)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:273) at
com.caucho.server.port.TcpConnection.run(TcpConnection.java:682) at
com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:730) at
com.caucho.util.ThreadPool$Item.run(ThreadPool.java:649) at
java.lang.Thread.run(Thread.java:595)
Show ยป <https://jira.estalea.net/jira/browse/IRT-2667>


(I'm forwarding the request to the FileServlet).  No harm done here, the
requests seems to fail
without causing any other side effects, but I'm wondering if the FileServlet
should handle the
situation a little more gracefully and give a 4xx response code instead of
throwing an exception,
which ends up being a 5xx response code.

This is Resin 3.1.8 btw.

Thanks,

Knut Forkalsrud
_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to