Lines 91-96
Link Here
|
91 |
private transient ByteArrayOutputStream responseData = new ByteArrayOutputStream(); |
91 |
private transient ByteArrayOutputStream responseData = new ByteArrayOutputStream(); |
92 |
private int inpos = 0; |
92 |
private int inpos = 0; |
93 |
private int outpos = 0; |
93 |
private int outpos = 0; |
|
|
94 |
private transient String stringBody = null; |
94 |
private transient InputStream body = null; |
95 |
private transient InputStream body = null; |
95 |
|
96 |
|
96 |
public AjpSampler() { |
97 |
public AjpSampler() { |
Lines 131-136
Link Here
|
131 |
} |
132 |
} |
132 |
channel = null; |
133 |
channel = null; |
133 |
body = null; |
134 |
body = null; |
|
|
135 |
stringBody = null; |
134 |
} |
136 |
} |
135 |
|
137 |
|
136 |
private void setupConnection(URL url, |
138 |
private void setupConnection(URL url, |
Lines 171-177
Link Here
|
171 |
} else { |
173 |
} else { |
172 |
setString(HTTP_1_1); |
174 |
setString(HTTP_1_1); |
173 |
} |
175 |
} |
174 |
setString(url.getFile()); |
176 |
setString(url.getPath()); |
175 |
setString(localAddress); |
177 |
setString(localAddress); |
176 |
setString(localName); |
178 |
setString(localName); |
177 |
setString(host); |
179 |
setString(host); |
Lines 181-187
Link Here
|
181 |
String hdr = setConnectionHeaders(url, host, method); |
183 |
String hdr = setConnectionHeaders(url, host, method); |
182 |
res.setRequestHeaders(hdr); |
184 |
res.setRequestHeaders(hdr); |
183 |
res.setCookies(setConnectionCookies(url, getCookieManager())); |
185 |
res.setCookies(setConnectionCookies(url, getCookieManager())); |
184 |
setByte((byte)0xff); // Attributes not supported |
186 |
String query = url.getQuery(); |
|
|
187 |
if (query != null) { |
188 |
setByte((byte)0x05); // Marker for query string attribute |
189 |
setString(query); |
190 |
} |
191 |
setByte((byte)0xff); // More general attributes not supported |
185 |
} |
192 |
} |
186 |
|
193 |
|
187 |
private int getHeaderSize(String method, URL url) { |
194 |
private int getHeaderSize(String method, URL url) { |
Lines 267-275
Link Here
|
267 |
} else { |
274 |
} else { |
268 |
sb.append('&'); |
275 |
sb.append('&'); |
269 |
} |
276 |
} |
270 |
sb.append(arg.getName()).append('=').append(arg.getStringValue()); |
277 |
sb.append(arg.getStringValue()); |
271 |
} |
278 |
} |
272 |
byte [] sbody = sb.toString().getBytes(); //FIXME - encoding |
279 |
stringBody = sb.toString(); |
|
|
280 |
byte [] sbody = stringBody.getBytes(); //FIXME - encoding |
273 |
cl = sbody.length; |
281 |
cl = sbody.length; |
274 |
body = new ByteArrayInputStream(sbody); |
282 |
body = new ByteArrayInputStream(sbody); |
275 |
} |
283 |
} |
Lines 364-369
Link Here
|
364 |
throws IOException { |
372 |
throws IOException { |
365 |
send(); |
373 |
send(); |
366 |
if(method.equals(POST)) { |
374 |
if(method.equals(POST)) { |
|
|
375 |
res.setQueryString(stringBody); |
367 |
sendPostBody(); |
376 |
sendPostBody(); |
368 |
} |
377 |
} |
369 |
handshake(res); |
378 |
handshake(res); |