Commit 83ad20d
committed
fix(appsec/jetty8): correct partPeek condition — use == 0 instead of == 1
CallDepthThreadLocalMap.incrementCallDepth() uses post-increment (depth++) so it returns
the depth BEFORE the increment. In the normal case (no GetPartAdvice active), Part.class
depth is 0 before the peek, making partPeek == 0. The previous guard checked partPeek == 1
which is true only when GetPartAdvice IS already on the stack — exactly backwards.
Result: GetFilenamesAdvice never fired for direct getParts() calls, breaking the filenames
event on Jetty 8.x.
Fix: use partPeek == 0 (proceed when GetPartAdvice is not active) so the condition is:
- partPeek == 0: normal direct getParts() → proceed (fire filenames event)
- partPeek == 1: getParts() called by getPart() in Jetty 9.0/9.1 → skip (GetPartAdvice handles it)1 parent af78ea4 commit 83ad20d
1 file changed
Lines changed: 5 additions & 4 deletions
File tree
- dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-8.1.3/src/main/java/datadog/trace/instrumentation/jetty8
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
131 | | - | |
132 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
133 | 134 | | |
134 | 135 | | |
135 | | - | |
| 136 | + | |
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
| |||
0 commit comments