Sayyiduna Abdullah bin Zayd (may Allah be pleased with him) says that a complaint was made to the Prophet (peace and blessings be upon him) about a man who imagines something during the prayer, and he (peace and blessings be upon him) said: "He should not turn away until he hears a sound or finds a smell."
(b) Imam al-Shafi'i (may Allah have mercy on him) says that when wind is passed, leaving the prayer is the Sunnah; and this is also like (the passing of) urine and stool.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الطهارة / 555
Hammam (may Allah have mercy on him) says: (a) Sayyiduna Jarir (may Allah be pleased with him) urinated, then performed ablution and wiped over his leather socks. It was said to him: You do this even though you have urinated? He said: "Yes! I saw the Messenger of Allah (peace and blessings be upon him); he (peace and blessings be upon him) urinated, then performed ablution and wiped over his leather socks." Ibrahim (may Allah have mercy on him) said: This hadith pleased them, because Sayyiduna Jarir (may Allah be pleased with him) accepted Islam after the revelation of Surah al-Ma'idah.
(b) It is narrated from Sayyiduna Jarir bin Abdullah (may Allah be pleased with him) that he urinated, then performed ablution and wiped over his leather socks. We said to him: What is this that you have done? He said: "I saw the Messenger of Allah (peace and blessings be upon him); he (peace and blessings be upon him) did just as I have done."
(c) Imam al-Bukhari (may Allah have mercy on him) recorded this narration from al-A'mash (may Allah have mercy on him) through another chain.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الطهارة / 556
Zirr bin Hubaysh (may Allah have mercy on him) says: I came to Safwan bin Assal (may Allah be pleased with him) and said to him: You are one of the Companions of the Messenger; something troubles my heart about whether wiping over the leather socks after relieving oneself and urinating is valid or not, so inform me about it, if you have heard anything from the Messenger of Allah (peace and blessings be upon him). He said: He (peace and blessings be upon him) used to command us: "When you are on a journey, do not take off your leather socks for three days and three nights except for major ritual impurity (janabah); but do not take them off for urine, relieving oneself or sleep."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الطهارة / 557
Sayyiduna Safwan bin Assal (may Allah be pleased with him) says: "The Messenger of Allah (peace and blessings be upon him) granted us a concession in wiping, for the traveller up to three days, except from major ritual impurity (janabah), (for which they are to be removed); but they are not to be removed for relieving oneself, urine or passing wind."
(b) Abu al-Walid says that no one other than Mis'ar narrated the words 'or wind'.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الطهارة / 558
Mis'ar (may Allah have mercy on him) narrated it likewise. Ali (may Allah have mercy on him) says that in this hadith no one other than Waki', from Mis'ar, narrated the words 'or wind'.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الطهارة / 559