Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tammo Jan Dijkema
dt_ctrl
Commits
faefbd74
Commit
faefbd74
authored
Nov 21, 2013
by
Jeroen Vreeken
Browse files
Send log status to new clients.
parent
8cac0363
Changes
1
Show whitespace changes
Inline
Side-by-side
console/console/log_proxy.c
View file @
faefbd74
...
...
@@ -169,11 +169,23 @@ int main (int argc, char **argv)
fdnew
=
tcp_accept
(
fd_listen
);
if
(
fdnew
>=
0
)
{
char
status
[
1000
];
int
statlen
;
nr_clients
++
;
fd_clients
=
realloc
(
fd_clients
,
sizeof
(
int
)
*
nr_clients
);
fd_clients
[
nr_clients
-
1
]
=
fdnew
;
ioctl
(
fdnew
,
FIONBIO
,
&
(
int
){
1
});
printf
(
"New client. (now at %d)
\n
"
,
nr_clients
);
if
(
fd_log
>=
0
)
{
statlen
=
sprintf
(
status
,
"New connection to proxy, controller conection is established.
\n
"
);
}
else
{
statlen
=
sprintf
(
status
,
"New connection to proxy, no connection to controller.
\n
"
);
}
write
(
fdnew
,
status
,
statlen
);
}
if
(
rb
>
0
)
{
...
...
Write
Preview
Supports
Markdown
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