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
a60c9ef8
Commit
a60c9ef8
authored
16 years ago
by
Yang Tse
Browse files
Options
Downloads
Patches
Plain Diff
Improved parsing of resolver configuration files
parent
4e3d235e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ares/CHANGES
+4
-0
4 additions, 0 deletions
ares/CHANGES
ares/RELEASE-NOTES
+2
-2
2 additions, 2 deletions
ares/RELEASE-NOTES
ares/ares_init.c
+52
-7
52 additions, 7 deletions
ares/ares_init.c
with
58 additions
and
9 deletions
ares/CHANGES
+
4
−
0
View file @
a60c9ef8
Changelog for the c-ares project
* May 5 2008 (Yang Tse)
- Improved parsing of resolver configuration files.
* April 4 2008 (Daniel Stenberg)
- Eino Tuominen improved the code when a file is used to seed the randomizer.
...
...
This diff is collapsed.
Click to expand it.
ares/RELEASE-NOTES
+
2
−
2
View file @
a60c9ef8
This is what's new and changed in the c-ares 1.5.2 release:
o
o
improved parsing of resolver configuration files
Thanks go to these friendly people for their efforts and contributions:
Yang Tse
Have fun!
This diff is collapsed.
Click to expand it.
ares/ares_init.c
+
52
−
7
View file @
a60c9ef8
...
...
@@ -1245,16 +1245,61 @@ static int set_options(ares_channel channel, const char *str)
static
char
*
try_config
(
char
*
s
,
const
char
*
opt
)
{
size_t
len
;
ssize_t
i
;
ssize_t
j
;
char
*
p
;
len
=
strlen
(
opt
);
if
(
strncmp
(
s
,
opt
,
len
)
!=
0
||
!
ISSPACE
(
s
[
len
]))
if
(
!
s
||
!
opt
)
/* no line or no option */
return
NULL
;
/* trim line comment */
for
(
i
=
0
;
s
[
i
]
&&
s
[
i
]
!=
'#'
;
++
i
);
s
[
i
]
=
'\0'
;
/* trim trailing whitespace */
for
(
j
=
i
-
1
;
j
>=
0
&&
ISSPACE
(
s
[
j
]);
--
j
);
s
[
++
j
]
=
'\0'
;
/* skip leading whitespace */
for
(
i
=
0
;
s
[
i
]
&&
ISSPACE
(
s
[
i
]);
++
i
);
p
=
&
s
[
i
];
if
(
!*
p
)
/* empty line */
return
NULL
;
if
((
len
=
strlen
(
opt
))
==
0
)
/* empty option */
return
NULL
;
if
(
strncmp
(
p
,
opt
,
len
)
!=
0
)
/* line and option do not match */
return
NULL
;
s
+=
len
;
while
(
ISSPACE
(
*
s
))
s
++
;
return
s
;
}
/* skip over given option name */
p
+=
len
;
if
(
!*
p
)
/* no option value */
return
NULL
;
if
((
opt
[
len
-
1
]
!=
':'
)
&&
(
opt
[
len
-
1
]
!=
'='
)
&&
!
ISSPACE
(
*
p
))
/* whitespace between option name and value is mandatory
for given option names which do not end with ':' or '=' */
return
NULL
;
/* skip over whitespace */
while
(
*
p
&&
ISSPACE
(
*
p
))
p
++
;
if
(
!*
p
)
/* no option value */
return
NULL
;
/* return pointer to option value */
return
p
;
}
#endif
static
const
char
*
try_option
(
const
char
*
p
,
const
char
*
q
,
const
char
*
opt
)
...
...
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