luetzkendorf 2004/08/12 07:06:52
Modified: src/webdav/server/org/apache/slide/webdav/method Tag:
SLIDE_2_1_RELEASE_BRANCH AbstractWebdavMethod.java
LockMethod.java OptionsMethod.java
Log:
fixed problems with requests that have no content and not content-length
header (e.g. the OPTIONS request from DavExplorer)
Revision Changes Path
No revision
No revision
1.43.2.1 +10 -3
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AbstractWebdavMethod.java
Index: AbstractWebdavMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AbstractWebdavMethod.java,v
retrieving revision 1.43
retrieving revision 1.43.2.1
diff -u -r1.43 -r1.43.2.1
--- AbstractWebdavMethod.java 3 Aug 2004 14:01:03 -0000 1.43
+++ AbstractWebdavMethod.java 12 Aug 2004 14:06:51 -0000 1.43.2.1
@@ -400,6 +400,8 @@
try {
token.rollback();
} catch (Exception e) {
+ // TODO
+ e.printStackTrace();
}
}
if (slideToken.isExternalTransaction()) {
@@ -551,6 +553,11 @@
return false;
}
+ protected boolean isRequestChunked() {
+ String te = req.getHeader("Transfer-Encoding");
+ if (te == null) return false;
+ return te.indexOf("chunked") != -1;
+ }
/**
* Parse WebDAV XML query.
1.69.2.2 +4 -4
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LockMethod.java
Index: LockMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/LockMethod.java,v
retrieving revision 1.69.2.1
retrieving revision 1.69.2.2
diff -u -r1.69.2.1 -r1.69.2.2
--- LockMethod.java 10 Aug 2004 19:37:04 -0000 1.69.2.1
+++ LockMethod.java 12 Aug 2004 14:06:52 -0000 1.69.2.2
@@ -175,7 +175,7 @@
lockDuration = requestHeaders.getTimeout(MAX_TIMEOUT);
- if (req.getContentLength() != 0) {
+ if (req.getContentLength() > 0 || isRequestChunked()) {
parseLockInfo();
} else {
lockType = LOCK_REFRESH;
1.44.2.2 +4 -4
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/OptionsMethod.java
Index: OptionsMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/OptionsMethod.java,v
retrieving revision 1.44.2.1
retrieving revision 1.44.2.2
diff -u -r1.44.2.1 -r1.44.2.2
--- OptionsMethod.java 10 Aug 2004 19:37:04 -0000 1.44.2.1
+++ OptionsMethod.java 12 Aug 2004 14:06:52 -0000 1.44.2.2
@@ -86,7 +86,7 @@
protected void parseRequest() throws WebdavException {
- if( req.getContentLength() != 0 ) {
+ if( req.getContentLength() > 0 || isRequestChunked()) {
try {
Iterator i =
parseRequestContent(E_OPTIONS).getChildren().iterator();
while( i.hasNext() ) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]