FR 2540 then AA 8679 at Madrid
Bucharest → Madrid → Porto
Timetable, Madrid time
13:55FR 2540 from Bucharest at the gate
11:25AA 8679 to Porto leaves the gate
21 h 30 apart on the timetable, overnight
AA 8679 leaves 21 h 30 after FR 2540 arrives on the timetable: more than half a day, so not a connection we count.