char *err;
Raw raw;
- raw = smalloc(sizeof(*raw));
+ raw = snew(struct raw_backend_data);
raw->fn = &fn_table;
raw->s = NULL;
*backend_handle = raw;
return NULL;
}
+static void raw_free(void *handle)
+{
+ Raw raw = (Raw) handle;
+
+ if (raw->s)
+ sk_close(raw->s);
+ sfree(raw);
+}
+
/*
* Stub routine (we don't have any need to reconfigure this backend).
*/
return;
}
+/*
+ * Return a list of the special codes that make sense in this
+ * protocol.
+ */
+static const struct telnet_special *raw_get_specials(void *handle)
+{
+ return NULL;
+}
+
static Socket raw_socket(void *handle)
{
Raw raw = (Raw) handle;
static int raw_exitcode(void *handle)
{
- /* Exit codes are a meaningless concept in the Raw protocol */
- return 0;
+ Raw raw = (Raw) handle;
+ if (raw->s != NULL)
+ return -1; /* still connected */
+ else
+ /* Exit codes are a meaningless concept in the Raw protocol */
+ return 0;
}
Backend raw_backend = {
raw_init,
+ raw_free,
raw_reconfig,
raw_send,
raw_sendbuffer,
raw_size,
raw_special,
+ raw_get_specials,
raw_socket,
raw_exitcode,
raw_sendok,