* freed by the caller.
*/
static char *raw_init(void *frontend_handle, void **backend_handle,
+ Config *cfg,
char *host, int port, char **realhost, int nodelay)
{
static const struct plug_function_table fn_table = {
logevent(raw->frontend, buf);
sfree(buf);
}
- addr = name_lookup(host, port, realhost);
+ addr = name_lookup(host, port, realhost, cfg);
if ((err = sk_addr_error(addr)) != NULL)
return err;
logevent(raw->frontend, buf);
sfree(buf);
}
- raw->s = new_connection(addr, *realhost, port, 0, 1, nodelay, (Plug) raw);
+ raw->s = new_connection(addr, *realhost, port, 0, 1, nodelay,
+ (Plug) raw, cfg);
if ((err = sk_socket_error(raw->s)) != NULL)
return err;
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).
+ */
+static void raw_reconfig(void *handle, Config *cfg)
+{
+}
+
/*
* Called to send data down the raw connection.
*/
Backend raw_backend = {
raw_init,
+ raw_free,
+ raw_reconfig,
raw_send,
raw_sendbuffer,
raw_size,