* http.c : http remote control plugin for vlc
*****************************************************************************
* 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>
*
p_page_intf = p_intf->p_sys->p_httpd->pf_register_file(
p_intf->p_sys->p_httpd, "/", "text/html",
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 )
{
}
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 );
if( i_len > 0 )
* httpd.c
*****************************************************************************
* 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>
*
#if defined( WIN32 ) || defined( UNDER_CE )
- if( ( i_len < 0 && WSAGetLastError() == !WSAEWOULDBLOCK ) ||
+ if( ( i_len < 0 && WSAGetLastError() != WSAEWOULDBLOCK ) ||
#else
if( ( i_len < 0 && errno != EAGAIN && errno != EINTR ) ||
#endif
}
// 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 ) )
{
httpd_connection_t *p_next = p_con->p_next;
}
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;