Skip to content

Commit 8f8bb54

Browse files
committed
Add comments
1 parent 7571b03 commit 8f8bb54

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

dnscrypt-proxy/logger.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ func Logger(logMaxSize int, logMaxAge int, logMaxBackups int, fileName string) i
1616
if st.Mode().IsDir() {
1717
dlog.Fatalf("[%v] is a directory", fileName)
1818
}
19+
// Special files (devices, pipes) are opened directly
20+
// Note: The caller is responsible for closing the returned file descriptor
21+
// This is handled by the plugin cleanup during proxy shutdown
1922
fp, err := os.OpenFile(fileName, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0o644)
2023
if err != nil {
2124
dlog.Fatalf("Unable to access [%v]: [%v]", fileName, err)

dnscrypt-proxy/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ func main() {
3434
}
3535
runtime.MemProfileRate = 0
3636

37+
// Initialize random number generator
38+
// Note: As of Go 1.20, the global RNG is automatically seeded
39+
// This explicit seeding is kept for compatibility with older Go versions
3740
seed := make([]byte, 8)
3841
if _, err := crypto_rand.Read(seed); err != nil {
3942
dlog.Fatal(err)

0 commit comments

Comments
 (0)