bool HeaderBase::read(std::istream& str) { ACE_CString name (64, '\0'); ACE_CString value (128, '\0'); int ch = str.peek (); while (ch != eof_ && ch != '\r' && ch != '\n') { name.fast_clear (); value.fast_clear (); // parse name ch = this->read_field (str, name, MAX_NAME_LENGTH, ':'); if (ch == '\n') { ch = str.get (); continue; // ignore invalid headers } if (ch != ':') { return false; // name too long/missing colon; cannot continue } // skip leading whitespace before next field while (ACE_OS::ace_isspace (str.peek ())) { ch = str.get (); } // parse value ch = this->read_field (str, value, MAX_VALUE_LENGTH, '\r'); if (ch == '\r') ch = str.get (); // get lf if (ch != '\n') return false; // value too long/no crlf found; cannot continue // followup lines starting with ws are continuations of the value // and must be appended ch = str.peek (); while (ch == ' ' || ch == '\t') { ch = this->read_field (str, value, MAX_VALUE_LENGTH, '\r'); if (ch == '\r') ch = str.get (); // get lf if (ch != '\n') return false; // multiline value too long/no crlf; cannot continue ch = str.peek (); } this->add (name, value); INET_DEBUG (9, (LM_DEBUG, DLINFO ACE_TEXT ("ACE_INet_HTTP: <-+ %C: %C\n"), name.c_str (), value.c_str ())); } return true; }
void cleanup(PersistenceUpdater::ALLOCATOR* allocator) { if (name.length() > 0) { char* strMemory = const_cast<char*>(name.fast_rep()); name.fast_clear(); allocator->free(strMemory); } if (dataType.length() > 0) { char* strMemory = const_cast<char*>(dataType.fast_rep()); dataType.fast_clear(); allocator->free(strMemory); } allocator->free(topicQos.second.second); }
void cleanup(PersistenceUpdater::ALLOCATOR* allocator) { if (callback.length() > 0) { char* strMemory = const_cast<char*>(callback.fast_rep()); callback.fast_clear(); allocator->free(strMemory); } allocator->free(pubsubQos.second.second); allocator->free(drdwQos.second.second); allocator->free(transportInterfaceInfo.second); allocator->free(contentSubscriptionProfile.exprParams.second); }
ACE_CString TAO_Notify_PushConsumer::get_ior (void) const { ACE_CString result; CORBA::ORB_var orb = TAO_Notify_PROPERTIES::instance()->orb(); try { CORBA::String_var ior = orb->object_to_string(this->push_consumer_.in()); result = static_cast<const char*> (ior.in ()); } catch (const CORBA::Exception&) { result.fast_clear(); } return result; }