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