GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — remove duplicated SSL.getSniHostname(ssl) call in ExtendedOpenSslSess… · netty/netty@14ac8fa

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • handler/src/main/java/io/netty/handler/ssl
    • ReferenceCountedOpenSslEngine.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java‎

Copy file name to clipboardExpand all lines: handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java
+5-10Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -256,16 +256,11 @@ public List<SNIServerName> getRequestedServerNames() {
256256
requestedServerNames = Collections.emptyList();
257257
} else {
258258
String name = SSL.getSniHostname(ssl);
259-
if (name == null) {
260-
requestedServerNames = Collections.emptyList();
261-
} else {
262-
// Convert to bytes as we do not want to do any strict validation of the
263-
// SNIHostName while creating it.
264-
byte[] hostname = SSL.getSniHostname(ssl).getBytes(CharsetUtil.UTF_8);
265-
requestedServerNames = hostname.length == 0 ?
266-
Collections.emptyList() :
267-
Collections.singletonList(new SNIHostName(hostname));
268-
}
259+
requestedServerNames = (name == null || name.isEmpty()) ?
260+
Collections.emptyList() :
261+
// Convert to bytes as we do not want to do any strict validation of the
262+
// SNIHostName while creating it.
263+
Collections.singletonList(new SNIHostName(name.getBytes(CharsetUtil.UTF_8)));
269264
}
270265
}
271266
return requestedServerNames;

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.