예제 #1
0
void XMPPLayer::resetParser() {
	if (inParser_) {
		resetParserAfterParse_ = true;
	}
	else {
		doResetParser();
	}
}
예제 #2
0
void XMPPLayer::handleDataRead(const ByteArray& data) {
	onDataRead(data);
	inParser_ = true;
	if (!xmppParser_->parse(data.toString())) {
		inParser_ = false;
		onError();
		return;
	}
	inParser_ = false;
	if (resetParserAfterParse_) {
		doResetParser();
	}
}
예제 #3
0
void XMPPLayer::handleDataRead(const SafeByteArray& data) {
	onDataRead(data);
	inParser_ = true;
	// FIXME: Converting to unsafe string. Should be ok, since we don't take passwords
	// from the stream in clients. If servers start using this, and require safe storage,
	// we need to fix this.
	if (!xmppParser_->parse(byteArrayToString(ByteArray(data.begin(), data.end())))) {
		inParser_ = false;
		onError();
		return;
	}
	inParser_ = false;
	if (resetParserAfterParse_) {
		doResetParser();
	}
}