Explicitly prevent use of FEATURE_CONNECTION_SHARING without FEATURE_CONNECTION_KEEP_...
[privoxy.git] / gateway.c
index f5d15a5..46db1e3 100644 (file)
--- a/gateway.c
+++ b/gateway.c
@@ -129,6 +129,9 @@ struct socks_reply {
 static const char socks_userid[] = "anonymous";
 
 #ifdef FEATURE_CONNECTION_SHARING
+#ifndef FEATURE_CONNECTION_KEEP_ALIVE
+#error Using FEATURE_CONNECTION_SHARING without FEATURE_CONNECTION_KEEP_ALIVE is impossible
+#endif
 
 #define MAX_REUSABLE_CONNECTIONS 100
 
@@ -218,6 +221,7 @@ void remember_connection(const struct reusable_connection *connection)
       return;
    }
 
+   assert(slot < SZ(reusable_connection));
    assert(NULL != connection->host);
    reusable_connection[slot].host = strdup_or_die(connection->host);
    reusable_connection[slot].sfd = connection->sfd;