Major destabilisation, phase 1. In this phase I've moved (I think)
[u/mdw/putty] / raw.c
diff --git a/raw.c b/raw.c
index 58b060c..406dc43 100644 (file)
--- a/raw.c
+++ b/raw.c
 
 static Socket s = NULL;
 static int raw_bufsize;
+static void *frontend;
 
 static void raw_size(void);
 
 static void c_write(char *buf, int len)
 {
-    int backlog = from_backend(0, buf, len);
+    int backlog = from_backend(frontend, 0, buf, len);
     sk_set_frozen(s, backlog > RAW_MAX_BACKLOG);
 }
 
@@ -33,7 +34,8 @@ static int raw_closing(Plug plug, char *error_msg, int error_code,
     }
     if (error_msg) {
        /* A socket error has occurred. */
-       connection_fatal(error_msg);
+       logevent(error_msg);
+       connection_fatal("%s", error_msg);
     }                                 /* Otherwise, the remote side closed the connection normally. */
     return 0;
 }
@@ -57,7 +59,8 @@ static void raw_sent(Plug plug, int bufsize)
  * Also places the canonical host name into `realhost'. It must be
  * freed by the caller.
  */
-static char *raw_init(char *host, int port, char **realhost, int nodelay)
+static char *raw_init(void *frontend_handle, char *host, int port,
+                     char **realhost, int nodelay)
 {
     static struct plug_function_table fn_table = {
        raw_closing,
@@ -68,6 +71,8 @@ static char *raw_init(char *host, int port, char **realhost, int nodelay)
     SockAddr addr;
     char *err;
 
+    frontend = frontend_handle;
+
     /*
      * Try to find host.
      */