أَخْبَرَنَا مُحَمَّدُ بْنُ رَافِعٍ، قَالَ حَدَّثَنَا يَحْيَى بْنُ آدَمَ، قَالَ حَدَّثَنَا مُفَضَّلٌ، عَنْ مَنْصُورٍ، عَنْ مُجَاهِدٍ، عَنْ طَاوُسٍ، عَنِ ابْنِ عَبَّاسٍ، قَالَ سَافَرَ رَسُولُ اللَّهِ صلى الله عليه وسلم فَصَامَ حَتَّى بَلَغَ عُسْفَانَ ثُمَّ دَعَا بِإِنَاءٍ فَشَرِبَ نَهَارًا لِيَرَاهُ النَّاسُ ثُمَّ أَفْطَرَ حَتَّى دَخَلَ مَكَّةَ فَافْتَتَحَ مَكَّةَ فِي رَمَضَانَ قَالَ ابْنُ عَبَّاسٍ فَصَامَ رَسُولُ اللَّهِ صلى الله عليه وسلم فِي السَّفَرِ وَأَفْطَرَ فَمَنْ شَاءَ صَامَ وَمَنْ شَاءَ أَفْطَرَ ‏.‏

It was narrated that Ibn 'Abbas said: "The Messenger of Allah traveled and fasted until he reached 'Usfan, then he called for a cup and drank durink the day when the people could see him. Hen he did not fast until he reached Makkah, and he conquered Makkah during Ramadan." Ibn 'Abbas said: "And the Messenger of Allah fasted until he reach Makkah, and he conquered Makkah during Ramadan." Ibn 'Abbas said: "And the Messenger of Allah fasted and broke his fast while traveling, so whoever wishes may fast, and whoever wishes may not fast." Translation Not Available

Book Ref: Sunan An Nisai Book 22 Hadith 2314
Web Ref:  Sunan An Nisai Vol 3 Book 22 Hadith 2316