Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fanout
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gerhard Gonter
fanout
Commits
9833d9d3
Commit
9833d9d3
authored
May 18, 2012
by
Travis Glenn Hansen
Browse files
Options
Downloads
Patches
Plain Diff
memory leaks
parent
1d437035
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
fanout.c
+9
-1
9 additions, 1 deletion
fanout.c
with
9 additions
and
1 deletion
fanout.c
+
9
−
1
View file @
9833d9d3
...
...
@@ -118,6 +118,7 @@ struct client *client_head = NULL;
struct
subscription
*
subscription_head
=
NULL
;
struct
channel
*
channel_head
=
NULL
;
struct
rlimit
s_rlimit
;
int
main
(
int
argc
,
char
*
argv
[])
...
...
@@ -135,7 +136,6 @@ int main (int argc, char *argv[])
socklen_t
clilen
;
struct
sockaddr_in
serv_addr
,
cli_addr
;
struct
rlimit
s_rlimit
;
static
struct
option
long_options
[]
=
{
{
"port"
,
1
,
0
,
0
},
...
...
@@ -311,6 +311,7 @@ fs.file-max=100000\n");
fanout_debug
(
1
,
"rlimit set at: Soft=%d Hard=%d
\n
"
,
s_rlimit
.
rlim_cur
,
s_rlimit
.
rlim_max
);
fanout_debug
(
2
,
"max client connections: %d
\n
"
,
client_limit
);
fanout_debug
(
2
,
"FD_SETSIZE: %d
\n
"
,
FD_SETSIZE
);
while
(
1
)
{
fanout_debug
(
3
,
"server waiting for new activity
\n
"
);
...
...
@@ -341,6 +342,7 @@ fs.file-max=100000\n");
if
((
client_i
->
fd
=
accept
(
srvsock
,
(
struct
sockaddr
*
)
&
cli_addr
,
&
clilen
))
==
-
1
)
{
fanout_debug
(
0
,
"%s
\n
"
,
strerror
(
errno
));
free
(
client_i
);
fanout_error
(
"failed on accept ()"
);
continue
;
}
...
...
@@ -350,6 +352,7 @@ fs.file-max=100000\n");
send
(
client_i
->
fd
,
"too many connections
\n
"
,
strlen
(
"too many connections
\n
"
),
0
);
close
(
client_i
->
fd
);
free
(
client_i
);
continue
;
}
...
...
@@ -715,6 +718,8 @@ resetting counter\n");
asprintf
(
&
message
,
"uptime: %ldd %ldh %ldm %lds
\n
\
client-limit: %d
\n
\
rlimits: Soft=%d Hard=%d
\n
\
max connections: %d
\n
\
current connections: %d
\n
\
current channels: %d
\n
\
...
...
@@ -728,6 +733,9 @@ total unsubscribes: %llu\n\
total pings: %llu\
\n
"
,
uptime
/
3600
/
24
,
uptime
/
3600
%
24
,
uptime
/
60
%
60
,
uptime
%
60
,
client_limit
,
(
int
)
s_rlimit
.
rlim_cur
,
(
int
)
s_rlimit
.
rlim_max
,
max_connection_count
,
current_client_count
,
current_channel_count
,
current_subscription_count
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment