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
f5305fef
Commit
f5305fef
authored
Feb 21, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Do not store HTTPd clients addresses (unused anyway)
- Use net_Accept()
parent
558e0a6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
19 deletions
+7
-19
src/network/httpd.c
src/network/httpd.c
+7
-19
No files found.
src/network/httpd.c
View file @
f5305fef
...
...
@@ -164,8 +164,6 @@ struct httpd_client_t
int
i_ref
;
struct
sockaddr_storage
sock
;
int
i_sock_size
;
int
fd
;
int
i_mode
;
...
...
@@ -1508,9 +1506,7 @@ static void httpd_ClientClean( httpd_client_t *cl )
}
}
static
httpd_client_t
*
httpd_ClientNew
(
int
fd
,
struct
sockaddr_storage
*
sock
,
int
i_sock_size
,
tls_session_t
*
p_tls
,
mtime_t
now
)
static
httpd_client_t
*
httpd_ClientNew
(
int
fd
,
tls_session_t
*
p_tls
,
mtime_t
now
)
{
httpd_client_t
*
cl
=
malloc
(
sizeof
(
httpd_client_t
)
);
...
...
@@ -1518,8 +1514,6 @@ static httpd_client_t *httpd_ClientNew( int fd, struct sockaddr_storage *sock,
cl
->
i_ref
=
0
;
cl
->
fd
=
fd
;
memcpy
(
&
cl
->
sock
,
sock
,
sizeof
(
cl
->
sock
)
);
cl
->
i_sock_size
=
i_sock_size
;
cl
->
url
=
NULL
;
cl
->
p_tls
=
p_tls
;
...
...
@@ -2443,15 +2437,10 @@ static void httpd_HostThread( httpd_host_t *host )
if
(
ufd
[
nfd
].
revents
==
0
)
continue
;
struct
sockaddr_storage
addr
;
socklen_t
addrlen
=
sizeof
(
addr
);
int
fd
=
accept
(
ufd
[
nfd
].
fd
,
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
);
int
fd
=
net_Accept
(
host
,
host
->
fds
,
0
);
if
(
fd
==
-
1
)
continue
;
net_SetupSocket
(
fd
);
int
i_state
=
0
;
if
(
p_tls
!=
NULL
)
...
...
@@ -2474,23 +2463,22 @@ static void httpd_HostThread( httpd_host_t *host )
break
;
}
if
(
p_tls
==
NULL
)
if
(
(
p_tls
==
NULL
)
!=
(
host
->
p_tls
==
NULL
)
)
break
;
// wasted TLS session, cannot accept() anymore
}
httpd_client_t
*
cl
;
char
ip
[
NI_MAXNUMERICHOST
];
stats_UpdateInteger
(
host
,
host
->
p_total_counter
,
1
,
NULL
);
stats_UpdateInteger
(
host
,
host
->
p_active_counter
,
1
,
NULL
);
cl
=
httpd_ClientNew
(
fd
,
&
addr
,
addrlen
,
p_tls
,
now
);
httpd_ClientIP
(
cl
,
ip
);
msg_Dbg
(
host
,
"Connection from %s"
,
ip
);
cl
=
httpd_ClientNew
(
fd
,
p_tls
,
now
);
p_tls
=
NULL
;
vlc_mutex_lock
(
&
host
->
lock
);
TAB_APPEND
(
host
->
i_client
,
host
->
client
,
cl
);
vlc_mutex_unlock
(
&
host
->
lock
);
cl
->
i_state
=
i_state
;
// override state for TLS
break
;
// cannot accept more than one because of TLS
if
(
host
->
p_tls
!=
NULL
)
break
;
// cannot accept further without new TLS session
}
/* now try all others socket */
...
...
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