Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
3a4cd2ad
Commit
3a4cd2ad
authored
11 years ago
by
Steve Holme
Browse files
Options
Downloads
Patches
Plain Diff
smtp-multi.c: Minor coding style tidyup following POP3 and IMAP additions
parent
82c47222
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/examples/smtp-multi.c
+12
-13
12 additions, 13 deletions
docs/examples/smtp-multi.c
with
12 additions
and
13 deletions
docs/examples/smtp-multi.c
+
12
−
13
View file @
3a4cd2ad
...
...
@@ -78,19 +78,19 @@ static size_t payload_source(void *ptr, size_t size, size_t nmemb, void *userp)
static
struct
timeval
tvnow
(
void
)
{
/*
** time() returns the value of time in seconds since the Epoch.
*/
struct
timeval
now
;
/* time() returns the value of time in seconds since the epoch */
now
.
tv_sec
=
(
long
)
time
(
NULL
);
now
.
tv_usec
=
0
;
return
now
;
}
static
long
tvdiff
(
struct
timeval
newer
,
struct
timeval
older
)
{
return
(
newer
.
tv_sec
-
older
.
tv_sec
)
*
1000
+
(
newer
.
tv_usec
-
older
.
tv_usec
)
/
1000
;
return
(
newer
.
tv_sec
-
older
.
tv_sec
)
*
1000
+
(
newer
.
tv_usec
-
older
.
tv_usec
)
/
1000
;
}
int
main
(
void
)
...
...
@@ -150,15 +150,15 @@ int main(void)
while
(
still_running
)
{
struct
timeval
timeout
;
int
rc
;
/* select() return code */
fd_set
fdread
;
fd_set
fdwrite
;
fd_set
fdexcep
;
int
maxfd
=
-
1
;
int
rc
;
long
curl_timeo
=
-
1
;
/* Initialise the file descriptors */
FD_ZERO
(
&
fdread
);
FD_ZERO
(
&
fdwrite
);
FD_ZERO
(
&
fdexcep
);
...
...
@@ -187,17 +187,16 @@ int main(void)
rc
=
select
(
maxfd
+
1
,
&
fdread
,
&
fdwrite
,
&
fdexcep
,
&
timeout
);
if
(
tvdiff
(
tvnow
(),
mp_start
)
>
MULTI_PERFORM_HANG_TIMEOUT
)
{
fprintf
(
stderr
,
"ABORTING TEST, since it seems "
"that
it
would have run forever.
\n
"
);
fprintf
(
stderr
,
"
ABORTING: Since it seems
that
we
would have run forever.
\n
"
);
break
;
}
switch
(
rc
)
{
case
-
1
:
/* select error */
case
-
1
:
/* select error */
break
;
case
0
:
/* timeout */
default:
/* action */
case
0
:
/* timeout */
default:
/* action */
curl_multi_perform
(
mcurl
,
&
still_running
);
break
;
}
...
...
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