Introduce a sane interface function, from_backend(), for backends to
[u/mdw/putty] / raw.c
diff --git a/raw.c b/raw.c
index f7df52c..3f82d7a 100644 (file)
--- a/raw.c
+++ b/raw.c
@@ -1,7 +1,13 @@
 #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"
 
@@ -48,8 +54,7 @@ static void s_write (void *buf, int len) {
 }
 
 static void c_write (char *buf, int len) {
-    while (len--) 
-        c_write1(*buf++);
+    from_backend(0, buf, len);
 }
 
 /*
@@ -237,5 +242,6 @@ Backend raw_backend = {
     raw_size,
     raw_special,
     raw_socket,
-    raw_sendok
+    raw_sendok,
+    1
 };