Commit a4de52f8 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Faster code

parent 3de41d49
...@@ -565,16 +565,22 @@ static int httpd_RedirectCallBack( httpd_callback_sys_t *p_sys, ...@@ -565,16 +565,22 @@ static int httpd_RedirectCallBack( httpd_callback_sys_t *p_sys,
answer->psz_status = strdup( "Moved Permanently" ); answer->psz_status = strdup( "Moved Permanently" );
p = answer->p_body = malloc( 1000 + strlen( rdir->psz_dst ) ); p = answer->p_body = malloc( 1000 + strlen( rdir->psz_dst ) );
p += sprintf( p, "<html>\n" ); p += sprintf( (char *)p,
p += sprintf( p, "<head>\n" ); "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"
p += sprintf( p, "<title>Redirection</title>\n" ); "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" "
p += sprintf( p, "</head>\n" ); "\"http://www.w3.org/TR/xhtml10/DTD/xhtml10transitional.dtd\">\n"
p += sprintf( p, "<body>\n" ); "<html>\n"
p += sprintf( p, "<h1><center>You should be <a href=\"%s\">redirected</a></center></h1>\n", rdir->psz_dst ); "<head>\n"
p += sprintf( p, "<hr />\n" ); "<title>Redirection</title>\n"
p += sprintf( p, "<a href=\"http://www.videolan.org\">VideoLAN</a>\n" ); "</head>\n"
p += sprintf( p, "</body>\n" ); "<body>\n"
p += sprintf( p, "</html>\n" ); "<h1>You should be "
"<a href=\"%s\">redirected</a></h1>\n"
"<hr />\n"
"<p><a href=\"http://www.videolan.org\">VideoLAN</a>\n</p>"
"<hr />\n"
"</body>\n"
"</html>\n", rdir->psz_dst );
answer->i_body = p - answer->p_body; answer->i_body = p - answer->p_body;
/* XXX check if it's ok or we need to set an absolute url */ /* XXX check if it's ok or we need to set an absolute url */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment