Changeset 6c808bdb324301d15c694cd4afd5e07110455567
- Timestamp:
- 22/08/07 21:49:44
(1 year ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1187812184 +0000
- git-parent:
[1c07ad889d463aa304608c4976b3b48ac5fbe5bc]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1187812184 +0000
- Message:
Fix Require header support
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r1c07ad8 |
r6c808bd |
|
| 1644 | 1644 | |
|---|
| 1645 | 1645 | if( httpd_MsgGet( query, "Require" ) != NULL ) |
|---|
| | 1646 | { |
|---|
| 1646 | 1647 | answer->i_status = 551; |
|---|
| | 1648 | httpd_MsgAdd( query, "Unsupported", "%s", |
|---|
| | 1649 | httpd_MsgGet( query, "Require" ) ); |
|---|
| | 1650 | } |
|---|
| 1647 | 1651 | else |
|---|
| 1648 | 1652 | switch( query->i_type ) |
|---|
| … | … | |
| 1746 | 1750 | } |
|---|
| 1747 | 1751 | |
|---|
| 1748 | | httpd_MsgAdd( answer, "Server", PACKAGE_STRING ); |
|---|
| | 1752 | httpd_MsgAdd( answer, "Server", "%s", PACKAGE_STRING ); |
|---|
| 1749 | 1753 | httpd_MsgAdd( answer, "Content-Length", "%d", answer->i_body ); |
|---|
| 1750 | 1754 | psz_cseq = httpd_MsgGet( query, "Cseq" ); |
|---|
| 1751 | | httpd_MsgAdd( answer, "Cseq", "%s", psz_cseq ? psz_cseq : "0" ); |
|---|
| | 1755 | if( psz_cseq ) |
|---|
| | 1756 | httpd_MsgAdd( answer, "Cseq", "%s", psz_cseq ); |
|---|
| 1752 | 1757 | httpd_MsgAdd( answer, "Cache-Control", "%s", "no-cache" ); |
|---|
| 1753 | 1758 | |
|---|
| … | … | |
| 1816 | 1821 | |
|---|
| 1817 | 1822 | if( httpd_MsgGet( query, "Require" ) != NULL ) |
|---|
| | 1823 | { |
|---|
| 1818 | 1824 | answer->i_status = 551; |
|---|
| | 1825 | httpd_MsgAdd( query, "Unsupported", "%s", |
|---|
| | 1826 | httpd_MsgGet( query, "Require" ) ); |
|---|
| | 1827 | } |
|---|
| 1819 | 1828 | else |
|---|
| 1820 | 1829 | switch( query->i_type ) |
|---|
| … | … | |
| 1994 | 2003 | answer->i_status = 460; |
|---|
| 1995 | 2004 | break; |
|---|
| 1996 | | |
|---|
| 1997 | | return VLC_EGENERIC; |
|---|
| 1998 | | } |
|---|
| 1999 | | |
|---|
| 2000 | | httpd_MsgAdd( answer, "Server", PACKAGE_STRING ); |
|---|
| | 2005 | } |
|---|
| | 2006 | |
|---|
| | 2007 | psz_cseq = httpd_MsgGet( query, "Cseq" ); |
|---|
| | 2008 | if( psz_cseq ) |
|---|
| | 2009 | httpd_MsgAdd( answer, "Cseq", "%s", psz_cseq ); |
|---|
| | 2010 | httpd_MsgAdd( answer, "Server", "%s", PACKAGE_STRING ); |
|---|
| 2001 | 2011 | httpd_MsgAdd( answer, "Content-Length", "%d", answer->i_body ); |
|---|
| 2002 | | psz_cseq = httpd_MsgGet( query, "Cseq" ); |
|---|
| 2003 | | httpd_MsgAdd( answer, "Cseq", "%s", psz_cseq ? psz_cseq : "0"); |
|---|
| 2004 | 2012 | httpd_MsgAdd( answer, "Cache-Control", "%s", "no-cache" ); |
|---|
| 2005 | 2013 | |
|---|
| r50fc170 |
r6c808bd |
|
| 2037 | 2037 | else if( i_msg == HTTPD_MSG_OPTIONS ) |
|---|
| 2038 | 2038 | { |
|---|
| 2039 | | const char *psz_cseq; |
|---|
| | 2039 | const char *psz; |
|---|
| 2040 | 2040 | |
|---|
| 2041 | 2041 | /* unimplemented */ |
|---|
| … | … | |
| 2043 | 2043 | answer->i_type = HTTPD_MSG_ANSWER; |
|---|
| 2044 | 2044 | answer->i_version= 0; |
|---|
| | 2045 | |
|---|
| 2045 | 2046 | answer->i_status = 200; |
|---|
| 2046 | 2047 | |
|---|
| … | … | |
| 2048 | 2049 | answer->p_body = NULL; |
|---|
| 2049 | 2050 | |
|---|
| 2050 | | psz_cseq = httpd_MsgGet( query, "Cseq" ); |
|---|
| 2051 | | httpd_MsgAdd( answer, "Cseq", "%s", psz_cseq ? psz_cseq : "0" ); |
|---|
| 2052 | | httpd_MsgAdd( answer, "Server", "VLC Server" ); |
|---|
| | 2051 | psz = httpd_MsgGet( query, "Cseq" ); |
|---|
| | 2052 | if( psz != NULL ) |
|---|
| | 2053 | httpd_MsgAdd( answer, "Cseq", "%s", psz ); |
|---|
| | 2054 | psz = httpd_MsgGet( query, "Require" ); |
|---|
| | 2055 | if( psz != NULL ) |
|---|
| | 2056 | httpd_MsgAdd( query, "Unsupported", "%s", psz ); |
|---|
| | 2057 | httpd_MsgAdd( answer, "Server", "%s", PACKAGE_STRING ); |
|---|
| 2053 | 2058 | httpd_MsgAdd( answer, "Public", "DESCRIBE, SETUP, " |
|---|
| 2054 | 2059 | "TEARDOWN, PLAY, PAUSE" ); |
|---|
| 2055 | | httpd_MsgAdd( answer, "Content-Length", "%d", |
|---|
| 2056 | | answer->i_body ); |
|---|
| | 2060 | httpd_MsgAdd( answer, "Content-Length", "0" ); |
|---|
| 2057 | 2061 | |
|---|
| 2058 | 2062 | cl->i_buffer = -1; /* Force the creation of the answer in |
|---|