MEDIUM: stream_interface: derive the socket operations from the target
Instead of hard-coding sock_raw in connect_server(), we set this socket
operation at config parsing time. Right now, only servers and peers have
it. Proxies are still hard-coded as sock_raw. This will be needed for
future work on SSL which requires a different socket layer.
diff --git a/include/types/peers.h b/include/types/peers.h
index 50e4ea3..9e33d6d 100644
--- a/include/types/peers.h
+++ b/include/types/peers.h
@@ -74,6 +74,8 @@
time_t last_change;
struct sockaddr_storage addr; /* peer address */
struct protocol *proto; /* peer address protocol */
+ struct sock_ops *sock; /* peer socket operations */
+ void *sock_init_arg; /* socket operations's opaque init argument if needed */
struct peer *next; /* next peer in the list */
};