aria2 1.2.0
===========

Release Note
------------

This release adds the AdaptiveURISelector from Mandriva developers and
changes the default value of --proxy-method option from 'tunnel' to
'get'. The several BitTorrent options were added: limiting the number
of peers, choosing port randomly from specified range, a toggle to
seed after successful hash check and specifying IP address to report
to a tracker. Hash checking is now done sequentially rather than
simultaneously.  HTTP Authorization was also refined so that now
authorization header is sent to the server only when it is
requested(there are some exceptions, see Changes below). aria2 now
returns exit code depending on the last error. All exit codes are
documented in man page.  This release also adds experimental built-in
HTTP server which provides the current download progress in plain
html.

Changes
-------

* Fixed the segmentation fault during execution of choking algorithm
  in leecher state because of broken compare operator implementation.

* Open file in binary mode. This fixes the bug that local torrent file
  doesn't work on win32.

* Added a check to see struct sockaddr_in has sin_len member.  Set
  struct sockaddr_in.sin_len if HAVE_SOCKADDR_IN_SIN_LEN is defined.

* Fixed possible buffer overrun when writing dht.dat.

* Fix epoll error on the old kernel 2.6.8 or ealier.

* Fixed the bug that adding 0 length filter to BitfieldMan filters 1
  block. It should not filter anything.

* Fixed broken selected file BitTorrent download.

* Changed the default value of --proxy-method option from 'tunnel' to
  'get'. Use 'tunnel' for HTTPS regardless of --proxy-method option.

* Added --bt-external-ip option. You can specify the external IP
  address to report to a BitTorrent tracker. Although this function is
  named 'external', it can accept any kind of IP addresses.

* Applied AdaptiveURISelector-timeout patch from Pascal Rigaux at
  Mandriva. I modified the patch: make RequestGroup have the timeout
  value and AdaptiveURISelector directly modifies that value.

* Use LongestSequencePieceSelector for HTTP/FTP/BitTorrent integrated
  downloads. This PieceSelector subclass finds the longest continuous
  sequence in the available missing pieces and selects the last index
  of such sequence. This makes HTTP/FTP connections less interrupted
  by the pieces obtained by BitTorrent peers.

* Fixed the bug that the average speed is wrong in http/ftp/BitTorrent
  integrated download. Only the download bytes in BitTorrent were
  considered.

* Choose port for BitTorrent/DHT randomly from the specified range.
  REQUEST#2543518

* Send HTTP Authorization header only if it is requested by the
  server(response 401). There are some exceptions. The authorization
  header for proxy is always sent if it is available without request
  by the server.  If username/password is specified in the URI, it is
  immediately sent to the server without request by the server.
  Implements REQUEST#2540844.

* Remove leading "--" from help keyword and a substring after "=" from
  help keyword, so that one can query options by '-h--max-' or
  '-hmax-peers=10'.

* Added experimental built-in HTTP server. Currently, when a client
  accesses to the server, it responds with the current download
  progress. By default, it is disabled. To enable the server, give
  --enable-http-server option.  To change the default port number for
  the server to listen to, use --http-server-listen-port option.  The
  response HTML is very simple and refreshes it self each 1 second.
  Because of this refresh, you see flicker in normal web browser such
  as Firefox.  I recommend to use console-based browser such as
  elinks, w3m.  To connect to the server, run 'elinks
  http://localhost:6800/' while running aria2. Please replace port
  number '6800'(which is default) with your preference.

* Made (piece) hash check sequential for each RequestGroup because
  simultaneous hash check is slower than sequential execution.

* Added --bt-max-peers option to specify the maximum number of peers
  per torrent. 0 means unlimited number of peers. REQUEST#2451382

* Added --bt-hash-check-seed option.  If true is given to this option,
  after hash check using --check-integrity option and file is
  complete, continue to seed file. If you want to check file and
  download it only when it is damaged or incomplete, set this option
  to false.  This option has effect only on BitTorrent download.  The
  default value is true(This is the same behavior with the previous
  release).

* Made the max value of split option unlimited. REQUEST#2496748

* Added --event-poll option to select the method for polling events.
  The available methods are "select" and "epoll". "epoll" is
  available on Linux only. The earlier release has the compile
  option to choose from these methods.

* Included RecoverableException.h from main.cc. BUG#2498160

* Applied exit-status patch from Pascal Rigaux at Mandriva.  aria2 now
  returns last error encountered in the HTTP/FTP downloads as a exit
  status value.  If all downloads finished successfully, aria2 returns
  0.  The error code is defined in src/DownloadResult.h.  The error
  occurred in the download currently in progress is not reported as a
  last error.  If no error has encountered but there are in progress
  or waiting downloads, aria2 returns 7.

* Applied AdaptiveURISelector patch from Aurelien Lefebvre.  This
  patch adds AdaptiveURISelector, which selects one of the bests
  mirrors for first and reserved connections. For supplementary
  ones, it returns mirrors which has not been tested yet, and if
  each of them already tested, returns mirrors which has to be
  tested again. Otherwise, it doesn't return anymore mirrors.

* Fixed unit test error in HTTPResponseTest. PATCH#2485509