Fix infinite loop when size of downloadResults_ exceeds maxDownloadResult_
Detect console with on Windows

Signed-off-by: Nils Maier <maierman@web.de>
Do not reference RequestGroups longer than necessary

There is an initial vector of SharedHandle<RequestGroup> to seed the
DownloadEngine. This vector was however kept alive via main.cc ->
MultiUrlRequestInfo up until the program exits, hence effetively leaking
all initial RequestGroups and associated object instances.

Hence, as a matter of dirty-workaround, drop the contents of that initial
vector as soon as it is not required any longer.
Merge branch 'fix-initial-rq-leak' of https://github.com/nmaier/aria2 into nmaier-fix-initial-rq-leak
Improve log message for server socket
Use same port number for IPv4 and IPv6 DHT
Use std::remove_if
Use std::remove_if
Update doc
Fix bustage on OSX with ./configure CC=cc CXX=c++ (clang)
Hygiene: Fix some clang warnings, mostly unused private members.
Option fixes
Fix various -pedantic errors

Signed-off-by: Nils Maier <maierman@web.de>
Increase default max download result

Signed-off-by: Nils Maier <maierman@web.de>
Drop posix_memalign check
Do not use a virtual varargs function

This stuff breaks in some compiler (configurations)
Support for gzipped -i and --save-session

Saved sessions may very large, as in hundreds and even thousands of
megabyte when dealing with large queues.
Add support to save and reload sessions to gzipped files, when libz is
available.

The session serializer will output gzipped contents when the file ends
with .gz, while the input file reader (UriListParser) will accept
whatever is thrown at it.
Document -i/--save-session gzip behaviour
Let there be atoms

Atom is a globally shared std::string wrapper. Using atoms, one can be
sure that there is only a single Atom-tracked std::string with the same
value around. The value of an Atom is - contrary to std::string -
immutable. Atoms use less memory and are usually faster to copy.

Using Atoms for the most often copied string significantly reduces
memory usage (up to 20% in this iteration).

PASS: aria2c
Establish uri::URI type and friends

uris should be Atoms, as usually several "copies" of a uri exists for
each download, wasting memory unnecessarily.
Also establish some list types, mostly dealing with uris, so that it
gets possible to change types more easily should that be required later.

PASS: aria2c