src/SerifHTTPServer/IncomingHTTPConnection.cpp
/** Handle a <SerifXMLRequest> message from the client. */
Handle a  message from the client.
Handle a message from the client .
void IncomingHTTPConnection::handleSerifXMLRequest() {
	if (_state == CLOSED) return;
	_connectionDescription = "Handling SerifXML Request";
	assert(_state == PROCESSING_REQUEST);
	writeLogMessage(0, "Handling XML Message");
	DOMElement* root = _xmlRequest->getDocumentElement();
	if (XMLString::compareIString(root->getTagName(), X_SerifXMLRequest)!=0) {
		reportError(400, "Expected a <SerifXMLRequest> root element; got", 
			transcodeToStdString(root->getTagName()));
		return;
	}
	getSessionId(root->getAttribute(X_session_id));
	if (_state == SENDING_RESPONSE || _state == CLOSED) return; 
	insertRemoteFiles(root, X_Document);
	if (_state == SENDING_RESPONSE || _state == CLOSED) return; 
	insertRemoteFiles(root, X_OriginalText);
	if (_state == SENDING_RESPONSE || _state == CLOSED) return; 
	if (_state == PROCESSING_REQUEST) {
		assert(_downloadConnections.empty());
		handleSerifXMLCommands();
	}
}
void IncomingHTTPConnection :: handleSerifXMLRequest ( ) { if ( _state == CLOSED ) return ; _connectionDescription = " " ; assert ( _state == PROCESSING_REQUEST ) ; writeLogMessage ( 0 , " " ) ; DOMElement * root = _xmlRequest -> getDocumentElement ( ) ; if ( XMLString :: compareIString ( root -> getTagName ( ) , X_SerifXMLRequest ) != 0 ) { reportError ( 400 , " " , transcodeToStdString ( root -> getTagName ( ) ) ) ; return ; } getSessionId ( root -> getAttribute ( X_session_id ) ) ; if ( _state == SENDING_RESPONSE || _state == CLOSED ) return ; insertRemoteFiles ( root , X_Document ) ; if ( _state == SENDING_RESPONSE || _state == CLOSED ) return ; insertRemoteFiles ( root , X_OriginalText ) ; if ( _state == SENDING_RESPONSE || _state == CLOSED ) return ; if ( _state == PROCESSING_REQUEST ) { assert ( _downloadConnections . empty ( ) ) ; handleSerifXMLCommands ( ) ; } }
Handle a <SerifXMLRequest> message from the client.
Handle a <SerifXMLRequest > message from the client .
// Choose a unique identifier for this session
 // we encountered an error
 // Check if any elements contain references to remote content; if so,
 // then download that remote content and insert it into the DOM tree.
 // we encountered an error
 // we encountered an error
