Commit 4d4cc838 authored by Gildas Bazin's avatar Gildas Bazin

* modules/misc/httpd.c: win32 fixes.
* modules/control/http.c: fixed a problem with IE that sends POST requests instead of GET ones.
parent c633f942
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* http.c : http remote control plugin for vlc * http.c : http remote control plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: http.c,v 1.4 2003/05/06 14:19:29 fenrir Exp $ * $Id: http.c,v 1.5 2003/05/09 16:01:17 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -180,7 +180,8 @@ static void Run( intf_thread_t *p_intf ) ...@@ -180,7 +180,8 @@ static void Run( intf_thread_t *p_intf )
p_page_intf = p_intf->p_sys->p_httpd->pf_register_file( p_page_intf = p_intf->p_sys->p_httpd->pf_register_file(
p_intf->p_sys->p_httpd, "/", "text/html", p_intf->p_sys->p_httpd, "/", "text/html",
NULL, NULL, httpd_page_interface_get, NULL, NULL, httpd_page_interface_get,
NULL, (httpd_file_callback_args_t*)p_intf ); httpd_page_interface_get,
(httpd_file_callback_args_t*)p_intf );
while( !p_intf->b_die ) while( !p_intf->b_die )
{ {
...@@ -279,7 +280,16 @@ static void uri_extract_value( char *psz_uri, char *psz_name, ...@@ -279,7 +280,16 @@ static void uri_extract_value( char *psz_uri, char *psz_name,
} }
else else
{ {
i_len = strlen( p ); /* for POST method */
if( strchr( p, '\n' ) )
{
i_len = strchr( p, '\n' ) - p;
if( i_len && *(p+i_len-1) == '\r' ) i_len--;
}
else
{
i_len = strlen( p );
}
} }
i_len = __MIN( i_value_max - 1, i_len ); i_len = __MIN( i_value_max - 1, i_len );
if( i_len > 0 ) if( i_len > 0 )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* httpd.c * httpd.c
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2003 VideoLAN * Copyright (C) 2001-2003 VideoLAN
* $Id: httpd.c,v 1.13 2003/04/27 14:11:26 gbazin Exp $ * $Id: httpd.c,v 1.14 2003/05/09 16:01:17 gbazin Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -1803,7 +1803,7 @@ static void httpd_Thread( httpd_sys_t *p_httpt ) ...@@ -1803,7 +1803,7 @@ static void httpd_Thread( httpd_sys_t *p_httpt )
#if defined( WIN32 ) || defined( UNDER_CE ) #if defined( WIN32 ) || defined( UNDER_CE )
if( ( i_len < 0 && WSAGetLastError() == !WSAEWOULDBLOCK ) || if( ( i_len < 0 && WSAGetLastError() != WSAEWOULDBLOCK ) ||
#else #else
if( ( i_len < 0 && errno != EAGAIN && errno != EINTR ) || if( ( i_len < 0 && errno != EAGAIN && errno != EINTR ) ||
#endif #endif
...@@ -1853,7 +1853,11 @@ static void httpd_Thread( httpd_sys_t *p_httpt ) ...@@ -1853,7 +1853,11 @@ static void httpd_Thread( httpd_sys_t *p_httpt )
} }
// msg_Warn( p_httpt, "on %d send %d bytes %s", p_con->i_buffer_size, i_len, p_con->p_buffer + p_con->i_buffer ); // msg_Warn( p_httpt, "on %d send %d bytes %s", p_con->i_buffer_size, i_len, p_con->p_buffer + p_con->i_buffer );
if( ( i_len < 0 && errno != EAGAIN && errno != EINTR )|| #if defined( WIN32 ) || defined( UNDER_CE )
if( ( i_len < 0 && WSAGetLastError() != WSAEWOULDBLOCK ) ||
#else
if( ( i_len < 0 && errno != EAGAIN && errno != EINTR ) ||
#endif
( i_len == 0 ) ) ( i_len == 0 ) )
{ {
httpd_connection_t *p_next = p_con->p_next; httpd_connection_t *p_next = p_con->p_next;
...@@ -1952,7 +1956,12 @@ static void httpd_Thread( httpd_sys_t *p_httpt ) ...@@ -1952,7 +1956,12 @@ static void httpd_Thread( httpd_sys_t *p_httpt )
} }
i_send = send( p_con->fd, &p_stream->p_buffer[i_pos], i_write, 0 ); i_send = send( p_con->fd, &p_stream->p_buffer[i_pos], i_write, 0 );
if( ( i_send < 0 && errno != EAGAIN && errno != EINTR )|| ( i_send == 0 ) ) #if defined( WIN32 ) || defined( UNDER_CE )
if( ( i_send < 0 && WSAGetLastError() != WSAEWOULDBLOCK )||
#else
if( ( i_send < 0 && errno != EAGAIN && errno != EINTR )||
#endif
( i_send == 0 ) )
{ {
httpd_connection_t *p_next = p_con->p_next; httpd_connection_t *p_next = p_con->p_next;
......
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