From 58ffc5f96091cc72f213290afebb2dc1a0048ea5 Mon Sep 17 00:00:00 2001 From: Rye Date: Tue, 14 Oct 2025 11:10:39 -0400 Subject: Fix boost asio deprecation warnings Signed-off-by: Rye --- indra/llcommon/llprocess.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/llcommon/llprocess.cpp') diff --git a/indra/llcommon/llprocess.cpp b/indra/llcommon/llprocess.cpp index 912e596c3f..2164fc1ad5 100644 --- a/indra/llcommon/llprocess.cpp +++ b/indra/llcommon/llprocess.cpp @@ -176,14 +176,14 @@ public: // In general, our streambuf might contain a number of different // physical buffers; iterate over those. bool keepwriting = true; - for (const_buffer_sequence::const_iterator bufi(bufs.begin()), bufend(bufs.end()); + for (auto bufi(boost::asio::buffer_sequence_begin(bufs)), bufend(boost::asio::buffer_sequence_end(bufs)); bufi != bufend && keepwriting; ++bufi) { // http://www.boost.org/doc/libs/1_49_0_beta1/doc/html/boost_asio/reference/buffer.html#boost_asio.reference.buffer.accessing_buffer_contents // Although apr_file_write() accepts const void*, we // manipulate const char* so we can increment the pointer. - const char* remainptr = boost::asio::buffer_cast(*bufi); - std::size_t remainlen = boost::asio::buffer_size(*bufi); + const char* remainptr = static_cast(bufi->data()); + std::size_t remainlen = bufi->size(); while (remainlen) { // Tackle the current buffer in discrete chunks. On @@ -377,14 +377,14 @@ public: // In general, the mutable_buffer_sequence returned by prepare() might // contain a number of different physical buffers; iterate over those. std::size_t tocommit(0); - for (mutable_buffer_sequence::const_iterator bufi(bufs.begin()), bufend(bufs.end()); + for (auto bufi(boost::asio::buffer_sequence_begin(bufs)), bufend(boost::asio::buffer_sequence_end(bufs)); bufi != bufend; ++bufi) { // http://www.boost.org/doc/libs/1_49_0_beta1/doc/html/boost_asio/reference/buffer.html#boost_asio.reference.buffer.accessing_buffer_contents - std::size_t toread(boost::asio::buffer_size(*bufi)); + std::size_t toread(bufi->size()); apr_size_t gotten(toread); apr_status_t err = apr_file_read(mPipe, - boost::asio::buffer_cast(*bufi), + bufi->data(), &gotten); // EAGAIN is exactly what we want from a nonblocking pipe. // Rather than waiting for data, it should return immediately. -- cgit v1.3 From a73bbcc64626ecc7ef6f7cc2ca1642fa50a18d6d Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Mon, 10 Nov 2025 14:01:34 +0200 Subject: Check what state pipe is in for a failed test (#4877) --- indra/llcommon/llprocess.cpp | 3 ++- indra/llcommon/tests/llprocess_test.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/llcommon/llprocess.cpp') diff --git a/indra/llcommon/llprocess.cpp b/indra/llcommon/llprocess.cpp index 912e596c3f..33a9180cc6 100644 --- a/indra/llcommon/llprocess.cpp +++ b/indra/llcommon/llprocess.cpp @@ -457,7 +457,8 @@ public: ("slot", LLSD::Integer(mIndex)) ("name", whichfile(mIndex)) ("desc", mDesc) - ("eof", state == CLOSED)); + ("eof", state == CLOSED) + ("exhst", state == EXHAUSTED)); } return false; diff --git a/indra/llcommon/tests/llprocess_test.cpp b/indra/llcommon/tests/llprocess_test.cpp index 9eaf5bf3e3..4adfaf54f3 100644 --- a/indra/llcommon/tests/llprocess_test.cpp +++ b/indra/llcommon/tests/llprocess_test.cpp @@ -1207,8 +1207,8 @@ namespace tut { set_test_name("ReadPipe \"eof\" event"); PythonProcessLauncher py(get_test_name(), - "from __future__ import print_function\n" - "print('Hello from Python!')\n"); + "import time\n" + "time.sleep(1.5)\n"); py.mParams.files.add(LLProcess::FileParam()); // stdin py.mParams.files.add(LLProcess::FileParam("pipe")); // stdout py.launch(); -- cgit v1.3 From 57ff742cbd9fc2d6b3b0fef7c7a0daa5fb610300 Mon Sep 17 00:00:00 2001 From: Rye Date: Sun, 30 Nov 2025 12:15:01 -0500 Subject: #5078 Replace boost ptr_vector with std::vector Signed-off-by: Rye --- indra/llcommon/llleaplistener.h | 1 - indra/llcommon/llprocess.cpp | 21 ++++++--------------- indra/llcommon/llprocess.h | 3 +-- 3 files changed, 7 insertions(+), 18 deletions(-) (limited to 'indra/llcommon/llprocess.cpp') diff --git a/indra/llcommon/llleaplistener.h b/indra/llcommon/llleaplistener.h index cad4543d02..9663e9a22f 100644 --- a/indra/llcommon/llleaplistener.h +++ b/indra/llcommon/llleaplistener.h @@ -16,7 +16,6 @@ #include #include #include -#include /// Listener class implementing LLLeap query/control operations. /// See https://jira.lindenlab.com/jira/browse/DEV-31978. diff --git a/indra/llcommon/llprocess.cpp b/indra/llcommon/llprocess.cpp index 33a9180cc6..670b740133 100644 --- a/indra/llcommon/llprocess.cpp +++ b/indra/llcommon/llprocess.cpp @@ -529,18 +529,9 @@ LLProcess::LLProcess(const LLSDOrParams& params): // preserve existing semantics, we promise that mAttached defaults to the // same setting as mAutokill. mAttached(params.attached.isProvided()? params.attached : params.autokill), - mPool(NULL), - mPipes(NSLOTS) + mPool(NULL) { - // Hmm, when you construct a ptr_vector with a size, it merely reserves - // space, it doesn't actually make it that big. Explicitly make it bigger. - // Because of ptr_vector's odd semantics, have to push_back(0) the right - // number of times! resize() wants to default-construct new BasePipe - // instances, which fails because it's pure virtual. But because of the - // constructor call, these push_back() calls should require no new - // allocation. - for (size_t i = 0; i < mPipes.capacity(); ++i) - mPipes.push_back(0); + mPipes.resize(NSLOTS); if (! params.validateBlock(true)) { @@ -752,11 +743,11 @@ LLProcess::LLProcess(const LLSDOrParams& params): apr_file_t* pipe(mProcess.*(members[i])); if (i == STDIN) { - mPipes.replace(i, new WritePipeImpl(desc, pipe)); + mPipes[i] = std::make_unique(desc, pipe); } else { - mPipes.replace(i, new ReadPipeImpl(desc, pipe, FILESLOT(i))); + mPipes[i] = std::make_unique(desc, pipe, FILESLOT(i)); } // Removed temporaily for Xcode 7 build tests: error was: // "error: expression with side effects will be evaluated despite @@ -1064,14 +1055,14 @@ PIPETYPE* LLProcess::getPipePtr(std::string& error, FILESLOT slot) error = STRINGIZE(mDesc << " has no slot " << slot); return NULL; } - if (mPipes.is_null(slot)) + if (!mPipes[slot]) { error = STRINGIZE(mDesc << ' ' << whichfile(slot) << " not a monitored pipe"); return NULL; } // Make sure we dynamic_cast in pointer domain so we can test, rather than // accepting runtime's exception. - PIPETYPE* ppipe = dynamic_cast(&mPipes[slot]); + PIPETYPE* ppipe = dynamic_cast(mPipes[slot].get()); if (! ppipe) { error = STRINGIZE(mDesc << ' ' << whichfile(slot) << " not a " << typeid(PIPETYPE).name()); diff --git a/indra/llcommon/llprocess.h b/indra/llcommon/llprocess.h index cc2d6566fc..d19f480c4a 100644 --- a/indra/llcommon/llprocess.h +++ b/indra/llcommon/llprocess.h @@ -31,7 +31,6 @@ #include "llsdparam.h" #include "llexception.h" #include "apr_thread_proc.h" -#include #include #include #include // std::ostream @@ -564,7 +563,7 @@ private: bool mAutokill, mAttached; Status mStatus; // explicitly want this ptr_vector to be able to store NULLs - typedef boost::ptr_vector< boost::nullable > PipeVector; + typedef std::vector> PipeVector; PipeVector mPipes; apr_pool_t* mPool; }; -- cgit v1.3