2005-12-30 jrandom

* Close streams more gracefully
This commit is contained in:
jrandom
2005-12-30 23:33:52 +00:00
committed by zzz
parent 8e87ae08fb
commit 0f8611e465
12 changed files with 52 additions and 25 deletions

View File

@ -610,7 +610,7 @@ public class EepGet {
_log.debug("Request flushed");
}
private String getRequest() {
private String getRequest() throws IOException {
StringBuffer buf = new StringBuffer(512);
boolean post = false;
if ( (_postData != null) && (_postData.length() > 0) )
@ -620,12 +620,8 @@ public class EepGet {
} else {
buf.append("GET ").append(_url).append(" HTTP/1.1\r\n");
}
try {
URL url = new URL(_url);
buf.append("Host: ").append(url.getHost()).append("\r\n");
} catch (MalformedURLException mue) {
mue.printStackTrace();
}
URL url = new URL(_url);
buf.append("Host: ").append(url.getHost()).append("\r\n");
if (_alreadyTransferred > 0) {
buf.append("Range: bytes=");
buf.append(_alreadyTransferred);