| 121 | } |
| 122 | |
| 123 | bool pipe_manager::update(const char* src, size_t len, |
| 124 | pipe_stream* out /* = NULL */) |
| 125 | { |
| 126 | std::list<pipe_stream*>::iterator it = m_streams.begin(); |
| 127 | |
| 128 | string* pBuf = m_pBuf1; |
| 129 | string* pLast = pBuf; |
| 130 | pBuf->clear(); |
| 131 | |
| 132 | for (; it != m_streams.end(); ++it) { |
| 133 | if (len > 0 && (*it)->push_pop(src, len, pBuf, 0) == -1) { |
| 134 | return false; |
| 135 | } |
| 136 | src = pBuf->c_str(); |
| 137 | len = pBuf->length(); |
| 138 | pLast = pBuf; |
| 139 | if (pBuf == m_pBuf1) { |
| 140 | pBuf = m_pBuf2; |
| 141 | } else { |
| 142 | pBuf = m_pBuf1; |
| 143 | } |
| 144 | pBuf->clear(); |
| 145 | } |
| 146 | |
| 147 | if (!pLast->empty() && out != NULL) { |
| 148 | return out->push_pop(pLast->c_str(), |
| 149 | pLast->length(), NULL, 0) != -1; |
| 150 | } |
| 151 | return true; |
| 152 | } |
| 153 | |
| 154 | bool pipe_manager::update_end(pipe_stream* out /* = NULL */) |
| 155 | { |