mirror of https://github.com/cy384/ssheven.git
improve connection shutdown handling
This commit is contained in:
parent
46e6675afe
commit
19a4995d08
15
ssheven.c
15
ssheven.c
|
@ -21,7 +21,8 @@
|
||||||
// functions to convert error and status codes to strings
|
// functions to convert error and status codes to strings
|
||||||
#include "ssheven-debug.h"
|
#include "ssheven-debug.h"
|
||||||
|
|
||||||
#define SSHEVEN_VERSION "0.0.0"
|
// version string
|
||||||
|
#define SSHEVEN_VERSION "0.0.1"
|
||||||
|
|
||||||
// network buffer size
|
// network buffer size
|
||||||
enum { buffer_size = 4096 };
|
enum { buffer_size = 4096 };
|
||||||
|
@ -171,11 +172,21 @@ void do_ssh_connection(char* hostname, char* username, char* password, char* com
|
||||||
OTRcvDisconnect(endpoint, nil);
|
OTRcvDisconnect(endpoint, nil);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case T_ORDREL:
|
||||||
|
err = OTRcvOrderlyDisconnect(endpoint);
|
||||||
|
if (err == noErr)
|
||||||
|
{
|
||||||
|
err = OTSndOrderlyDisconnect(endpoint);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
printf("unexpected OTLook result while closing: %d\n", result);
|
printf("unexpected OTLook result while closing: %s\n", OT_event_string(result));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
OT_cleanup:
|
OT_cleanup:
|
||||||
|
|
||||||
// release endpoint
|
// release endpoint
|
||||||
|
|
Loading…
Reference in New Issue