Skip to content

Commit 5018efc

Browse files
author
Rob Petti
committed
we need to close the writer, otherwise we can hang in certain situations
1 parent 7c67b46 commit 5018efc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/main/java/com/tek42/perforce/parse/AbstractPerforceTemplate.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ protected StringBuilder getPerforceResponse(String origcmd[], ResponseFilter fil
339339
StopWatch stopWatch = new StopWatch();
340340
int timeout = scmDescr.getP4ReadLineTimeout() * 1000;
341341
stopWatch.start();
342-
342+
p4.getWriter().close();
343343
try {
344344
while (reader.ready() || p4.isAlive()) {
345345
if (reader.ready()) {
@@ -374,7 +374,6 @@ protected StringBuilder getPerforceResponse(String origcmd[], ResponseFilter fil
374374
}
375375

376376
} else { // legacy behavior
377-
p4.getWriter().close();
378377
while((line = reader.readLine()) != null) {
379378
// only check for errors if we have not found one already
380379
if (mesgIndex == -1)

0 commit comments

Comments
 (0)