- Timestamp:
- 2008-10-31T19:27:01+13:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gli/trunk/src/org/greenstone/gatherer/download/DownloadJob.java
r17548 r17665 230 230 231 231 public void callDownload() { 232 232 233 233 ArrayList command_list = new ArrayList(); 234 234 if (Utility.isWindows()) { … … 305 305 306 306 // To be able to stop Wget, we use sockets to communicate with the perl process that launched wget 307 if ( !mode.equals("Z3950") && !mode.equals("SRW")) { // wget-based Download modes (OAI, MediaWiki and Web download)307 if (mode.equals("Web") || mode.equals("MediaWiki")) { // wget download modes other than OAI 308 308 309 309 // Need to find an available (unused) port within the range we're looking for to pass it … … 445 445 } 446 446 } 447 447 448 if(state == STOPPED) { 448 449 boolean terminatePerlScript = true; 449 450 // When GLI is working with wget-based download modes (OAI, MediaWiki and Web download) 451 // and the STOP button has been pressed, wget needs to be prematurely terminated. 452 // The presence of the tmpfile will indicate to the perl script that it's time to kill wget. 453 if(prcs != null && !mode.equals("Z3950") && !mode.equals("SRW")) { 454 450 451 // When GLI is working with wget-based download modes other than OAI (MediaWiki and Web 452 // download) and the STOP button has been pressed, wget needs to be prematurely terminated. 453 // Only wget download modes Web and MediaWiki require the use of sockets to communicate 454 // with the perl script in order to get wget to terminate. Other download modes, including 455 // wgetdownload mode OAI, can terminate in the traditional manner: close process inputstream 456 // and kill perl process. OAI launches many wgets. So that when the perl process is terminated, 457 // the currently running wget will finish off but other wgets are no longer launched. 458 if(prcs != null && (mode.equals("Web") || mode.equals("MediaWiki"))) { 459 455 460 // create a socket to the perl child process and communicate the STOP message 456 461 Socket clientSocket = null; … … 494 499 //prcs.getInputStream().close(); 495 500 prcs.getErrorStream().close(); 501 br.close(); 502 br = null; 496 503 if(terminatePerlScript) { 497 504 prcs.destroy(); // This doesn't always work, but it's worth a try 498 505 prcs = null; 499 506 } 500 br.close();501 br = null;502 507 503 508 // Notify the DownloadScrollPane which is waiting on this job to complete that we are ready
Note:
See TracChangeset
for help on using the changeset viewer.