downstream: added peer information lookup to the connection getter
@@ -290,6 +290,18 @@ struct flb_connection *flb_downstream_conn_get(struct flb_downstream *stream)
connection->busy_flag = FLB_FALSE;
+ result = flb_connection_get_remote_address(connection);
+
+ if (result != 0) {
+ flb_debug("[downstream] connection #%i failed to "
+ "get peer information",
+ connection->fd);
+
+ prepare_destroy_conn_safe(connection);
+
+ return NULL;
+ }
+
return connection;
}
