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: [EMAIL PROTECTED] | + | Reported By: [EMAIL PROTECTED] | + | 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
