jinmeiliao commented on a change in pull request #6835:
URL: https://github.com/apache/geode/pull/6835#discussion_r709392225
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/command/PutUserCredentials.java
##########
@@ -39,45 +39,44 @@ public void cmdExecute(final Message clientMessage, final
ServerConnection serve
throws IOException, ClassNotFoundException, InterruptedException {
boolean isSecureMode = clientMessage.isSecureMode();
- // if (!isSecureMode)
- // client has not send secuirty header, need to send exception and log
this in security (file)
-
- if (isSecureMode) {
-
- int numberOfParts = clientMessage.getNumberOfParts();
+ if (!isSecureMode) {
+ // client has not send secuirty header, need to send exception and log
this in security (file)
+ return;
+ }
- if (numberOfParts == 1) {
- // need to get credentials
- try {
- serverConnection.setAsTrue(REQUIRES_RESPONSE);
- byte[] uniqueId = serverConnection.setCredentials(clientMessage);
- writeResponse(uniqueId, null, clientMessage, false,
serverConnection);
- } catch (GemFireSecurityException gfse) {
- if (serverConnection.getSecurityLogWriter().warningEnabled()) {
- serverConnection.getSecurityLogWriter().warning(String.format("%s",
- serverConnection.getName() + ": Security exception: " +
gfse.toString()
- + (gfse.getCause() != null ? ", caused by: " +
gfse.getCause().toString()
- : "")));
- }
- writeException(clientMessage, gfse, false, serverConnection);
- } catch (Exception ex) {
- if (serverConnection.getLogWriter().warningEnabled()) {
- serverConnection.getLogWriter().warning(
- String.format("An exception was thrown for client [%s]. %s",
- serverConnection.getProxyID(), ""),
- ex);
- }
- writeException(clientMessage, ex, false, serverConnection);
- } finally {
- serverConnection.setAsTrue(RESPONDED);
- }
+ int numberOfParts = clientMessage.getNumberOfParts();
+ if (numberOfParts != 1) {
+ // need to throw exception
Review comment:
again, do not want to change the old behavior on simple refatoring.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]