You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2001/06/19 20:42:46 UTC
[Bug 2237] New: - libWWW redirect error
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2237
*** shadow/2237 Tue Jun 19 11:42:46 2001
--- shadow/2237.tmp.25054 Tue Jun 19 11:42:46 2001
***************
*** 0 ****
--- 1,53 ----
+ +============================================================================+
+ | libWWW redirect error |
+ +----------------------------------------------------------------------------+
+ | Bug #: 2237 Product: Xerces-C |
+ | Status: NEW Version: 1.5 |
+ | Resolution: Platform: Alpha |
+ | Severity: Normal OS/Version: Other |
+ | Priority: Other Component: Utilities |
+ +----------------------------------------------------------------------------+
+ | Assigned To: xerces-c-dev@xml.apache.org |
+ | Reported By: Artur.Klauser@computer.org |
+ | CC list: Cc: |
+ +----------------------------------------------------------------------------+
+ | URL: |
+ +============================================================================+
+ | DESCRIPTION |
+ Trying to access e.g. external entity references which point to URIs resulting
+ in redirect response from server confuses NetAccess internal state.
+
+ When a redirection is processed in libWWW, it seems that
+ HTAnchor_length(anchor) == -1 on the original anchor, whereas
+ HTResponse_length(response) gives the correct content length of
+ the redirection target. This has confusedfRemoteFileSize and it was
+ not checked for a -1 response at all.
+
+ Here is the patch:
+ # diff -c BinURLInputStream.cpp BinURLInputStream.cpp.orig
+ *** BinURLInputStream.cpp Tue Jun 19 14:30:48 2001
+ --- BinURLInputStream.cpp.orig Tue Jun 19 14:29:11 2001
+ ***************
+ *** 158,170 ****
+ {
+ // I am not happy at all with the error handling. So that needs to
+ // happen.
+ ! HTResponse * response = HTRequest_response (request);
+ ! fRemoteFileSize = HTResponse_length(response);
+ ! if (fRemoteFileSize < 0)
+ ! {
+ ! ThrowXML1(NetAccessorException, XMLExcepts::NetAcc_InternalError,
+ ! "Cannot determine length of remote file.");
+ ! }
+ }
+
+ // Cleanup, before you throw any errors.
+ --- 158,165 ----
+ {
+ // I am not happy at all with the error handling. So that needs to
+ // happen.
+ ! HTParentAnchor* parentAnchor = HTAnchor_parent(fAnchor);
+ ! fRemoteFileSize = HTAnchor_length(parentAnchor);
+ }
+
+ // Cleanup, before you throw any errors.
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org