Commit 44b769e4 by Carlos Martín Nieto

SecureTransport: handle graceful closes

On close, we might get a return code which looks like an error but just
means that the other side closed gracefully. Handle that.
parent 65ac7ddc
...@@ -19,7 +19,7 @@ int stransport_error(OSStatus ret) ...@@ -19,7 +19,7 @@ int stransport_error(OSStatus ret)
{ {
CFStringRef message; CFStringRef message;
if (ret == noErr) { if (ret == noErr || ret == errSSLClosedGraceful) {
giterr_clear(); giterr_clear();
return 0; return 0;
} }
...@@ -183,7 +183,8 @@ int stransport_close(git_stream *stream) ...@@ -183,7 +183,8 @@ int stransport_close(git_stream *stream)
stransport_stream *st = (stransport_stream *) stream; stransport_stream *st = (stransport_stream *) stream;
OSStatus ret; OSStatus ret;
if ((ret = SSLClose(st->ctx)) != noErr) ret = SSLClose(st->ctx);
if (ret != noErr && ret != errSSLClosedGraceful)
return stransport_error(ret); return stransport_error(ret);
return git_stream_close(st->io); return git_stream_close(st->io);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment