Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
31683caf
Commit
31683caf
authored
Mar 02, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code reuse
parent
4097f9fa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
38 deletions
+9
-38
include/vlc_httpd.h
include/vlc_httpd.h
+2
-2
include/vlc_symbols.h
include/vlc_symbols.h
+2
-2
src/network/httpd.c
src/network/httpd.c
+5
-34
No files found.
include/vlc_httpd.h
View file @
31683caf
...
...
@@ -120,8 +120,8 @@ 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
,
char
*
psz_ip
)
);
VLC_EXPORT
(
char
*
,
httpd_ServerIP
,
(
httpd_client_t
*
cl
,
char
*
psz_ip
)
);
VLC_EXPORT
(
char
*
,
httpd_ClientIP
,
(
const
httpd_client_t
*
cl
,
char
*
psz_ip
)
);
VLC_EXPORT
(
char
*
,
httpd_ServerIP
,
(
const
httpd_client_t
*
cl
,
char
*
psz_ip
)
);
/* High level */
...
...
include/vlc_symbols.h
View file @
31683caf
...
...
@@ -204,7 +204,7 @@ struct module_symbols_t
void
(
*
httpd_UrlDelete_inner
)
(
httpd_url_t
*
);
void
(
*
httpd_ClientModeStream_inner
)
(
httpd_client_t
*
cl
);
void
(
*
httpd_ClientModeBidir_inner
)
(
httpd_client_t
*
cl
);
char
*
(
*
httpd_ClientIP_inner
)
(
httpd_client_t
*
cl
,
char
*
psz_ip
);
char
*
(
*
httpd_ClientIP_inner
)
(
const
httpd_client_t
*
cl
,
char
*
psz_ip
);
httpd_file_t
*
(
*
httpd_FileNew_inner
)
(
httpd_host_t
*
,
const
char
*
psz_url
,
const
char
*
psz_mime
,
const
char
*
psz_user
,
const
char
*
psz_password
,
const
vlc_acl_t
*
p_acl
,
httpd_file_callback_t
pf_fill
,
httpd_file_sys_t
*
);
void
(
*
httpd_FileDelete_inner
)
(
httpd_file_t
*
);
httpd_redirect_t
*
(
*
httpd_RedirectNew_inner
)
(
httpd_host_t
*
,
const
char
*
psz_url_dst
,
const
char
*
psz_url_src
);
...
...
@@ -385,7 +385,7 @@ struct module_symbols_t
int
(
*
ACL_LoadFile_inner
)
(
vlc_acl_t
*
p_acl
,
const
char
*
path
);
int
(
*
ACL_AddNet_inner
)
(
vlc_acl_t
*
p_acl
,
const
char
*
psz_ip
,
int
i_len
,
vlc_bool_t
b_allow
);
void
(
*
ACL_Destroy_inner
)
(
vlc_acl_t
*
p_acl
);
char
*
(
*
httpd_ServerIP_inner
)
(
httpd_client_t
*
cl
,
char
*
psz_ip
);
char
*
(
*
httpd_ServerIP_inner
)
(
const
httpd_client_t
*
cl
,
char
*
psz_ip
);
char
*
(
*
FromLocale_inner
)
(
const
char
*
);
void
(
*
LocaleFree_inner
)
(
const
char
*
);
char
*
(
*
ToLocale_inner
)
(
const
char
*
);
...
...
src/network/httpd.c
View file @
31683caf
...
...
@@ -47,15 +47,8 @@
# include <winsock.h>
#elif defined( WIN32 )
# include <winsock2.h>
# include <ws2tcpip.h>
#else
# include <netdb.h>
/* hostent ... */
# include <sys/socket.h>
/* FIXME: should not be needed */
# include <netinet/in.h>
# ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
/* inet_ntoa(), inet_aton() */
# endif
#endif
#if defined( WIN32 )
...
...
@@ -440,7 +433,7 @@ static int httpd_HandlerCallBack( httpd_callback_sys_t *p_sys, httpd_client_t *c
{
httpd_handler_t
*
handler
=
(
httpd_handler_t
*
)
p_sys
;
uint8_t
*
psz_args
=
query
->
psz_args
;
char
psz_remote_addr
[
100
];
char
psz_remote_addr
[
NI_MAXNUMERICHOST
];
if
(
answer
==
NULL
||
query
==
NULL
)
{
...
...
@@ -453,30 +446,8 @@ static int httpd_HandlerCallBack( httpd_callback_sys_t *p_sys, httpd_client_t *c
answer
->
i_status
=
0
;
answer
->
psz_status
=
NULL
;
switch
(
cl
->
sock
.
ss_family
)
{
#ifdef HAVE_INET_PTON
case
AF_INET
:
inet_ntop
(
cl
->
sock
.
ss_family
,
&
((
struct
sockaddr_in
*
)
&
cl
->
sock
)
->
sin_addr
,
psz_remote_addr
,
sizeof
(
psz_remote_addr
)
);
break
;
case
AF_INET6
:
inet_ntop
(
cl
->
sock
.
ss_family
,
&
((
struct
sockaddr_in6
*
)
&
cl
->
sock
)
->
sin6_addr
,
psz_remote_addr
,
sizeof
(
psz_remote_addr
)
);
break
;
#else
case
AF_INET
:
{
char
*
psz_tmp
=
inet_ntoa
(
((
struct
sockaddr_in
*
)
&
cl
->
sock
)
->
sin_addr
);
strncpy
(
psz_remote_addr
,
psz_tmp
,
sizeof
(
psz_remote_addr
)
);
break
;
}
#endif
default:
psz_remote_addr
[
0
]
=
'\0'
;
}
if
(
httpd_ClientIP
(
cl
,
psz_remote_addr
)
==
NULL
)
*
psz_remote_addr
=
'\0'
;
handler
->
pf_fill
(
handler
->
p_sys
,
handler
,
query
->
psz_url
,
psz_args
,
query
->
i_type
,
query
->
p_body
,
query
->
i_body
,
...
...
@@ -1371,12 +1342,12 @@ void httpd_ClientModeBidir( httpd_client_t *cl )
cl
->
i_mode
=
HTTPD_CLIENT_BIDIR
;
}
char
*
httpd_ClientIP
(
httpd_client_t
*
cl
,
char
*
psz_ip
)
char
*
httpd_ClientIP
(
const
httpd_client_t
*
cl
,
char
*
psz_ip
)
{
return
net_GetPeerAddress
(
cl
->
fd
,
psz_ip
,
NULL
)
?
NULL
:
psz_ip
;
}
char
*
httpd_ServerIP
(
httpd_client_t
*
cl
,
char
*
psz_ip
)
char
*
httpd_ServerIP
(
const
httpd_client_t
*
cl
,
char
*
psz_ip
)
{
return
net_GetSockAddress
(
cl
->
fd
,
psz_ip
,
NULL
)
?
NULL
:
psz_ip
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment