Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
P
proxy-in-proxychains
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
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
nanahira
proxy-in-proxychains
Commits
84a36ddd
Commit
84a36ddd
authored
Nov 16, 2016
by
Krzysztof Kliś
Committed by
GitHub
Nov 16, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4 from ticpu/more_fixes
Correct possible hangs.
parents
f532b9ae
62da2709
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
proxy.c
proxy.c
+7
-4
No files found.
proxy.c
View file @
84a36ddd
...
...
@@ -190,7 +190,6 @@ void update_connection_count()
/* Handle finished child process */
void
sigchld_handler
(
int
signal
)
{
while
(
waitpid
(
-
1
,
NULL
,
WNOHANG
)
>
0
);
update_connection_count
();
}
/* Handle term signal */
...
...
@@ -266,9 +265,9 @@ void forward_data(int source_sock, int destination_sock) {
exit
(
EXIT_FAILURE
);
}
while
((
n
=
splice
(
source_sock
,
NULL
,
buf_pipe
[
WRITE
],
NULL
,
BUF_SIZE
,
SPLICE_F_MOVE
))
>
0
)
{
if
(
splice
(
buf_pipe
[
READ
],
NULL
,
destination_sock
,
NULL
,
n
,
SPLICE_F_MOVE
)
<
0
)
{
perror
(
"
splic
e"
);
while
((
n
=
splice
(
source_sock
,
NULL
,
buf_pipe
[
WRITE
],
NULL
,
SSIZE_MAX
,
SPLICE_F_NONBLOCK
|
SPLICE_F_MOVE
))
>
0
)
{
if
(
splice
(
buf_pipe
[
READ
],
NULL
,
destination_sock
,
NULL
,
SSIZE_MAX
,
SPLICE_F_MOVE
)
<
0
)
{
perror
(
"
writ
e"
);
exit
(
EXIT_FAILURE
);
}
}
...
...
@@ -280,6 +279,9 @@ void forward_data(int source_sock, int destination_sock) {
}
#endif
if
(
n
<
0
)
perror
(
"read"
);
#ifdef USE_SPLICE
close
(
buf_pipe
[
0
]);
close
(
buf_pipe
[
1
]);
...
...
@@ -357,3 +359,4 @@ int create_connection() {
return
sock
;
}
/* vim: set et ts=4 sw=4: */
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