libgit2/libgit2 — pull request #912 by schu (2012-09-03 12:41:24+00:00)
Title: netops: be more careful with SSL errors

SSL_get_error() allows to receive a result code for various SSL
operations. Depending on the return value (see man (3) SSL_get_error)
there might be additional information in the OpenSSL error queue. Return
the queued message if available, otherwise set an error message
corresponding to the return code.

@carlosmn: roughly what we talked about; note that for `SSL_ERROR_WANT_READ`
etc. the user is supposed to repeat the call for an unknown number of times ("I/O
function should be called again later"). Maybe it's not worth it and we should just
set `giterr_set(GITERR_NET, "SSL error (%d)", err)`.