View | Details | Raw Unified | Return to bug 173893 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/update/internal/core/connection/ConnectionThreadManager.java (-7 / +7 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2006 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
package org.eclipse.update.internal.core.connection;
12
package org.eclipse.update.internal.core.connection;
12
13
Lines 94-99 Link Here
94
		public void run() {
95
		public void run() {
95
			try {
96
			try {
96
				is = urlConnection.getInputStream();
97
				is = urlConnection.getInputStream();
98
			} catch (IOException e) {
99
				ioException = e;
100
			} catch (Exception e) {
101
				exception = e;
102
			} finally {
97
				if (disconnected) {
103
				if (disconnected) {
98
					// The connection was slow, but returned
104
					// The connection was slow, but returned
99
					// a valid input stream. However,
105
					// a valid input stream. However,
Lines 110-121 Link Here
110
						}
116
						}
111
					}
117
					}
112
				}
118
				}
113
			} catch (IOException e) {
114
				ioException = e;
115
			} catch (Exception e) {
116
				exception = e;
117
			} finally {
118
				//threads.
119
			}
119
			}
120
		}
120
		}
121
	}
121
	}
(-)src/org/eclipse/update/internal/core/connection/AbstractResponse.java (-6 / +7 lines)
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;

Return to bug 173893