diff --git a/instrumentation-security/okhttp-3.0.0/src/main/java/com/newrelic/agent/security/instrumentation/okhttp30/OkhttpHelper.java b/instrumentation-security/okhttp-3.0.0/src/main/java/com/newrelic/agent/security/instrumentation/okhttp30/OkhttpHelper.java index 1cf6e8926..94db4237c 100644 --- a/instrumentation-security/okhttp-3.0.0/src/main/java/com/newrelic/agent/security/instrumentation/okhttp30/OkhttpHelper.java +++ b/instrumentation-security/okhttp-3.0.0/src/main/java/com/newrelic/agent/security/instrumentation/okhttp30/OkhttpHelper.java @@ -31,7 +31,6 @@ public static AbstractOperation preprocessSecurityHook(String url, String classN SSRFOperation operation = new SSRFOperation(url, className, methodName); NewRelicSecurity.getAgent().getSecurityMetaData().getMetaData().setFromJumpRequiredInStackTrace(3); - NewRelicSecurity.getAgent().registerOperation(operation); return operation; } catch (Throwable e) { if (e instanceof NewRelicSecurityException) { @@ -51,7 +50,7 @@ public static void registerExitOperation(boolean isProcessingAllowed, AbstractOp ) { return; } - NewRelicSecurity.getAgent().registerExitEvent(operation); + NewRelicSecurity.getAgent().registerOperation(operation); } catch (Throwable e) { NewRelicSecurity.getAgent().log(LogLevel.FINEST, String.format(GenericHelper.EXIT_OPERATION_EXCEPTION_MESSAGE, OKHTTP_3_0_0, e.getMessage()), e, OkhttpHelper.class.getName()); } diff --git a/instrumentation-security/okhttp-3.0.0/src/main/java/com/newrelic/agent/security/instrumentation/okhttp30/RealCall_Instrumentation.java b/instrumentation-security/okhttp-3.0.0/src/main/java/com/newrelic/agent/security/instrumentation/okhttp30/RealCall_Instrumentation.java index 942e374c7..e0421372a 100644 --- a/instrumentation-security/okhttp-3.0.0/src/main/java/com/newrelic/agent/security/instrumentation/okhttp30/RealCall_Instrumentation.java +++ b/instrumentation-security/okhttp-3.0.0/src/main/java/com/newrelic/agent/security/instrumentation/okhttp30/RealCall_Instrumentation.java @@ -51,10 +51,10 @@ public Response execute() { returnVal = Weaver.callOriginal(); } finally { if(isLockAcquired){ + OkhttpHelper.registerExitOperation(isLockAcquired, operation); releaseLock(); } } - OkhttpHelper.registerExitOperation(isLockAcquired, operation); return returnVal; } diff --git a/instrumentation-security/okhttp-3.5.0/src/main/java/com/newrelic/agent/security/instrumentation/okhttp35/OkhttpHelper.java b/instrumentation-security/okhttp-3.5.0/src/main/java/com/newrelic/agent/security/instrumentation/okhttp35/OkhttpHelper.java index 776224375..7ab68893f 100644 --- a/instrumentation-security/okhttp-3.5.0/src/main/java/com/newrelic/agent/security/instrumentation/okhttp35/OkhttpHelper.java +++ b/instrumentation-security/okhttp-3.5.0/src/main/java/com/newrelic/agent/security/instrumentation/okhttp35/OkhttpHelper.java @@ -30,7 +30,6 @@ public static AbstractOperation preprocessSecurityHook(String url, String classN } SSRFOperation ssrfOperation = new SSRFOperation(url, className, methodName); NewRelicSecurity.getAgent().getSecurityMetaData().getMetaData().setFromJumpRequiredInStackTrace(3); - NewRelicSecurity.getAgent().registerOperation(ssrfOperation); return ssrfOperation; } catch (Throwable e) { if (e instanceof NewRelicSecurityException) { @@ -50,7 +49,7 @@ public static void registerExitOperation(boolean isProcessingAllowed, AbstractOp ) { return; } - NewRelicSecurity.getAgent().registerExitEvent(operation); + NewRelicSecurity.getAgent().registerOperation(operation); } catch (Throwable e) { NewRelicSecurity.getAgent().log(LogLevel.FINEST, String.format(GenericHelper.EXIT_OPERATION_EXCEPTION_MESSAGE, OKHTTP_3_5_0, e.getMessage()), e, OkhttpHelper.class.getName()); } diff --git a/instrumentation-security/okhttp-3.5.0/src/main/java/com/newrelic/agent/security/instrumentation/okhttp35/http/HttpCodec_Instrumentation.java b/instrumentation-security/okhttp-3.5.0/src/main/java/com/newrelic/agent/security/instrumentation/okhttp35/http/HttpCodec_Instrumentation.java index 73e218b5d..eb02c2ca3 100644 --- a/instrumentation-security/okhttp-3.5.0/src/main/java/com/newrelic/agent/security/instrumentation/okhttp35/http/HttpCodec_Instrumentation.java +++ b/instrumentation-security/okhttp-3.5.0/src/main/java/com/newrelic/agent/security/instrumentation/okhttp35/http/HttpCodec_Instrumentation.java @@ -36,10 +36,10 @@ public void writeRequestHeaders(Request request) { Weaver.callOriginal(); } finally { if (isLockAcquired) { + OkhttpHelper.registerExitOperation(isLockAcquired, operation); releaseLock(); } } - OkhttpHelper.registerExitOperation(isLockAcquired, operation); } private void releaseLock() {