aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage/lliopipe.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:46 -0500
committerJacek Antonelli2008-08-15 23:44:46 -0500
commit38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch)
treeadca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/llmessage/lliopipe.cpp
parentREADME.txt (diff)
downloadmeta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2
meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz
Second Life viewer sources 1.13.2.12
Diffstat (limited to 'linden/indra/llmessage/lliopipe.cpp')
-rw-r--r--linden/indra/llmessage/lliopipe.cpp112
1 files changed, 112 insertions, 0 deletions
diff --git a/linden/indra/llmessage/lliopipe.cpp b/linden/indra/llmessage/lliopipe.cpp
new file mode 100644
index 0000000..86a36d8
--- /dev/null
+++ b/linden/indra/llmessage/lliopipe.cpp
@@ -0,0 +1,112 @@
1/**
2 * @file lliopipe.cpp
3 * @author Phoenix
4 * @date 2004-11-19
5 * @brief Implementation of the LLIOPipe class
6 *
7 * Copyright (c) 2004-2007, Linden Research, Inc.
8 *
9 * The source code in this file ("Source Code") is provided by Linden Lab
10 * to you under the terms of the GNU General Public License, version 2.0
11 * ("GPL"), unless you have obtained a separate licensing agreement
12 * ("Other License"), formally executed by you and Linden Lab. Terms of
13 * the GPL can be found in doc/GPL-license.txt in this distribution, or
14 * online at http://secondlife.com/developers/opensource/gplv2
15 *
16 * There are special exceptions to the terms and conditions of the GPL as
17 * it is applied to this Source Code. View the full text of the exception
18 * in the file doc/FLOSS-exception.txt in this software distribution, or
19 * online at http://secondlife.com/developers/opensource/flossexception
20 *
21 * By copying, modifying or distributing this software, you acknowledge
22 * that you have read and understood your obligations described above,
23 * and agree to abide by those obligations.
24 *
25 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
26 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
27 * COMPLETENESS OR PERFORMANCE.
28 */
29
30#include "linden_common.h"
31#include "lliopipe.h"
32
33#include "llpumpio.h"
34
35static const std::string STATUS_SUCCESS_NAMES[LLIOPipe::STATUS_SUCCESS_COUNT] =
36{
37 std::string("STATUS_OK"),
38 std::string("STATUS_STOP"),
39 std::string("STATUS_DONE"),
40 std::string("STATUS_BREAK"),
41 std::string("STATUS_NEED_PROCESS"),
42};
43
44static const std::string STATUS_ERROR_NAMES[LLIOPipe::STATUS_ERROR_COUNT] =
45{
46 std::string("STATUS_ERROR"),
47 std::string("STATUS_NOT_IMPLEMENTED"),
48 std::string("STATUS_PRECONDITION_NOT_MET"),
49 std::string("STATUS_NO_CONNECTION"),
50 std::string("STATUS_EXPIRED"),
51};
52
53// Debugging schmutz for deadlock
54const char *gPumpFile = "";
55S32 gPumpLine = 0;
56
57void pump_debug(const char *file, S32 line)
58{
59 gPumpFile = file;
60 gPumpLine = line;
61}
62
63/**
64 * LLIOPipe
65 */
66LLIOPipe::LLIOPipe() :
67 mReferenceCount(0)
68{
69}
70
71LLIOPipe::~LLIOPipe()
72{
73 //lldebugs << "destroying LLIOPipe" << llendl;
74}
75
76// static
77std::string LLIOPipe::lookupStatusString(EStatus status)
78{
79 if((status >= 0) && (status < STATUS_SUCCESS_COUNT))
80 {
81 return STATUS_SUCCESS_NAMES[status];
82 }
83 else
84 {
85 S32 error_code = ((S32)status * -1) - 1;
86 if(error_code < STATUS_ERROR_COUNT)
87 {
88 return STATUS_ERROR_NAMES[error_code];
89 }
90 }
91 std::string rv;
92 return rv;
93}
94
95LLIOPipe::EStatus LLIOPipe::process(
96 const LLChannelDescriptors& channels,
97 buffer_ptr_t& buffer,
98 bool& eos,
99 LLSD& context,
100 LLPumpIO* pump)
101{
102 return process_impl(channels, buffer, eos, context, pump);
103}
104
105// virtual
106LLIOPipe::EStatus LLIOPipe::handleError(
107 LLIOPipe::EStatus status,
108 LLPumpIO* pump)
109{
110 // by default, the error is not handled.
111 return status;
112}