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
9d5c6df7
Commit
9d5c6df7
authored
24 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
added localtime_r()
parent
c1ab16da
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGES
+269
-269
269 additions, 269 deletions
CHANGES
configure.in
+2
-1
2 additions, 1 deletion
configure.in
lib/getdate.y
+12
-2
12 additions, 2 deletions
lib/getdate.y
lib/http.c
+12
-0
12 additions, 0 deletions
lib/http.c
with
295 additions
and
272 deletions
CHANGES
+
269
−
269
View file @
9d5c6df7
This diff is collapsed.
Click to expand it.
configure.in
+
2
−
1
View file @
9d5c6df7
...
...
@@ -2,7 +2,7 @@ dnl $Id$
dnl Process this file with autoconf to produce a configure script.
AC_INIT(lib/urldata.h)
AM_CONFIG_HEADER(config.h src/config.h)
AM_INIT_AUTOMAKE(curl,"7.0.
8
beta")
AM_INIT_AUTOMAKE(curl,"7.0.
10
beta")
AM_PROG_LIBTOOL
dnl
...
...
@@ -287,6 +287,7 @@ AC_CHECK_FUNCS( socket \
gethostbyname_r \
gethostbyaddr \
gethostbyaddr_r \
localtime_r \
getservbyname \
gettimeofday \
inet_addr \
...
...
This diff is collapsed.
Click to expand it.
lib/getdate.y
+
12
−
2
View file @
9d5c6df7
...
...
@@ -9,10 +9,13 @@
*/
#ifdef HAVE_CONFIG_H
# include
<
config.h
>
# include
"
config.h
"
# ifdef HAVE_ALLOCA_H
# include <alloca.h>
# endif
# ifdef HAVE_TIME_H
# include <time.h>
# endif
#endif
/* Since the code of getdate.y is not included in the Emacs executable
...
...
@@ -468,6 +471,7 @@ o_merid : /* NULL */
extern struct tm *gmtime ();
extern struct tm *localtime ();
extern struct tm *localtime_r (time_t *, struct tm *);
extern time_t mktime ();
/* Month and day table. */
...
...
@@ -918,10 +922,16 @@ curl_getdate (const char *p, const time_t *now)
{
struct tm tm, tm0, *tmp;
time_t Start;
#ifdef HAVE_LOCALTIME_R
struct tm keeptime;
#endif
yyInput = p;
Start = now ? *now : time ((time_t *) NULL);
#ifdef HAVE_LOCALTIME_R
tmp = localtime_r(&Start, &keeptime);
#else
tmp = localtime (&Start);
#endif
if (!tmp)
return -1;
yyYear = tmp->tm_year + TM_YEAR_ORIGIN;
...
...
This diff is collapsed.
Click to expand it.
lib/http.c
+
12
−
0
View file @
9d5c6df7
...
...
@@ -61,6 +61,7 @@
#endif
#include
<netinet/in.h>
#include
<sys/time.h>
#include
<sys/resource.h>
#ifdef HAVE_UNISTD_H
#include
<unistd.h>
...
...
@@ -360,7 +361,18 @@ CURLcode http(struct connectdata *conn)
if
(
data
->
timecondition
)
{
struct
tm
*
thistime
;
#ifdef HAVE_LOCALTIME_R
extern
struct
tm
*
localtime_r
(
time_t
*
,
struct
tm
*
);
/* thread-safe version */
struct
tm
keeptime
;
thistime
=
localtime_r
(
&
data
->
timevalue
,
&
keeptime
);
#else
thistime
=
localtime
(
&
data
->
timevalue
);
#endif
if
(
NULL
==
thistime
)
{
failf
(
data
,
"localtime() failed!"
);
return
CURLE_OUT_OF_MEMORY
;
}
#ifdef HAVE_STRFTIME
/* format: "Tue, 15 Nov 1994 12:45:26 GMT" */
...
...
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