#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
+#ifndef AUTO_WINSOCK
+#ifdef WINSOCK_TWO
+#include <winsock2.h>
+#else
#include <winsock.h>
+#endif
+#endif
#include "putty.h"
* Set up SYNCH state.
*/
in_synch = FALSE;
+
+ /*
+ * We have no pre-session phase.
+ */
+ begin_session();
+
return NULL;
}
case FD_CLOSE:
{
int clear_of_oob = 1;
- if (ioctlsocket (s, SIOCATMARK, &clear_of_oob) < 0 )
- return -20000-WSAGetLastError();
+
+ /* Don't check for error return; some shims don't support
+ * this ioctl.
+ */
+ ioctlsocket (s, SIOCATMARK, &clear_of_oob);
in_synch = !clear_of_oob;
send_opt (o_echo.nsend, o_echo.option);
}
break;
+ case TS_PING:
+ if (o_they_sga.state == ACTIVE) {
+ b[1] = NOP;
+ s_write (b, 2);
+ }
+ break;
}
}
telnet_size,
telnet_special,
telnet_socket,
- telnet_sendok
+ telnet_sendok,
+ 23
};