Need help to get OpenSSL 64 work on Windows x64 | I hate D's GC!

Suliman via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jul 14 06:16:17 PDT 2017


It's look that GC in D is really suxx. There is already second 
toy-project where I am getting stuck on Windows with D for last 3 
month.

I'm using 32-bit build, because I can't understand which libs I 
should use to get OpenSSL 64 bit work with dlang-request.

32-bit version compile and works fine, but it's fail during 
downloading 300MB file with next error:
core.exception.OutOfMemoryError at src\core\exception.d(696): Memory 
allocation failed

code:

import std.stdio;
import std.conv;
import std.file;
import std.path;
import std.string;
import std.algorithm;
import std.regex;

import requests;
pragma(lib, "ssl");
pragma(lib, "eay");


void main()
{
     string login = "Suliman1";
     string pass = "Infinity8"; //*
     string url = 
"https://n5eil01u.ecs.nsidc.org/SMAP/SPL3SMP_E.001/2017.07.11/";
	
	Request request;
	request.addHeaders(["User-Agent": "Mozilla/5.0 (Windows NT 6.1; 
Win64; x64; rv:54.0) Gecko/20100101 Firefox/54.0"]);
	request.authenticator = new BasicAuthentication(login, pass);
	auto rs = request.get(url);
	string content = to!string(rs.responseBody);

	string fname = content.matchFirst(`(SMAP_[^"]+)`).hit;

	string h5_file = url ~ fname;
	string isoXML_file = url ~ fname ~ `.iso.xml`;
	string qa_file = url ~ fname.replace(`h5`, `qa`);

	string [] arrayFullURLs;
	arrayFullURLs ~= h5_file;
	arrayFullURLs ~= isoXML_file;
	arrayFullURLs ~= qa_file;

	foreach(f; arrayFullURLs)
	{
		writeln("Loading file: ", f);
		auto rs1 = request.get(f);
		File file = File(baseName(f), "w");
		file.write(rs1.responseBody);
	}
	
}

dub.sdl:
name "parser"
dependency "requests" version="~>0.4.2"
dependency "progress" version="~>4.0.3"


--
* please do now hack account because I publish this pass to get 
it's reproduce error easier.

So could anybody explain step-by-step how to get OpenSSL 64 work 
on 64-bit Windows.

On my PC this app eat 500MB of RAM and then failure with error 
above.



More information about the Digitalmars-d-learn mailing list