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
52b0f7ea
Commit
52b0f7ea
authored
Feb 21, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Another mdate() caching optimization
parent
51d5c44d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
src/network/httpd.c
src/network/httpd.c
+9
-7
No files found.
src/network/httpd.c
View file @
52b0f7ea
...
@@ -1453,10 +1453,10 @@ void httpd_MsgAdd( httpd_message_t *msg, const char *name, const char *psz_value
...
@@ -1453,10 +1453,10 @@ void httpd_MsgAdd( httpd_message_t *msg, const char *name, const char *psz_value
TAB_APPEND
(
msg
->
i_value
,
msg
->
value
,
value
);
TAB_APPEND
(
msg
->
i_value
,
msg
->
value
,
value
);
}
}
static
void
httpd_ClientInit
(
httpd_client_t
*
cl
)
static
void
httpd_ClientInit
(
httpd_client_t
*
cl
,
mtime_t
now
)
{
{
cl
->
i_state
=
HTTPD_CLIENT_RECEIVING
;
cl
->
i_state
=
HTTPD_CLIENT_RECEIVING
;
cl
->
i_activity_date
=
mdate
()
;
cl
->
i_activity_date
=
now
;
cl
->
i_activity_timeout
=
I64C
(
10000000
);
cl
->
i_activity_timeout
=
I64C
(
10000000
);
cl
->
i_buffer_size
=
HTTPD_CL_BUFSIZE
;
cl
->
i_buffer_size
=
HTTPD_CL_BUFSIZE
;
cl
->
i_buffer
=
0
;
cl
->
i_buffer
=
0
;
...
@@ -1510,7 +1510,7 @@ static void httpd_ClientClean( httpd_client_t *cl )
...
@@ -1510,7 +1510,7 @@ static void httpd_ClientClean( httpd_client_t *cl )
static
httpd_client_t
*
httpd_ClientNew
(
int
fd
,
struct
sockaddr_storage
*
sock
,
static
httpd_client_t
*
httpd_ClientNew
(
int
fd
,
struct
sockaddr_storage
*
sock
,
int
i_sock_size
,
int
i_sock_size
,
tls_session_t
*
p_tls
)
tls_session_t
*
p_tls
,
mtime_t
now
)
{
{
httpd_client_t
*
cl
=
malloc
(
sizeof
(
httpd_client_t
)
);
httpd_client_t
*
cl
=
malloc
(
sizeof
(
httpd_client_t
)
);
...
@@ -1523,7 +1523,7 @@ static httpd_client_t *httpd_ClientNew( int fd, struct sockaddr_storage *sock,
...
@@ -1523,7 +1523,7 @@ static httpd_client_t *httpd_ClientNew( int fd, struct sockaddr_storage *sock,
cl
->
url
=
NULL
;
cl
->
url
=
NULL
;
cl
->
p_tls
=
p_tls
;
cl
->
p_tls
=
p_tls
;
httpd_ClientInit
(
cl
);
httpd_ClientInit
(
cl
,
now
);
return
cl
;
return
cl
;
}
}
...
@@ -1850,7 +1850,6 @@ static void httpd_ClientRecv( httpd_client_t *cl )
...
@@ -1850,7 +1850,6 @@ static void httpd_ClientRecv( httpd_client_t *cl )
cl
->
i_state
=
HTTPD_CLIENT_DEAD
;
cl
->
i_state
=
HTTPD_CLIENT_DEAD
;
}
}
}
}
cl
->
i_activity_date
=
mdate
();
/* XXX: for QT I have to disable timeout. Try to find why */
/* XXX: for QT I have to disable timeout. Try to find why */
if
(
cl
->
query
.
i_proto
==
HTTPD_PROTO_RTSP
)
if
(
cl
->
query
.
i_proto
==
HTTPD_PROTO_RTSP
)
...
@@ -1933,7 +1932,6 @@ static void httpd_ClientSend( httpd_client_t *cl )
...
@@ -1933,7 +1932,6 @@ static void httpd_ClientSend( httpd_client_t *cl )
cl
->
i_buffer_size
-
cl
->
i_buffer
);
cl
->
i_buffer_size
-
cl
->
i_buffer
);
if
(
i_len
>=
0
)
if
(
i_len
>=
0
)
{
{
cl
->
i_activity_date
=
mdate
();
cl
->
i_buffer
+=
i_len
;
cl
->
i_buffer
+=
i_len
;
if
(
cl
->
i_buffer
>=
cl
->
i_buffer_size
)
if
(
cl
->
i_buffer
>=
cl
->
i_buffer_size
)
...
@@ -2435,6 +2433,8 @@ static void httpd_HostThread( httpd_host_t *host )
...
@@ -2435,6 +2433,8 @@ static void httpd_HostThread( httpd_host_t *host )
continue
;
continue
;
}
}
now
=
mdate
();
/* accept new connections */
/* accept new connections */
for
(
nfd
=
0
;
nfd
<
host
->
nfd
;
nfd
++
)
for
(
nfd
=
0
;
nfd
<
host
->
nfd
;
nfd
++
)
{
{
...
@@ -2482,7 +2482,7 @@ static void httpd_HostThread( httpd_host_t *host )
...
@@ -2482,7 +2482,7 @@ static void httpd_HostThread( httpd_host_t *host )
char
ip
[
NI_MAXNUMERICHOST
];
char
ip
[
NI_MAXNUMERICHOST
];
stats_UpdateInteger
(
host
,
host
->
p_total_counter
,
1
,
NULL
);
stats_UpdateInteger
(
host
,
host
->
p_total_counter
,
1
,
NULL
);
stats_UpdateInteger
(
host
,
host
->
p_active_counter
,
1
,
NULL
);
stats_UpdateInteger
(
host
,
host
->
p_active_counter
,
1
,
NULL
);
cl
=
httpd_ClientNew
(
fd
,
&
addr
,
addrlen
,
p_tls
);
cl
=
httpd_ClientNew
(
fd
,
&
addr
,
addrlen
,
p_tls
,
now
);
httpd_ClientIP
(
cl
,
ip
);
httpd_ClientIP
(
cl
,
ip
);
msg_Dbg
(
host
,
"Connection from %s"
,
ip
);
msg_Dbg
(
host
,
"Connection from %s"
,
ip
);
p_tls
=
NULL
;
p_tls
=
NULL
;
...
@@ -2510,6 +2510,8 @@ static void httpd_HostThread( httpd_host_t *host )
...
@@ -2510,6 +2510,8 @@ static void httpd_HostThread( httpd_host_t *host )
if
(
pufd
->
revents
==
0
)
if
(
pufd
->
revents
==
0
)
continue
;
// no event received
continue
;
// no event received
cl
->
i_activity_date
=
now
;
if
(
cl
->
i_state
==
HTTPD_CLIENT_RECEIVING
)
if
(
cl
->
i_state
==
HTTPD_CLIENT_RECEIVING
)
{
{
httpd_ClientRecv
(
cl
);
httpd_ClientRecv
(
cl
);
...
...
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