Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
M
mw
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
18
Issues
18
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
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
milliways
mw
Commits
45233543
Commit
45233543
authored
Jan 09, 2020
by
Andrew Price
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consider the wholist a requirement of a successful login
parent
ca54bacf
Pipeline
#681
passed with stage
in 9 minutes and 16 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
3 deletions
+23
-3
src/client/main.c
src/client/main.c
+6
-3
src/client/who.c
src/client/who.c
+16
-0
src/client/who.h
src/client/who.h
+1
-0
No files found.
src/client/main.c
View file @
45233543
...
...
@@ -669,9 +669,12 @@ int main(int argc, char **argv)
if
(
!
autochat
)
printf
(
_
(
"Type 'help' for help.
\n
"
));
user
->
loggedin
=
time
(
0
);
/* give the incoming pipe a chance to process before
* we run the autoexec functions, so wholist etc can arrive */
idle
(
-
1
,
1
);
/* Server sends user list on login. */
/* Consider it a failure if we don't receive it within a generous interval. */
if
(
require_whoinfo
())
{
fprintf
(
stderr
,
"Timed out waiting for server to send user list
\n
"
);
exit
(
1
);
}
setup_js
();
...
...
src/client/who.c
View file @
45233543
...
...
@@ -64,6 +64,22 @@ static int refresh_wholist(int type)
return
0
;
}
/* If we don't get the who list within the timeout, fail */
#define WHOINFO_TIMEOUT 10000
#define WHOINFO_CHECK_INTERVAL (WHOINFO_TIMEOUT / 250)
int
require_whoinfo
(
void
)
{
int
n
=
0
;
while
(
whoinfo
==
NULL
&&
n
<
WHOINFO_TIMEOUT
)
{
idle
(
-
1
,
WHOINFO_CHECK_INTERVAL
);
n
+=
WHOINFO_CHECK_INTERVAL
;
}
if
(
whoinfo
==
NULL
)
return
1
;
return
0
;
}
void
display_wholist
(
int
mode
)
{
time_t
now
=
time
(
NULL
);
...
...
src/client/who.h
View file @
45233543
...
...
@@ -8,6 +8,7 @@ void check_copies(int32_t where);
char
*
itime
(
unsigned
long
t
);
void
display_wholist
(
int
type
);
void
update_wholist
(
ipc_message_t
*
msg
);
int
require_whoinfo
(
void
);
char
*
part_who_talk
(
const
char
*
text
,
int
status
);
char
*
part_who
(
const
char
*
text
,
int
status
);
json_t
*
grab_wholist
(
void
);
...
...
Andrew Price
@welshbyte
mentioned in commit
fc2dd103
·
Jan 18, 2020
mentioned in commit
fc2dd103
mentioned in commit fc2dd1033a7aed8cdab8f46ef6baca8189d35a5b
Toggle commit list
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