Skip to content

Commit 2919253

Browse files
committed
Fix panic on EDNS OPT pseudo-records
1 parent e4f877f commit 2919253

File tree

3 files changed

+34
-14
lines changed

3 files changed

+34
-14
lines changed

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.0.1] - 2025-12-25
9+
10+
### Fixes
11+
- Fixes a panic when encountering EDNS OPT pseudo-records
12+
13+
## [1.0.0] - 2025-12-25
14+
15+
Initial stable release.
16+
17+
### Fixed
18+
- Replaces a local dev dependency with one from hex.
19+
This works around a bug that currently makes the LSP misbehave when
20+
browsing the package source.
21+
22+
[1.0.1]: https://github.com/sbergen/esdee/releases/tag/v1.0.1
23+
[1.0.0]: https://github.com/sbergen/esdee/releases/tag/v1.0.0

gleam.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name = "esdee"
2-
version = "1.0.0"
2+
version = "1.0.1"
33

44
description = "Gleam DNS-SD discovery on Erlang"
55
licences = ["Apache-2.0"]

src/esdee_ffi.erl

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,16 @@ map_answer(Answer) ->
3737
false
3838
end.
3939

40-
map_resource(Resource) ->
41-
case Resource#dns_rr.type of
42-
?S_TXT ->
43-
{true, map_txt(Resource)};
44-
?S_SRV ->
45-
{true, map_srv(Resource)};
46-
?S_A ->
47-
{true, map_a(Resource)};
48-
?S_AAAA ->
49-
{true, map_aaaa(Resource)};
50-
_ ->
51-
false
52-
end.
40+
map_resource(#dns_rr{type = ?S_TXT} = R) ->
41+
{true, map_txt(R)};
42+
map_resource(#dns_rr{type = ?S_SRV} = R) ->
43+
{true, map_srv(R)};
44+
map_resource(#dns_rr{type = ?S_A} = R) ->
45+
{true, map_a(R)};
46+
map_resource(#dns_rr{type = ?S_AAAA} = R) ->
47+
{true, map_aaaa(R)};
48+
map_resource(_) ->
49+
false.
5350

5451
map_ptr(Record) ->
5552
ServiceType = unicode:characters_to_binary(Record#dns_rr.domain),

0 commit comments

Comments
 (0)