From 2d360cb08d2bee098168e3c3f5041ec37206f383 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 9 Feb 2012 07:44:23 -0500 Subject: Use new 3p-apr package builds for Windows, Mac. On Linux, new (Feb 2012) APR package produces link errors. Until those are resolved, leave Linux viewer build with older (Feb 2011) APR package. --- autobuild.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index 9914be6867..9cecdd7f09 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -90,9 +90,9 @@ archive hash - 9868bfa0b6954e4884c49c6f30068c80 + 6e5172597f00380b5004b8a7911098b7 url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/apr_suite-1.4.2-darwin-20110217.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/249125/arch/Darwin/installer/apr_suite-1.4.5-darwin-20120208.tar.bz2 name darwin @@ -114,9 +114,9 @@ archive hash - 73785c200a5b4ef74a1230b028bb680d + a596a9974ae6bfe48dc61a2cd13bc321 url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/apr_suite-1.4.2-windows-20110217.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/249125/arch/CYGWIN/installer/apr_suite-1.4.5-windows-20120208.tar.bz2 name windows -- cgit v1.3 From 58348bd862163261fb650d8afd50fd1dc5e2695a Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 9 Feb 2012 15:07:02 -0500 Subject: Use newer (Linden extension) TC APR builds for Windows, Mac. --- autobuild.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index 9cecdd7f09..80b1a8a709 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -90,9 +90,9 @@ archive hash - 6e5172597f00380b5004b8a7911098b7 + 71d4d242c41ec9ac4807989371279708 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/249125/arch/Darwin/installer/apr_suite-1.4.5-darwin-20120208.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/249241/arch/Darwin/installer/apr_suite-1.4.5-darwin-20120209.tar.bz2 name darwin @@ -114,9 +114,9 @@ archive hash - a596a9974ae6bfe48dc61a2cd13bc321 + 983378883a6eec65665875a3d1ba495f url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/249125/arch/CYGWIN/installer/apr_suite-1.4.5-windows-20120208.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/249241/arch/CYGWIN/installer/apr_suite-1.4.5-windows-20120209.tar.bz2 name windows -- cgit v1.3 From 9011b04496796d7e51c20af0241ec05796e1ccac Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 10 Feb 2012 12:11:18 -0500 Subject: Try using Log's new APR packages for Windows, Mac, Linux. This APR merges work from Huseby, Log, Leslie, Nat. --- autobuild.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index 80b1a8a709..a3a5dd0057 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -90,9 +90,9 @@ archive hash - 71d4d242c41ec9ac4807989371279708 + a2c41379bc0abc83b45246eebdafc4ab url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/249241/arch/Darwin/installer/apr_suite-1.4.5-darwin-20120209.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/log_3p-apr/rev/249247/arch/Darwin/installer/apr_suite-1.4.5-darwin-20120209.tar.bz2 name darwin @@ -102,9 +102,9 @@ archive hash - ff62946c518a247c86e1066c1e9a5855 + 1ad6e6bff18306cb5079128d5aadeb6e url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/apr_suite-1.4.2-linux-20110309.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/log_3p-apr-lenny/rev/249247/arch/Linux/installer/apr_suite-1.4.5-linux-20120209.tar.bz2 name linux @@ -114,9 +114,9 @@ archive hash - 983378883a6eec65665875a3d1ba495f + 31cd12ea119753e389dc9be5ea82cbb3 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/249241/arch/CYGWIN/installer/apr_suite-1.4.5-windows-20120209.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/log_3p-apr/rev/249247/arch/CYGWIN/installer/apr_suite-1.4.5-windows-20120209.tar.bz2 name windows -- cgit v1.3 From 8804fa524c084edb9f49f4122e2c7330a80c79b5 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 11 Feb 2012 06:16:39 -0500 Subject: Update viewer to official builds of http://hg.secondlife.com/3p-apr. --- autobuild.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index a3a5dd0057..99fa201ee3 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -90,9 +90,9 @@ archive hash - a2c41379bc0abc83b45246eebdafc4ab + 15333927db9f249daefcaed70fc6683c url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/log_3p-apr/rev/249247/arch/Darwin/installer/apr_suite-1.4.5-darwin-20120209.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/249247/arch/Darwin/installer/apr_suite-1.4.5-darwin-20120210.tar.bz2 name darwin @@ -102,9 +102,9 @@ archive hash - 1ad6e6bff18306cb5079128d5aadeb6e + 297508ece8b0f334bae842fd147f2962 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/log_3p-apr-lenny/rev/249247/arch/Linux/installer/apr_suite-1.4.5-linux-20120209.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/249247/arch/Linux/installer/apr_suite-1.4.5-linux-20120211.tar.bz2 name linux @@ -114,9 +114,9 @@ archive hash - 31cd12ea119753e389dc9be5ea82cbb3 + 7ad1e767f4419a6d35a70abba1edbcdc url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/log_3p-apr/rev/249247/arch/CYGWIN/installer/apr_suite-1.4.5-windows-20120209.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/249247/arch/CYGWIN/installer/apr_suite-1.4.5-windows-20120210.tar.bz2 name windows -- cgit v1.3 From caba4fe1132a8927c8ee7b5a1133ce854986373e Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 14 Mar 2012 13:02:37 -0400 Subject: Try new 20120314 APR build to verify Windows pipe write bug fix. --- autobuild.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index 99fa201ee3..19913bf8de 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -90,9 +90,9 @@ archive hash - 15333927db9f249daefcaed70fc6683c + 02eb2d32f4013e23eb0bc2cd1b7f9b82 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/249247/arch/Darwin/installer/apr_suite-1.4.5-darwin-20120210.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/251231/arch/Darwin/installer/apr_suite-1.4.5-darwin-20120314.tar.bz2 name darwin @@ -102,9 +102,9 @@ archive hash - 297508ece8b0f334bae842fd147f2962 + 4ade1434e263cbb85a424e7dd35b8025 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/249247/arch/Linux/installer/apr_suite-1.4.5-linux-20120211.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/251231/arch/Linux/installer/apr_suite-1.4.5-linux-20120314.tar.bz2 name linux @@ -114,9 +114,9 @@ archive hash - 7ad1e767f4419a6d35a70abba1edbcdc + 6a2f05e8ddf01036aada46377295887f url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/249247/arch/CYGWIN/installer/apr_suite-1.4.5-windows-20120210.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/251231/arch/CYGWIN/installer/apr_suite-1.4.5-windows-20120314.tar.bz2 name windows -- cgit v1.3 From 38e23bb0eb71e160fdfa829398a46ec3db01d7aa Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 18 Apr 2012 15:43:34 -0400 Subject: IQA-463: Make LLProcess call apr_procattr_inherit_set() extension. On Windows, Bad Things happen when apr_proc_create() is allowed to pass TRUE to CreateProcess(bInheritHandles). For instance, the open handle for a new installer executable file being downloaded by the background updater gets inadvertently passed to a couple slplugin.exe instances. When the viewer finishes downloading, closes the file and tries to remove it, Windows balks because the file is still open by another process. Require an apr_suite package that includes the new Linden apr_procattr_inherit_set() extension, and call it to turn off CreateProcess(bInheritHandles). --- autobuild.xml | 12 ++++++------ indra/llcommon/llprocess.cpp | 35 +++++++++++++++++++++++++---------- 2 files changed, 31 insertions(+), 16 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index 19913bf8de..4288b60c30 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -90,9 +90,9 @@ archive hash - 02eb2d32f4013e23eb0bc2cd1b7f9b82 + 1ac038723ed702a5ad0db924dfe0fe1b url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/251231/arch/Darwin/installer/apr_suite-1.4.5-darwin-20120314.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/254105/arch/Darwin/installer/apr_suite-1.4.5-darwin-20120418.tar.bz2 name darwin @@ -102,9 +102,9 @@ archive hash - 4ade1434e263cbb85a424e7dd35b8025 + c60ace3d6c593d95247bd58496d7c557 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/251231/arch/Linux/installer/apr_suite-1.4.5-linux-20120314.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/254105/arch/Linux/installer/apr_suite-1.4.5-linux-20120418.tar.bz2 name linux @@ -114,9 +114,9 @@ archive hash - 6a2f05e8ddf01036aada46377295887f + d353e31abcefb554379abdec0ac41ff3 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/251231/arch/CYGWIN/installer/apr_suite-1.4.5-windows-20120314.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/254105/arch/CYGWIN/installer/apr_suite-1.4.5-windows-20120418.tar.bz2 name windows diff --git a/indra/llcommon/llprocess.cpp b/indra/llcommon/llprocess.cpp index d4786035ce..e96b328365 100644 --- a/indra/llcommon/llprocess.cpp +++ b/indra/llcommon/llprocess.cpp @@ -535,6 +535,24 @@ LLProcess::LLProcess(const LLSDOrParams& params): apr_procattr_t *procattr = NULL; chkapr(apr_procattr_create(&procattr, gAPRPoolp)); +#if ! defined(APR_HAS_PROCATTR_INHERIT_SET) + // Our special preprocessor symbol isn't even defined -- wrong APR + LL_WARNS("LLProcess") << "This version of APR lacks Linden apr_procattr_inherit_set() extension" << LL_ENDL; +#elif ! APR_HAS_PROCATTR_INHERIT_SET + // Symbol is defined, but to 0: expect apr_procattr_inherit_set() to + // return APR_ENOTIMPL. + LL_DEBUGS("LLProcess") << "apr_procattr_inherit_set() not supported on this platform" << LL_ENDL; +#else // APR_HAS_PROCATTR_INHERIT_SET nonzero + // As of 2012-04-17, the original Windows implementation of + // apr_proc_create() unconditionally passes TRUE for bInheritHandles. That + // seems to assume that all files are opened by APR so you can + // individually control whether each is inherited by a child process. But + // we've been burned by having surprising open file handles inherited by + // our child processes. Turn that OFF for us! + LL_DEBUGS("LLProcess") << "Setting apr_procattr_inherit_set(0)" << LL_ENDL; + ll_apr_warn_status(apr_procattr_inherit_set(procattr, 0)); +#endif + // For which of stdin, stdout, stderr should we create a pipe to the // child? In the viewer, there are only a couple viable // apr_procattr_io_set() alternatives: inherit the viewer's own stdxxx @@ -607,17 +625,14 @@ LLProcess::LLProcess(const LLSDOrParams& params): if (params.autokill) { -#if defined(APR_HAS_PROCATTR_AUTOKILL_SET) - apr_status_t ok = apr_procattr_autokill_set(procattr, 1); -# if LL_WINDOWS - // As of 2012-02-02, we only expect this to be implemented on Windows. - // Avoid spamming the log with warnings we fully expect. - ll_apr_warn_status(ok); -#else // ! LL_WINDOWS - (void)ok; // suppress 'unused' warning -# endif // ! LL_WINDOWS -#else +#if ! defined(APR_HAS_PROCATTR_AUTOKILL_SET) + // Our special preprocessor symbol isn't even defined -- wrong APR LL_WARNS("LLProcess") << "This version of APR lacks Linden apr_procattr_autokill_set() extension" << LL_ENDL; +#elif ! APR_HAS_PROCATTR_AUTOKILL_SET + // Symbol is defined, but to 0: expect apr_procattr_autokill_set() to + // return APR_ENOTIMPL. +#else // APR_HAS_PROCATTR_AUTOKILL_SET nonzero + ll_apr_warn_status(apr_procattr_autokill_set(procattr, 1)); #endif } -- cgit v1.3 From 8c44511d2c31c2265fb67b882dbb699adcf547eb Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 23 Apr 2012 14:50:32 -0400 Subject: IQA-463: Use newest APR package without apr_procattr_inherit_set(). --- autobuild.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index 4288b60c30..03e95ee9ab 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -90,9 +90,9 @@ archive hash - 1ac038723ed702a5ad0db924dfe0fe1b + 8f186209cae5c7bf86d6af6a7965bea3 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/254105/arch/Darwin/installer/apr_suite-1.4.5-darwin-20120418.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/254439/arch/Darwin/installer/apr_suite-1.4.5-darwin-20120423.tar.bz2 name darwin @@ -102,9 +102,9 @@ archive hash - c60ace3d6c593d95247bd58496d7c557 + f8743e0ccc4f651d5cfcf690e789cbe8 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/254105/arch/Linux/installer/apr_suite-1.4.5-linux-20120418.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/254439/arch/Linux/installer/apr_suite-1.4.5-linux-20120423.tar.bz2 name linux @@ -114,9 +114,9 @@ archive hash - d353e31abcefb554379abdec0ac41ff3 + 9799e268830010c519174da9a669dabe url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/254105/arch/CYGWIN/installer/apr_suite-1.4.5-windows-20120418.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/254439/arch/CYGWIN/installer/apr_suite-1.4.5-windows-20120423.tar.bz2 name windows -- cgit v1.3 From d29f920c22ca67b13f42680c432b689b80909f42 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 9 May 2012 19:55:26 -0400 Subject: CHOP-900: Use new apr_procattr_constrain_handle_set() extension. Now LLProcess explicitly requests APR to limit the handles passed to any child process, instead of wantonly passing whatever happens to be lying around the parent process at the time. This requires the latest APR build. Also revert LLUpdateDownloader::Implementation::mDownloadStream to llofstream (as in rev 1878a57aebd7) instead of apr_file_t*. Using APR for that file was a Band-Aid -- a single whacked mole -- for the problem more systemically addressed by apr_procattr_constrain_handle_set(). --- autobuild.xml | 12 ++++---- indra/llcommon/llprocess.cpp | 17 ++++++++++++ .../updater/llupdatedownloader.cpp | 32 ++++++++-------------- 3 files changed, 34 insertions(+), 27 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index 03e95ee9ab..a2d93a6c3e 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -90,9 +90,9 @@ archive hash - 8f186209cae5c7bf86d6af6a7965bea3 + 847f1b55c0549b7abe6628f1ea242b48 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/254439/arch/Darwin/installer/apr_suite-1.4.5-darwin-20120423.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/256201/arch/Darwin/installer/apr_suite-1.4.5-darwin-20120509.tar.bz2 name darwin @@ -102,9 +102,9 @@ archive hash - f8743e0ccc4f651d5cfcf690e789cbe8 + 998ff5f7a5a9be8c0717e1a0eab05e0c url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/254439/arch/Linux/installer/apr_suite-1.4.5-linux-20120423.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/256201/arch/Linux/installer/apr_suite-1.4.5-linux-20120509.tar.bz2 name linux @@ -114,9 +114,9 @@ archive hash - 9799e268830010c519174da9a669dabe + 44bc19a2491e8bd3ac4424c0b641f069 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/254439/arch/CYGWIN/installer/apr_suite-1.4.5-windows-20120423.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/256201/arch/CYGWIN/installer/apr_suite-1.4.5-windows-20120509.tar.bz2 name windows diff --git a/indra/llcommon/llprocess.cpp b/indra/llcommon/llprocess.cpp index 760be6da9b..9667e4e033 100644 --- a/indra/llcommon/llprocess.cpp +++ b/indra/llcommon/llprocess.cpp @@ -539,6 +539,23 @@ LLProcess::LLProcess(const LLSDOrParams& params): apr_procattr_t *procattr = NULL; chkapr(apr_procattr_create(&procattr, gAPRPoolp)); + // IQA-490, CHOP-900: On Windows, ask APR to jump through hoops to + // constrain the set of handles passed to the child process. Before we + // changed to APR, the Windows implementation of LLProcessLauncher called + // CreateProcess(bInheritHandles=FALSE), meaning to pass NO open handles + // to the child process. Now that we support pipes, though, we must allow + // apr_proc_create() to pass bInheritHandles=TRUE. But without taking + // special pains, that causes trouble in a number of ways, due to the fact + // that the viewer is constantly opening and closing files -- most of + // which CreateProcess() passes to every child process! +#if ! defined(APR_HAS_PROCATTR_CONSTRAIN_HANDLE_SET) + // Our special preprocessor symbol isn't even defined -- wrong APR + LL_WARNS("LLProcess") << "This version of APR lacks Linden " + << "apr_procattr_constrain_handle_set() extension" << LL_ENDL; +#else + chkapr(apr_procattr_constrain_handle_set(procattr, 1)); +#endif + // For which of stdin, stdout, stderr should we create a pipe to the // child? In the viewer, there are only a couple viable // apr_procattr_io_set() alternatives: inherit the viewer's own stdxxx diff --git a/indra/viewer_components/updater/llupdatedownloader.cpp b/indra/viewer_components/updater/llupdatedownloader.cpp index abe45cc52b..75e455e3f6 100644 --- a/indra/viewer_components/updater/llupdatedownloader.cpp +++ b/indra/viewer_components/updater/llupdatedownloader.cpp @@ -40,7 +40,6 @@ #include "llthread.h" #include "llupdaterservice.h" #include "llcurl.h" -#include "llapr.h" class LLUpdateDownloader::Implementation: public LLThread @@ -66,7 +65,7 @@ private: LLUpdateDownloader::Client & mClient; CURL * mCurl; LLSD mDownloadData; - apr_file_t* mDownloadStream; + llofstream mDownloadStream; unsigned char mDownloadPercent; std::string mDownloadRecordPath; curl_slist * mHeaderList; @@ -189,7 +188,6 @@ LLUpdateDownloader::Implementation::Implementation(LLUpdateDownloader::Client & mCancelled(false), mClient(client), mCurl(0), - mDownloadStream(NULL), mDownloadPercent(0), mHeaderList(0) { @@ -346,9 +344,12 @@ size_t LLUpdateDownloader::Implementation::onBody(void * buffer, size_t size) if(mCancelled) return 0; // Forces a write error which will halt curl thread. if((size == 0) || (buffer == 0)) return 0; - apr_size_t written(size); - ll_apr_assert_status(apr_file_write(mDownloadStream, buffer, &written)); - return written; + mDownloadStream.write(static_cast(buffer), size); + if(mDownloadStream.bad()) { + return 0; + } else { + return size; + } } @@ -379,8 +380,7 @@ int LLUpdateDownloader::Implementation::onProgress(double downloadSize, double b void LLUpdateDownloader::Implementation::run(void) { CURLcode code = curl_easy_perform(mCurl); - ll_apr_assert_status(apr_file_close(mDownloadStream)); - mDownloadStream = NULL; + mDownloadStream.close(); if(code == CURLE_OK) { LLFile::remove(mDownloadRecordPath); if(validateDownload()) { @@ -459,9 +459,8 @@ void LLUpdateDownloader::Implementation::resumeDownloading(size_t startByte) if(mHeaderList == 0) throw DownloadError("cannot add Range header"); throwOnCurlError(curl_easy_setopt(mCurl, CURLOPT_HTTPHEADER, mHeaderList)); - ll_apr_assert_status(apr_file_open(&mDownloadStream, mDownloadData["path"].asString().c_str(), - APR_WRITE | APR_APPEND | APR_BINARY | APR_BUFFERED, - APR_OS_DEFAULT, gAPRPoolp)); + mDownloadStream.open(mDownloadData["path"].asString(), + std::ios_base::out | std::ios_base::binary | std::ios_base::app); start(); } @@ -484,16 +483,7 @@ void LLUpdateDownloader::Implementation::startDownloading(LLURI const & uri, std llofstream dataStream(mDownloadRecordPath); LLSDSerialize::toPrettyXML(mDownloadData, dataStream); - ll_apr_assert_status(apr_file_open(&mDownloadStream, filePath.c_str(), - APR_WRITE | APR_CREATE | APR_TRUNCATE | APR_BINARY | APR_BUFFERED, - APR_OS_DEFAULT, gAPRPoolp)); - // IQA-463: Do NOT let this open file be inherited by child processes. - // That's why we switched from llofstream to apr_file_t. From - // apr_file_open() doc - // http://apr.apache.org/docs/apr/1.4/group__apr__file__io.html#gabda14cbf242fb4fe99055434213e5446 : - // "By default, the returned file descriptor will not be inherited by - // child processes created by apr_proc_create(). This can be changed using - // apr_file_inherit_set()." + mDownloadStream.open(filePath, std::ios_base::out | std::ios_base::binary); initializeCurlGet(uri.asString(), true); start(); } -- cgit v1.3 From 77488911a30021b6576ad5047395405a98e11b8d Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 23 May 2012 14:55:31 -0400 Subject: DRTVWR-151: Today's APR build should run on Windows XP again. The previous tip Windows APR package: http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/256201/arch/CYGWIN/installer/apr_suite-1.4.5-windows-20120509.tar.bz2 contained a libapr-1.dll that would not load on Windows XP. The code contained static calls to Windows API functions not yet present in Windows XP. The new Windows APR package has made those calls conditional, using LoadLibrary() and GetProcAddress() calls. The hope is that this new viewer build will behave identically on Windows Vista or later -- but unlike its predecessor, will also launch on Windows XP. --- autobuild.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index a2d93a6c3e..0159839915 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -90,9 +90,9 @@ archive hash - 847f1b55c0549b7abe6628f1ea242b48 + 1fe7c2121916b2c5ff75073742442e2a url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/256201/arch/Darwin/installer/apr_suite-1.4.5-darwin-20120509.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/257886/arch/Darwin/installer/apr_suite-1.4.5-darwin-20120523.tar.bz2 name darwin @@ -102,9 +102,9 @@ archive hash - 998ff5f7a5a9be8c0717e1a0eab05e0c + eac7926a7caa121144c911434a01b680 url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/256201/arch/Linux/installer/apr_suite-1.4.5-linux-20120509.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/257886/arch/Linux/installer/apr_suite-1.4.5-linux-20120523.tar.bz2 name linux @@ -114,9 +114,9 @@ archive hash - 44bc19a2491e8bd3ac4424c0b641f069 + 8789d952a33ce3e8b87be8cbf94bc6ba url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/256201/arch/CYGWIN/installer/apr_suite-1.4.5-windows-20120509.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-apr/rev/257886/arch/CYGWIN/installer/apr_suite-1.4.5-windows-20120523.tar.bz2 name windows -- cgit v1.3