1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-09 05:43:12 +02:00

- Fixed small memory leak in resolver (~40 bytes when connecting to a server)

- Made Unreal use the original name in case of a CNAME, instead of the forwarded name,
  reported by jerrcsnet (#0003054).
- The "looking up your hostname" message was always sent, regardless of show-connect-info.
This commit is contained in:
Bram Matthys
2006-09-06 12:24:05 +00:00
parent 40d234d182
commit 30dbdaa750
3 changed files with 16 additions and 11 deletions
+4
View File
@@ -1301,3 +1301,7 @@
- Fixes to SVSNICK: case-change no longer causes a collision, don't return the value from
exit_client (which would be FLUSH_BUFFER), fix QUIT not being sent back on collision.
- Fix for above so it doesn't -r the client.
- Fixed small memory leak in resolver (~40 bytes when connecting to a server)
- Made Unreal use the original name in case of a CNAME, instead of the forwarded name,
reported by jerrcsnet (#0003054).
- The "looking up your hostname" message was always sent, regardless of show-connect-info.
+11 -10
View File
@@ -207,7 +207,6 @@ char ipv4[4];
#else
r->ipv6 = 0;
#endif
r->name = strdup(name);
unrealdns_addreqtolist(r);
/* Execute it */
@@ -242,6 +241,7 @@ char ipv6 = r->ipv6;
newr = MyMallocEx(sizeof(DNSReq));
newr->cptr = acptr;
newr->ipv6 = ipv6;
newr->name = strdup(he->h_name);
unrealdns_addreqtolist(newr);
#ifndef INET6
@@ -276,10 +276,8 @@ int i;
struct hostent *he2;
u_int32_t ipv4_addr;
unrealdns_freeandremovereq(r);
if (!acptr)
return;
goto bad;
if ((status != 0) ||
#ifdef INET6
@@ -290,7 +288,7 @@ u_int32_t ipv4_addr;
{
/* Failed: error code, or data length is not 4 (nor 16) */
proceed_normal_client_handshake(acptr, NULL);
return;
goto bad;
}
if (!ipv6)
@@ -322,21 +320,24 @@ u_int32_t ipv4_addr;
{
/* Failed name <-> IP mapping */
proceed_normal_client_handshake(acptr, NULL);
return;
goto bad;
}
if (!verify_hostname(he->h_name))
if (!verify_hostname(r->name))
{
/* Hostname is bad, don't cache and consider unresolved */
proceed_normal_client_handshake(acptr, NULL);
return;
goto bad;
}
/* Entry was found, verified, and can be added to cache */
unrealdns_addtocache(he->h_name, &acptr->ip, sizeof(acptr->ip));
unrealdns_addtocache(r->name, &acptr->ip, sizeof(acptr->ip));
he2 = unreal_create_hostent(he->h_name, &acptr->ip);
he2 = unreal_create_hostent(r->name, &acptr->ip);
proceed_normal_client_handshake(acptr, he2);
bad:
unrealdns_freeandremovereq(r);
}
void unrealdns_cb_nametoip_link(void *arg, int status, struct hostent *he)
+1 -1
View File
@@ -1356,7 +1356,7 @@ struct hostent *he;
if (!DONT_RESOLVE)
{
if (!acptr->serv)
if (SHOWCONNECTINFO && !acptr->serv)
sendto_one(acptr, "%s", REPORT_DO_DNS);
dns_special_flag = 1;
he = unrealdns_doclient(acptr);