Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
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
Container registry
Model registry
Operate
Environments
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
pikelang
pike
Commits
7f82922f
Commit
7f82922f
authored
27 years ago
by
David Hedbor
Browse files
Options
Downloads
Patches
Plain Diff
Added workaround for mysterious bug (72312 @ InfoKOM).
Rev: lib/modules/Protocols.pmod/DNS.pmod:1.6
parent
27c68520
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/modules/Protocols.pmod/DNS.pmod
+10
-10
10 additions, 10 deletions
lib/modules/Protocols.pmod/DNS.pmod
with
10 additions
and
10 deletions
lib/modules/Protocols.pmod/DNS.pmod
+
10
−
10
View file @
7f82922f
...
@@ -212,7 +212,7 @@ class client {
...
@@ -212,7 +212,7 @@ class client {
inherit protocol;
inherit protocol;
string nameserver;
string nameserver;
array
search
= ({});
array
domains
= ({});
void create(void|string server)
void create(void|string server)
{
{
if(!server)
if(!server)
...
@@ -236,7 +236,7 @@ class client {
...
@@ -236,7 +236,7 @@ class client {
case "search":
case "search":
rest = replace(rest, "\t", " ");
rest = replace(rest, "\t", " ");
foreach(rest / " " - ({""}), string dom)
foreach(rest / " " - ({""}), string dom)
search
+= ({dom});
domains
+= ({dom});
break;
break;
case "nameserver":
case "nameserver":
...
@@ -245,7 +245,7 @@ class client {
...
@@ -245,7 +245,7 @@ class client {
}
}
}
}
if(domain)
if(domain)
search
= ({ domain }) +
search
;
domains
= ({ domain }) +
domains
;
} else {
} else {
nameserver=server;
nameserver=server;
}
}
...
@@ -272,10 +272,10 @@ class client {
...
@@ -272,10 +272,10 @@ class client {
mixed *gethostbyname(string s)
mixed *gethostbyname(string s)
{
{
mapping m;
mapping m;
if(sizeof(
search
) && s[-1] != '.' && sizeof(s/".") < 3) {
if(sizeof(
domains
) && s[-1] != '.' && sizeof(s/".") < 3) {
m=do_sync_query(mkquery(s, C_IN, T_A));
m=do_sync_query(mkquery(s, C_IN, T_A));
if(!m || !m->an || !sizeof(m->an))
if(!m || !m->an || !sizeof(m->an))
foreach(
search
, string domain)
foreach(
domains
, string domain)
{
{
m=do_sync_query(mkquery(s+"."+domain, C_IN, T_A));
m=do_sync_query(mkquery(s+"."+domain, C_IN, T_A));
if(m && m->an && sizeof(m->an))
if(m && m->an && sizeof(m->an))
...
@@ -337,10 +337,10 @@ class client {
...
@@ -337,10 +337,10 @@ class client {
string get_primary_mx(string host)
string get_primary_mx(string host)
{
{
mapping m;
mapping m;
if(sizeof(
search
) && host[-1] != '.' && sizeof(host/".") < 3) {
if(sizeof(
domains
) && host[-1] != '.' && sizeof(host/".") < 3) {
m=do_sync_query(mkquery(host, C_IN, T_MX));
m=do_sync_query(mkquery(host, C_IN, T_MX));
if(!m || !m->an || !sizeof(m->an))
if(!m || !m->an || !sizeof(m->an))
foreach(
search
, string domain)
foreach(
domains
, string domain)
{
{
m=do_sync_query(mkquery(host+"."+domain, C_IN, T_MX));
m=do_sync_query(mkquery(host+"."+domain, C_IN, T_MX));
if(m && m->an && sizeof(m->an))
if(m && m->an && sizeof(m->an))
...
@@ -445,13 +445,13 @@ class async_client
...
@@ -445,13 +445,13 @@ class async_client
{
{
if(!answer || !answer->an || !sizeof(answer->an))
if(!answer || !answer->an || !sizeof(answer->an))
{
{
if(multi == -1 ||
sizeof(search) < multi
) {
if(multi == -1 ||
multi >= sizeof(domains)
) {
// Either a request without multi (ip, or FQDN) or we have tried all
// Either a request without multi (ip, or FQDN) or we have tried all
// domains.
// domains.
callback(domain,0,@args);
callback(domain,0,@args);
} else {
} else {
// Multiple domain request. Try the next one...
// Multiple domain request. Try the next one...
do_query(domain+"."+
search
[multi], C_IN, T_A,
do_query(domain+"."+
domains
[multi], C_IN, T_A,
generic_get, ++multi, "a", domain, callback, @args);
generic_get, ++multi, "a", domain, callback, @args);
}
}
} else {
} else {
...
@@ -468,7 +468,7 @@ class async_client
...
@@ -468,7 +468,7 @@ class async_client
void host_to_ip(string host, function callback, mixed ... args)
void host_to_ip(string host, function callback, mixed ... args)
{
{
if(sizeof(
search
) && host[-1] != '.' && sizeof(host/".") < 3) {
if(sizeof(
domains
) && host[-1] != '.' && sizeof(host/".") < 3) {
do_query(host, C_IN, T_A,
do_query(host, C_IN, T_A,
generic_get, 0, "a", host, callback, @args );
generic_get, 0, "a", host, callback, @args );
} else {
} else {
...
...
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