Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Steve Lhomme
VLC
Commits
e484fdda
Commit
e484fdda
authored
Jun 06, 2020
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
httpd: return progress status from I/O functions
So the caller knows if the client needs to be polled or not.
parent
8af01b05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
13 deletions
+20
-13
src/network/httpd.c
src/network/httpd.c
+20
-13
No files found.
src/network/httpd.c
View file @
e484fdda
...
...
@@ -1282,7 +1282,7 @@ msg_type[] =
};
static
void
httpd_ClientRecv
(
httpd_client_t
*
cl
)
static
int
httpd_ClientRecv
(
httpd_client_t
*
cl
)
{
int
i_len
;
...
...
@@ -1549,26 +1549,30 @@ static void httpd_ClientRecv(httpd_client_t *cl)
}
else
cl
->
i_state
=
HTTPD_CLIENT_DEAD
;
/* connection failed */
return
;
return
0
;
}
/* check if the client is to be set to dead */
if
(
i_len
<
0
)
{
#if defined(_WIN32)
if
(
WSAGetLastError
()
!
=
WSAEWOULDBLOCK
)
if
(
WSAGetLastError
()
=
=
WSAEWOULDBLOCK
)
#else
if
(
errno
!
=
EAGAIN
)
if
(
errno
=
=
EAGAIN
)
#endif
cl
->
i_state
=
HTTPD_CLIENT_DEAD
;
/* connection failed */
return
;
return
-
1
;
cl
->
i_state
=
HTTPD_CLIENT_DEAD
;
/* connection failed */
return
0
;
}
/* XXX: for QT I have to disable timeout. Try to find why */
if
(
cl
->
query
.
i_proto
==
HTTPD_PROTO_RTSP
)
cl
->
i_activity_timeout
=
0
;
return
0
;
}
static
void
httpd_ClientSend
(
httpd_client_t
*
cl
)
static
int
httpd_ClientSend
(
httpd_client_t
*
cl
)
{
int
i_len
;
...
...
@@ -1608,18 +1612,20 @@ static void httpd_ClientSend(httpd_client_t *cl)
if
(
i_len
==
0
)
{
cl
->
i_state
=
HTTPD_CLIENT_DEAD
;
/* connection closed */
return
;
return
0
;
}
if
(
i_len
<
0
)
{
#if defined(_WIN32)
if
(
WSAGetLastError
()
!
=
WSAEWOULDBLOCK
)
if
(
WSAGetLastError
()
=
=
WSAEWOULDBLOCK
)
#else
if
(
errno
!
=
EAGAIN
)
if
(
errno
=
=
EAGAIN
)
#endif
/* Connection failed, or hung up (EPIPE) */
cl
->
i_state
=
HTTPD_CLIENT_DEAD
;
return
;
return
-
1
;
/* Connection failed, or hung up (EPIPE) */
cl
->
i_state
=
HTTPD_CLIENT_DEAD
;
return
0
;
}
cl
->
i_buffer
+=
i_len
;
...
...
@@ -1649,6 +1655,7 @@ static void httpd_ClientSend(httpd_client_t *cl)
}
else
/* send finished */
cl
->
i_state
=
HTTPD_CLIENT_SEND_DONE
;
}
return
0
;
}
static
void
httpd_ClientTlsHandshake
(
httpd_host_t
*
host
,
httpd_client_t
*
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