void EventSource::didReceiveData(const char* data, int length) { ASSERT(m_state == OPEN); ASSERT(m_requestInFlight); append(m_receiveBuf, m_decoder->decode(data, length)); parseEventStream(); }
void EventSource::didReceiveData(const char* data, int length) { ASSERT(m_state == OPEN); ASSERT(m_requestInFlight); // FIXME: Need to call flush at some point. append(m_receiveBuf, StringView(m_decoder->decode(data, length))); parseEventStream(); }
void EventSource::didFinishLoading(unsigned long) { if (m_receiveBuf.size() > 0 || m_data.size() > 0) { append(m_receiveBuf, "\n\n"); parseEventStream(); } m_state = CONNECTING; endRequest(); }
void EventSource::didFinishLoading(unsigned long, double) { ASSERT(m_state == OPEN); ASSERT(m_requestInFlight); if (m_receiveBuf.size() > 0 || m_data.size() > 0) { append(m_receiveBuf, "\n\n"); parseEventStream(); } networkRequestEnded(); }
void EventSource::didFinishLoading(unsigned long, double) { ASSERT(m_state == OPEN); ASSERT(m_requestInFlight); if (m_receiveBuf.size() > 0 || m_data.size() > 0) { parseEventStream(); // Discard everything that has not been dispatched by now. m_receiveBuf.clear(); m_data.clear(); m_eventName = ""; m_currentlyParsedEventId = String(); } networkRequestEnded(); }
void EventSource::didReceiveData(const char* data, int length) { LOG(TRACE) + "didReceiveData"; if ( m_state != OPEN ) { close(); m_pReceiver->onError("Received data but connection is not opened correctly."); return; } ASSERT(m_pNetRequest != 0); m_receiveBuf.insert(m_receiveBuf.end(),data,data+length); parseEventStream(); }
void EventSource::didFinishLoading() { LOG(TRACE) + "didFinishLoading"; ASSERT(m_state == OPEN); ASSERT(m_pNetRequest != 0); if (m_receiveBuf.size() > 0 || m_data.size() > 0) { parseEventStream(); // Discard everything that has not been dispatched by now. m_receiveBuf.clear(); m_data.clear(); m_eventName = ""; m_currentlyParsedEventId = String(); } networkRequestEnded(); }
void EventSource::didFinishLoading(unsigned long, double) { ASSERT(m_state == OPEN); ASSERT(m_requestInFlight); append(m_receiveBuffer, m_decoder->flush()); parseEventStream(); // Discard everything that has not been dispatched by now. // FIXME: Why does this need to be done? // If this is important, why isn't it important to clear other data members: m_decoder, m_lastEventId, m_loader? m_receiveBuffer.clear(); m_data.clear(); m_eventName = { }; m_currentlyParsedEventId = { }; networkRequestEnded(); }
void EventSource::didReceiveData(const char* data, int length) { append(m_receiveBuf, m_decoder->decode(data, length)); parseEventStream(); }