diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2015-04-13 15:39:58 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-04-23 17:43:44 +0200 |
commit | 44b769e497f9e972e398f98a3d80267ac03e3e1d (patch) | |
tree | e0deb76117b7c14830c09ffdf9152f83f4d4e2aa /src/stransport_stream.c | |
parent | 65ac7ddcccbf28158d75cfa4e524500f5fdd5f4e (diff) | |
download | libgit2-44b769e497f9e972e398f98a3d80267ac03e3e1d.tar.gz |
SecureTransport: handle graceful closescmn/secure-transport
On close, we might get a return code which looks like an error but just
means that the other side closed gracefully. Handle that.
Diffstat (limited to 'src/stransport_stream.c')
-rw-r--r-- | src/stransport_stream.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/stransport_stream.c b/src/stransport_stream.c index db993ffb7..429aa2d55 100644 --- a/src/stransport_stream.c +++ b/src/stransport_stream.c @@ -19,7 +19,7 @@ int stransport_error(OSStatus ret) { CFStringRef message; - if (ret == noErr) { + if (ret == noErr || ret == errSSLClosedGraceful) { giterr_clear(); return 0; } @@ -183,7 +183,8 @@ int stransport_close(git_stream *stream) stransport_stream *st = (stransport_stream *) stream; OSStatus ret; - if ((ret = SSLClose(st->ctx)) != noErr) + ret = SSLClose(st->ctx); + if (ret != noErr && ret != errSSLClosedGraceful) return stransport_error(ret); return git_stream_close(st->io); |