mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-11 13:24:43 -04:00
Use the label_len local variable in evdns instead of recalculating it over and over
This commit is contained in:
parent
a3245afec2
commit
ba01456999
8
evdns.c
8
evdns.c
@ -1522,8 +1522,8 @@ dnsname_to_labels(u8 *const buf, size_t buf_len, off_t j,
|
||||
if (table) dnslabel_table_add(table, start, j);
|
||||
buf[j++] = (ev_uint8_t)label_len;
|
||||
|
||||
memcpy(buf + j, start, end - start);
|
||||
j += (int)(end - start);
|
||||
memcpy(buf + j, start, label_len);
|
||||
j += (int) label_len;
|
||||
break;
|
||||
} else {
|
||||
/* append length of the label. */
|
||||
@ -1533,8 +1533,8 @@ dnsname_to_labels(u8 *const buf, size_t buf_len, off_t j,
|
||||
if (table) dnslabel_table_add(table, start, j);
|
||||
buf[j++] = (ev_uint8_t)label_len;
|
||||
|
||||
memcpy(buf + j, start, name - start);
|
||||
j += (int)(name - start);
|
||||
memcpy(buf + j, start, label_len);
|
||||
j += (int) label_len;
|
||||
/* hop over the '.' */
|
||||
name++;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user