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
d8cc7df9
Commit
d8cc7df9
authored
Jun 06, 2020
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
httpd: reorder, de-indent
(No functional changes)
parent
78c5634a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
31 deletions
+36
-31
src/network/httpd.c
src/network/httpd.c
+36
-31
No files found.
src/network/httpd.c
View file @
d8cc7df9
...
...
@@ -1604,44 +1604,49 @@ static void httpd_ClientSend(httpd_client_t *cl)
i_len
=
httpd_NetSend
(
cl
,
&
cl
->
p_buffer
[
cl
->
i_buffer
],
cl
->
i_buffer_size
-
cl
->
i_buffer
);
if
(
i_len
>=
0
)
{
cl
->
i_buffer
+=
i_len
;
if
(
cl
->
i_buffer
>=
cl
->
i_buffer_size
)
{
if
(
cl
->
answer
.
i_body
==
0
&&
cl
->
answer
.
i_body_offset
>
0
)
{
/* catch more body data */
int
i_msg
=
cl
->
query
.
i_type
;
int64_t
i_offset
=
cl
->
answer
.
i_body_offset
;
httpd_MsgClean
(
&
cl
->
answer
);
cl
->
answer
.
i_body_offset
=
i_offset
;
cl
->
url
->
catch
[
i_msg
].
cb
(
cl
->
url
->
catch
[
i_msg
].
p_sys
,
cl
,
&
cl
->
answer
,
&
cl
->
query
);
}
if
(
cl
->
answer
.
i_body
>
0
)
{
/* send the body data */
free
(
cl
->
p_buffer
);
cl
->
p_buffer
=
cl
->
answer
.
p_body
;
cl
->
i_buffer_size
=
cl
->
answer
.
i_body
;
cl
->
i_buffer
=
0
;
if
(
i_len
==
0
)
{
cl
->
i_state
=
HTTPD_CLIENT_DEAD
;
/* connection closed */
return
;
}
cl
->
answer
.
i_body
=
0
;
cl
->
answer
.
p_body
=
NULL
;
}
else
/* send finished */
cl
->
i_state
=
HTTPD_CLIENT_SEND_DONE
;
}
}
else
{
if
(
i_len
<
0
)
{
#if defined(_WIN32)
if
(
(
i_len
<
0
&&
WSAGetLastError
()
!=
WSAEWOULDBLOCK
)
||
(
i_len
==
0
))
if
(
WSAGetLastError
()
!=
WSAEWOULDBLOCK
)
#else
if
(
(
i_len
<
0
&&
errno
!=
EAGAIN
)
||
(
i_len
==
0
))
if
(
errno
!=
EAGAIN
)
#endif
{
/* error */
/* Connection failed, or hung up (EPIPE) */
cl
->
i_state
=
HTTPD_CLIENT_DEAD
;
return
;
}
cl
->
i_buffer
+=
i_len
;
if
(
cl
->
i_buffer
>=
cl
->
i_buffer_size
)
{
if
(
cl
->
answer
.
i_body
==
0
&&
cl
->
answer
.
i_body_offset
>
0
)
{
/* catch more body data */
int
i_msg
=
cl
->
query
.
i_type
;
int64_t
i_offset
=
cl
->
answer
.
i_body_offset
;
httpd_MsgClean
(
&
cl
->
answer
);
cl
->
answer
.
i_body_offset
=
i_offset
;
cl
->
url
->
catch
[
i_msg
].
cb
(
cl
->
url
->
catch
[
i_msg
].
p_sys
,
cl
,
&
cl
->
answer
,
&
cl
->
query
);
}
if
(
cl
->
answer
.
i_body
>
0
)
{
/* send the body data */
free
(
cl
->
p_buffer
);
cl
->
p_buffer
=
cl
->
answer
.
p_body
;
cl
->
i_buffer_size
=
cl
->
answer
.
i_body
;
cl
->
i_buffer
=
0
;
cl
->
answer
.
i_body
=
0
;
cl
->
answer
.
p_body
=
NULL
;
}
else
/* send finished */
cl
->
i_state
=
HTTPD_CLIENT_SEND_DONE
;
}
}
...
...
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