IPAddress toString should use existing printTo algorithm and conform to RFC 5952 canonical format for IPv6 addresses

Đang mở
#228 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
cpp
Lĩnh vực
api, networking

Hướng nghiên cứu

Bắt đầu với các triển khai của IPAddress toString() và printTo(), sau đó xem lại các kiểm thử printTo() hiện có cho những trường hợp IPv6 canonical của RFC 5952. Làm cho toString() sử dụng thuật toán printTo() đã được thiết lập và thêm các kiểm thử đơn vị bao quát đầu ra của nó; hoàn tất khi cả hai phương thức tạo ra định dạng canonical như mong đợi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement
API component

IPAddress

Description

The toString() for an IPv6 type address has a different output from printTo(), and does not follow the RFC 5952 canonical format. It has an unnecessarily long fixed length format. Note that IPv4 does not use a fixed length format.

Also note that the existing printTo() method already implements the RFC 5952 canonical format algorithm, and has extensive tests (there are no tests for the toString() method).

The recommendation would be for toString() simply to use the existing algorithm from printTo() (and add some unit tests for toString).

Is this a breaking change?

No. Both formats are valid string formats for IPv6, and fromString() handles both of them (and all other valid formats), as should any other system. The canonical format is usually shorter, but will not exceed the fixed length format, so there is no issue with overruns.

Ngôn ngữ chính
C++
Star
306
Fork
150
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của arduino/ArduinoCore-API

Tất cả issue của arduino/ArduinoCore-API

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.