Changeset a92c4fff8f7690496c9fa11cf99a7c494012c72f
- Timestamp:
- 21/08/07 21:16:09
(1 year ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1187723769 +0000
- git-parent:
[649ddb6f6488e80fd2a14f5c0899474679a00af7]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1187723769 +0000
- Message:
- Do not parse CSeq; do not assume it fits in an integer
- Factorize some code
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r649ddb6 |
ra92c4ff |
|
| 1627 | 1627 | const char *psz_session = NULL; |
|---|
| 1628 | 1628 | const char *psz_cseq = NULL; |
|---|
| 1629 | | int i_cseq = 0; |
|---|
| 1630 | 1629 | |
|---|
| 1631 | 1630 | if( answer == NULL || query == NULL ) |
|---|
| … | … | |
| 1638 | 1637 | answer->i_version= query->i_version; |
|---|
| 1639 | 1638 | answer->i_type = HTTPD_MSG_ANSWER; |
|---|
| | 1639 | answer->i_body = 0; |
|---|
| | 1640 | answer->p_body = NULL; |
|---|
| 1640 | 1641 | |
|---|
| 1641 | 1642 | switch( query->i_type ) |
|---|
| … | … | |
| 1658 | 1659 | /* for now only multicast so easy */ |
|---|
| 1659 | 1660 | answer->i_status = 200; |
|---|
| 1660 | | answer->i_body = 0; |
|---|
| 1661 | | answer->p_body = NULL; |
|---|
| 1662 | 1661 | |
|---|
| 1663 | 1662 | psz_session = httpd_MsgGet( query, "Session" ); |
|---|
| … | … | |
| 1699 | 1698 | /* for now only multicast so easy again */ |
|---|
| 1700 | 1699 | answer->i_status = 200; |
|---|
| 1701 | | answer->i_body = 0; |
|---|
| 1702 | | answer->p_body = NULL; |
|---|
| 1703 | 1700 | |
|---|
| 1704 | 1701 | psz_session = httpd_MsgGet( query, "Session" ); |
|---|
| … | … | |
| 1735 | 1732 | return VLC_EGENERIC; |
|---|
| 1736 | 1733 | } |
|---|
| | 1734 | |
|---|
| 1737 | 1735 | httpd_MsgAdd( answer, "Server", PACKAGE_STRING ); |
|---|
| 1738 | 1736 | httpd_MsgAdd( answer, "Content-Length", "%d", answer->i_body ); |
|---|
| 1739 | 1737 | psz_cseq = httpd_MsgGet( query, "Cseq" ); |
|---|
| 1740 | | if( psz_cseq ) |
|---|
| 1741 | | i_cseq = atoi( psz_cseq ); |
|---|
| 1742 | | else |
|---|
| 1743 | | i_cseq = 0; |
|---|
| 1744 | | httpd_MsgAdd( answer, "Cseq", "%d", i_cseq ); |
|---|
| | 1738 | httpd_MsgAdd( answer, "Cseq", "%u", psz_cseq ? psz_cseq : "0" ); |
|---|
| 1745 | 1739 | httpd_MsgAdd( answer, "Cache-Control", "%s", "no-cache" ); |
|---|
| 1746 | 1740 | |
|---|
| … | … | |
| 1760 | 1754 | const char *psz_session = NULL; |
|---|
| 1761 | 1755 | const char *psz_cseq = NULL; |
|---|
| 1762 | | int i_cseq = 0; |
|---|
| 1763 | 1756 | |
|---|
| 1764 | 1757 | |
|---|
| … | … | |
| 1774 | 1767 | answer->i_version= query->i_version; |
|---|
| 1775 | 1768 | answer->i_type = HTTPD_MSG_ANSWER; |
|---|
| | 1769 | answer->i_body = 0; |
|---|
| | 1770 | answer->p_body = NULL; |
|---|
| 1776 | 1771 | |
|---|
| 1777 | 1772 | switch( query->i_type ) |
|---|
| … | … | |
| 1783 | 1778 | { |
|---|
| 1784 | 1779 | answer->i_status = 461; |
|---|
| 1785 | | answer->i_body = 0; |
|---|
| 1786 | | answer->p_body = NULL; |
|---|
| 1787 | 1780 | break; |
|---|
| 1788 | 1781 | } |
|---|
| … | … | |
| 1794 | 1787 | //fprintf( stderr, "HTTPD_MSG_SETUP: multicast\n" ); |
|---|
| 1795 | 1788 | answer->i_status = 200; |
|---|
| 1796 | | answer->i_body = 0; |
|---|
| 1797 | | answer->p_body = NULL; |
|---|
| 1798 | 1789 | |
|---|
| 1799 | 1790 | psz_session = httpd_MsgGet( query, "Session" ); |
|---|
| … | … | |
| 1818 | 1809 | { |
|---|
| 1819 | 1810 | answer->i_status = 500; |
|---|
| 1820 | | answer->i_body = 0; |
|---|
| 1821 | | answer->p_body = NULL; |
|---|
| 1822 | 1811 | break; |
|---|
| 1823 | 1812 | } |
|---|
| … | … | |
| 1837 | 1826 | { |
|---|
| 1838 | 1827 | answer->i_status = 454; |
|---|
| 1839 | | answer->i_body = 0; |
|---|
| 1840 | | answer->p_body = NULL; |
|---|
| 1841 | 1828 | break; |
|---|
| 1842 | 1829 | } |
|---|
| … | … | |
| 1859 | 1846 | psz_access, psz_url ); |
|---|
| 1860 | 1847 | answer->i_status = 500; |
|---|
| 1861 | | answer->i_body = 0; |
|---|
| 1862 | | answer->p_body = NULL; |
|---|
| 1863 | 1848 | break; |
|---|
| 1864 | 1849 | } |
|---|
| … | … | |
| 1868 | 1853 | |
|---|
| 1869 | 1854 | answer->i_status = 200; |
|---|
| 1870 | | answer->i_body = 0; |
|---|
| 1871 | | answer->p_body = NULL; |
|---|
| 1872 | 1855 | |
|---|
| 1873 | 1856 | httpd_MsgAdd( answer, "Transport", |
|---|
| … | … | |
| 1877 | 1860 | { |
|---|
| 1878 | 1861 | answer->i_status = 461; |
|---|
| 1879 | | answer->i_body = 0; |
|---|
| 1880 | | answer->p_body = NULL; |
|---|
| 1881 | 1862 | } |
|---|
| 1882 | 1863 | break; |
|---|
| … | … | |
| 1886 | 1867 | return VLC_EGENERIC; |
|---|
| 1887 | 1868 | } |
|---|
| | 1869 | |
|---|
| 1888 | 1870 | httpd_MsgAdd( answer, "Server", "VLC Server" ); |
|---|
| 1889 | 1871 | httpd_MsgAdd( answer, "Content-Length", "%d", answer->i_body ); |
|---|
| 1890 | 1872 | psz_cseq = httpd_MsgGet( query, "Cseq" ); |
|---|
| 1891 | | if( psz_cseq ) |
|---|
| 1892 | | i_cseq = atoi( psz_cseq ); |
|---|
| 1893 | | else |
|---|
| 1894 | | i_cseq = 0; |
|---|
| 1895 | | httpd_MsgAdd( answer, "Cseq", "%d", i_cseq ); |
|---|
| | 1873 | httpd_MsgAdd( answer, "Cseq", "%s", psz_cseq ? psz_cseq : "0"); |
|---|
| 1896 | 1874 | httpd_MsgAdd( answer, "Cache-Control", "%s", "no-cache" ); |
|---|
| 1897 | 1875 | |
|---|
| r649ddb6 |
ra92c4ff |
|
| 1297 | 1297 | msg->i_body_offset = 0; |
|---|
| 1298 | 1298 | msg->i_body = 0; |
|---|
| 1299 | | msg->p_body = 0; |
|---|
| | 1299 | msg->p_body = NULL; |
|---|
| 1300 | 1300 | } |
|---|
| 1301 | 1301 | |
|---|