answer->p_body = NULL;
if( httpd_MsgGet( query, "Require" ) != NULL )
+ {
answer->i_status = 551;
+ httpd_MsgAdd( query, "Unsupported", "%s",
+ httpd_MsgGet( query, "Require" ) );
+ }
else
switch( query->i_type )
{
return VLC_EGENERIC;
}
- httpd_MsgAdd( answer, "Server", PACKAGE_STRING );
+ httpd_MsgAdd( answer, "Server", "%s", PACKAGE_STRING );
httpd_MsgAdd( answer, "Content-Length", "%d", answer->i_body );
psz_cseq = httpd_MsgGet( query, "Cseq" );
- httpd_MsgAdd( answer, "Cseq", "%s", psz_cseq ? psz_cseq : "0" );
+ if( psz_cseq )
+ httpd_MsgAdd( answer, "Cseq", "%s", psz_cseq );
httpd_MsgAdd( answer, "Cache-Control", "%s", "no-cache" );
if( psz_session )
}
if( httpd_MsgGet( query, "Require" ) != NULL )
+ {
answer->i_status = 551;
+ httpd_MsgAdd( query, "Unsupported", "%s",
+ httpd_MsgGet( query, "Require" ) );
+ }
else
switch( query->i_type )
{
default:
answer->i_status = 460;
break;
-
- return VLC_EGENERIC;
}
- httpd_MsgAdd( answer, "Server", PACKAGE_STRING );
- httpd_MsgAdd( answer, "Content-Length", "%d", answer->i_body );
psz_cseq = httpd_MsgGet( query, "Cseq" );
- httpd_MsgAdd( answer, "Cseq", "%s", psz_cseq ? psz_cseq : "0");
+ if( psz_cseq )
+ httpd_MsgAdd( answer, "Cseq", "%s", psz_cseq );
+ httpd_MsgAdd( answer, "Server", "%s", PACKAGE_STRING );
+ httpd_MsgAdd( answer, "Content-Length", "%d", answer->i_body );
httpd_MsgAdd( answer, "Cache-Control", "%s", "no-cache" );
if( psz_session )
}
else if( i_msg == HTTPD_MSG_OPTIONS )
{
- const char *psz_cseq;
+ const char *psz;
/* unimplemented */
answer->i_proto = query->i_proto ;
answer->i_type = HTTPD_MSG_ANSWER;
answer->i_version= 0;
+
answer->i_status = 200;
answer->i_body = 0;
answer->p_body = NULL;
- psz_cseq = httpd_MsgGet( query, "Cseq" );
- httpd_MsgAdd( answer, "Cseq", "%s", psz_cseq ? psz_cseq : "0" );
- httpd_MsgAdd( answer, "Server", "VLC Server" );
+ psz = httpd_MsgGet( query, "Cseq" );
+ if( psz != NULL )
+ httpd_MsgAdd( answer, "Cseq", "%s", psz );
+ psz = httpd_MsgGet( query, "Require" );
+ if( psz != NULL )
+ httpd_MsgAdd( query, "Unsupported", "%s", psz );
+ httpd_MsgAdd( answer, "Server", "%s", PACKAGE_STRING );
httpd_MsgAdd( answer, "Public", "DESCRIBE, SETUP, "
"TEARDOWN, PLAY, PAUSE" );
- httpd_MsgAdd( answer, "Content-Length", "%d",
- answer->i_body );
+ httpd_MsgAdd( answer, "Content-Length", "0" );
cl->i_buffer = -1; /* Force the creation of the answer in
* httpd_ClientSend */