View | Details | Raw Unified | Return to bug 51918
Collapse All | Expand All

(-)src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java (-1 / +1 lines)
Lines 1548-1554 Link Here
1548
     */
1548
     */
1549
    public byte[] readResponse(SampleResult sampleResult, InputStream in, int length) throws IOException {
1549
    public byte[] readResponse(SampleResult sampleResult, InputStream in, int length) throws IOException {
1550
1550
1551
        byte[] readBuffer = getThreadContext().getReadBuffer();
1551
        byte[] readBuffer = new byte[8192];
1552
        int bufferSize=32;// Enough for MD5
1552
        int bufferSize=32;// Enough for MD5
1553
1553
1554
        MessageDigest md=null;
1554
        MessageDigest md=null;
(-)src/core/org/apache/jmeter/threads/JMeterContext.java (-15 lines)
Lines 47-54 Link Here
47
47
48
    private int threadNum;
48
    private int threadNum;
49
49
50
    private byte[] readBuffer = null;
51
52
    private boolean isReinitSubControllers = false;
50
    private boolean isReinitSubControllers = false;
53
51
54
    JMeterContext() {
52
    JMeterContext() {
Lines 66-72 Link Here
66
        previousSampler = null;
64
        previousSampler = null;
67
        samplingStarted = false;
65
        samplingStarted = false;
68
        threadNum = 0;
66
        threadNum = 0;
69
        readBuffer = null;
70
        thread = null;
67
        thread = null;
71
        isReinitSubControllers = false;
68
        isReinitSubControllers = false;
72
    }
69
    }
Lines 80-97 Link Here
80
        return variables;
77
        return variables;
81
    }
78
    }
82
79
83
    /**
84
     * A temporary buffer that can be shared between samplers in a thread.
85
     * 
86
     * @return the shared read buffer
87
     */
88
    public byte[] getReadBuffer() {
89
        if (readBuffer == null) {
90
            readBuffer = new byte[8192];
91
        }
92
        return readBuffer;
93
    }
94
95
    public void setVariables(JMeterVariables vars) {
80
    public void setVariables(JMeterVariables vars) {
96
        this.variables = vars;
81
        this.variables = vars;
97
    }
82
    }

Return to bug 51918