Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2005 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2007 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 7-12
Link Here
|
7 |
* |
7 |
* |
8 |
* Contributors: |
8 |
* Contributors: |
9 |
* IBM Corporation - initial API and implementation |
9 |
* IBM Corporation - initial API and implementation |
|
|
10 |
* James D Miles (IBM Corp.) - bug 173893, AbstractResponse.openStreamWithCanel pegs CPU |
10 |
*******************************************************************************/ |
11 |
*******************************************************************************/ |
11 |
|
12 |
|
12 |
package org.eclipse.update.internal.core.connection; |
13 |
package org.eclipse.update.internal.core.connection; |
Lines 43-53
Link Here
|
43 |
if (monitor.isCanceled()) { |
44 |
if (monitor.isCanceled()) { |
44 |
runnable.disconnect(); |
45 |
runnable.disconnect(); |
45 |
connection = null; |
46 |
connection = null; |
46 |
break; |
47 |
//break; |
47 |
} |
|
|
48 |
if (runnable.getInputStream() != null) { |
49 |
is = runnable.getInputStream(); |
50 |
break; |
51 |
} |
48 |
} |
52 |
if (runnable.getIOException() != null) |
49 |
if (runnable.getIOException() != null) |
53 |
throw runnable.getIOException(); |
50 |
throw runnable.getIOException(); |
Lines 57-64
Link Here
|
57 |
IStatus.OK, |
54 |
IStatus.OK, |
58 |
runnable.getException().getMessage(), |
55 |
runnable.getException().getMessage(), |
59 |
runnable.getException())); |
56 |
runnable.getException())); |
|
|
57 |
if (runnable.getInputStream() != null || !t.isAlive()) { |
58 |
is = runnable.getInputStream(); |
59 |
break; |
60 |
} |
60 |
} |
61 |
t.join(POLLING_INTERVAL); |
61 |
t.join(POLLING_INTERVAL); |
|
|
62 |
} |
62 |
} catch (InterruptedException e) { |
63 |
} catch (InterruptedException e) { |
63 |
} |
64 |
} |
64 |
return is; |
65 |
return is; |