void stream_sock_shutw(struct stream_interface *si);
void stream_sock_chk_rcv(struct stream_interface *si);
void stream_sock_chk_snd(struct stream_interface *si);
+void stream_sock_prepare_interface(struct stream_interface *si);
/* This either returns the sockname or the original destination address. Code
#include <proto/lb_fwrr.h>
#include <proto/lb_map.h>
#include <proto/proto_http.h>
+#include <proto/proto_tcp.h>
#include <proto/queue.h>
#include <proto/server.h>
#include <proto/session.h>
+#include <proto/stream_sock.h>
#include <proto/task.h>
/*
return SN_ERR_INTERNAL;
}
- if (!s->req->cons->connect)
- return SN_ERR_INTERNAL;
+ /* Prepare the stream interface for a TCP connection. Later
+ * we may assign a protocol-specific connect() function.
+ */
+ stream_sock_prepare_interface(s->req->cons);
+ s->req->cons->connect = tcpv4_connect_server;
assign_tproxy_address(s);
/*
* Functions operating on SOCK_STREAM and buffers.
*
- * Copyright 2000-2009 Willy Tarreau <w@1wt.eu>
+ * Copyright 2000-2010 Willy Tarreau <w@1wt.eu>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
return 0;
}
+/* Prepare a stream interface to be used in socket mode. */
+void stream_sock_prepare_interface(struct stream_interface *si)
+{
+ si->update = stream_sock_data_finish;
+ si->shutr = stream_sock_shutr;
+ si->shutw = stream_sock_shutw;
+ si->chk_rcv = stream_sock_chk_rcv;
+ si->chk_snd = stream_sock_chk_snd;
+ si->iohandler = NULL;
+}
+
/*
* Local variables: