All pastes #886512 Raw Edit

Mine

public text v1 · immutable
#886512 ·published 2008-01-31 18:52 UTC
rendered paste body
void OrbitraderMFD::POSTStatus(int (*XMLwriter)(), int current_xfer_code, bool * statusFlag )
{
	DB("OrbitraderMFD::POSTStatus");
	if (xfer_code == 0)
	{
// here I'd like to write different XMLs
		XMLwriter();
	}
	int result = 1;
	if (xfer_code == 0 || xfer_code == current_xfer_code)
	{
		if (oapiGetSysTime () - previousTime > POSTdeltaTime)
		{
			previousTime = oapiGetSysTime ();
			xfer_code = current_xfer_code;
			result = CurlPOST("/reports/file");	
		}
	}	
	if (result == 0) 
	{		
		xfer_code = 0; // unlock other transfers
		POST_data.clear();

		// free and clean up the allocated data
		if (chunk.memory) 	free(chunk.memory);
		chunk.memory = NULL;
		chunk.size = 0;
		*statusFlag = true;
	}	
}