Lime.net.URLLoader.writeFunction bug

lime.net.URLLoader.writeFunction is currently (2.6.6) :

private function writeFunction (output:Bytes, size:Int, nmemb:Int):Int {

	__data.readBytes (ByteArray.fromBytes (output));
	return size * nmemb;

}

openfl.net.URLLoader.writeFunction is currently (3.3.6) :

private function writeFunction (output:Bytes, size:Int, nmemb:Int):Int {

	__data.writeBytes (ByteArray.fromBytes (output));
	return size * nmemb;
	
}

note writeBytes instead of readBytes. I’m thinking writeBytes is correct, and the lime source should be amended.

Incidentally, why are two copies of net.URLLoader maintained?

Regards, Jake

Thanks! Obvious mistake after updating OpenFL’s implementation, and trying to copy it over.

Lime had no network API, so first a URLLoader equivalent was added in a pull request. Next, as OpenFL matured (over Lime), I combined the URLLoader implementation in OpenFL, to work for both HTML5 and native.

I think Lime should have a network API, but different from URLLoader, perhaps? We have cURL bindings, but a simple “download this please” API is useful. In the future, perhaps Lime gets a smarter network API, then OpenFL changes to use that for all targets (Lime thereby handling HTML5 + native under one unified network API)

Open to ideas. Thanks for the fix!