Revision: 8113
Author: [email protected]
Date: Wed May 12 09:47:07 2010
Log: Fixes a bug in RequestFactoryServlet.getContent that corrupts
POST data is it spans more than a single read.

http://code.google.com/p/google-web-toolkit/source/detail?r=8113

Modified:
/branches/2.1/bikeshed/src/com/google/gwt/requestfactory/server/RequestFactoryServlet.java

=======================================
--- /branches/2.1/bikeshed/src/com/google/gwt/requestfactory/server/RequestFactoryServlet.java Mon May 10 13:04:43 2010 +++ /branches/2.1/bikeshed/src/com/google/gwt/requestfactory/server/RequestFactoryServlet.java Wed May 12 09:47:07 2010
@@ -332,9 +332,11 @@
     byte contentBytes[] = new byte[contentLength];
BufferedInputStream bis = new BufferedInputStream(request.getInputStream());
     try {
-      int readBytes = 0;
- while (bis.read(contentBytes, readBytes, contentLength - readBytes)
0) {
-        // read the contents
+      int contentBytesOffset = 0;
+      int readLen;
+      while ((readLen = bis.read(contentBytes, contentBytesOffset,
+          contentLength - contentBytesOffset)) > 0) {
+        contentBytesOffset += readLen;
       }
       // TODO: encoding issues?
       return new String(contentBytes);

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to