From 7db4c54cc557b25da5b24e4d625f2842e9fa69ad Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Mon, 22 Mar 2004 12:33:29 +0000 Subject: [PATCH] * all: forgot to commit theses files. --- include/vlc_httpd.h | 3 ++- src/misc/httpd.c | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/vlc_httpd.h b/include/vlc_httpd.h index cd95b7f6fb..9738d9217d 100644 --- a/include/vlc_httpd.h +++ b/include/vlc_httpd.h @@ -2,7 +2,7 @@ * vlc_httpd.h: builtin HTTP/RTSP server. ***************************************************************************** * Copyright (C) 2004 VideoLAN - * $Id: vlc_httpd.h,v 1.1 2004/03/03 13:23:47 fenrir Exp $ + * $Id$ * * Authors: Laurent Aimar * @@ -127,6 +127,7 @@ VLC_EXPORT( void, httpd_UrlDelete, ( httpd_url_t * ) ); /* Default client mode is FILE, use these to change it */ VLC_EXPORT( void, httpd_ClientModeStream, ( httpd_client_t *cl ) ); VLC_EXPORT( void, httpd_ClientModeBidir, ( httpd_client_t *cl ) ); +VLC_EXPORT( char*, httpd_ClientIP, ( httpd_client_t *cl ) ); /* High level */ diff --git a/src/misc/httpd.c b/src/misc/httpd.c index 3c81ce5c31..fb8883c5d9 100644 --- a/src/misc/httpd.c +++ b/src/misc/httpd.c @@ -1267,7 +1267,7 @@ static void httpd_ClientInit( httpd_client_t *cl ) { cl->i_state = HTTPD_CLIENT_RECEIVING; cl->i_activity_date = mdate(); - cl->i_activity_timeout = 10000000LL; + cl->i_activity_timeout = 50000000LL; cl->i_buffer_size = 10000; cl->i_buffer = 0; cl->p_buffer = malloc( cl->i_buffer_size ); @@ -1288,6 +1288,12 @@ void httpd_ClientModeBidir( httpd_client_t *cl ) cl->i_mode = HTTPD_CLIENT_BIDIR; } +char* httpd_ClientIP( httpd_client_t *cl ) +{ + /* FIXME not thread safe */ + return strdup( inet_ntoa( cl->sock.sin_addr ) ); +} + static void httpd_ClientClean( httpd_client_t *cl ) { if( cl->fd > 0 ) -- 2.39.2