Changeset 6c808bdb324301d15c694cd4afd5e07110455567

Show
Ignore:
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
  • modules/stream_out/rtp.c

    r1c07ad8 r6c808bd  
    16441644 
    16451645    if( httpd_MsgGet( query, "Require" ) != NULL ) 
     1646    { 
    16461647        answer->i_status = 551; 
     1648        httpd_MsgAdd( query, "Unsupported", "%s", 
     1649                      httpd_MsgGet( query, "Require" ) ); 
     1650    } 
    16471651    else 
    16481652    switch( query->i_type ) 
     
    17461750    } 
    17471751 
    1748     httpd_MsgAdd( answer, "Server", PACKAGE_STRING ); 
     1752    httpd_MsgAdd( answer, "Server", "%s", PACKAGE_STRING ); 
    17491753    httpd_MsgAdd( answer, "Content-Length", "%d", answer->i_body ); 
    17501754    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 ); 
    17521757    httpd_MsgAdd( answer, "Cache-Control", "%s", "no-cache" ); 
    17531758 
     
    18161821 
    18171822    if( httpd_MsgGet( query, "Require" ) != NULL ) 
     1823    { 
    18181824        answer->i_status = 551; 
     1825        httpd_MsgAdd( query, "Unsupported", "%s", 
     1826                      httpd_MsgGet( query, "Require" ) ); 
     1827    } 
    18191828    else 
    18201829    switch( query->i_type ) 
     
    19942003            answer->i_status = 460; 
    19952004            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 ); 
    20012011    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"); 
    20042012    httpd_MsgAdd( answer, "Cache-Control", "%s", "no-cache" ); 
    20052013 
  • src/network/httpd.c

    r50fc170 r6c808bd  
    20372037                else if( i_msg == HTTPD_MSG_OPTIONS ) 
    20382038                { 
    2039                     const char *psz_cseq
     2039                    const char *psz
    20402040 
    20412041                    /* unimplemented */ 
     
    20432043                    answer->i_type   = HTTPD_MSG_ANSWER; 
    20442044                    answer->i_version= 0; 
     2045 
    20452046                    answer->i_status = 200; 
    20462047 
     
    20482049                    answer->p_body = NULL; 
    20492050 
    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 ); 
    20532058                    httpd_MsgAdd( answer, "Public", "DESCRIBE, SETUP, " 
    20542059                                 "TEARDOWN, PLAY, PAUSE" ); 
    2055                     httpd_MsgAdd( answer, "Content-Length", "%d", 
    2056                                   answer->i_body ); 
     2060                    httpd_MsgAdd( answer, "Content-Length", "0" ); 
    20572061 
    20582062                    cl->i_buffer = -1;  /* Force the creation of the answer in