Brn WriterRingBuffer::Tail(const Brx& aBuffer, TUint aMaxBytes) { const TUint bytes = aBuffer.Bytes(); if (bytes <= aMaxBytes) return Brn(aBuffer); else return aBuffer.Split(bytes - aMaxBytes, aMaxBytes); }
void HttpHeaderHost::Process(const Brx& aValue) { OpenHome::Endpoint defaultEndpoint; iEndpoint = defaultEndpoint; iHost.Set(aValue); SetReceived(); try { TUint index = Ascii::IndexOf(aValue, ':'); Brn address(aValue); TUint port = 0; if (index != aValue.Bytes()) { address.Set(address.Ptr(), index); Brn portBuf = aValue.Split(index+1, aValue.Bytes()-index-1); port = Ascii::Uint(portBuf); } iEndpoint = OpenHome::Endpoint(port, address); } catch(AsciiError&) { THROW(HttpError); } catch(NetworkError&) { THROW(HttpError); } }