Merge branch 'stable-0.7'
* stable-0.7: Fix EGit deadlock listing branches of SSH remote
This commit is contained in:
commit
8014dbe9bf
|
@ -282,8 +282,10 @@ private PackProtocolException duplicateAdvertisement(final String name) {
|
||||||
public void close() {
|
public void close() {
|
||||||
if (out != null) {
|
if (out != null) {
|
||||||
try {
|
try {
|
||||||
if (outNeedsEnd)
|
if (outNeedsEnd) {
|
||||||
|
outNeedsEnd = false;
|
||||||
pckOut.end();
|
pckOut.end();
|
||||||
|
}
|
||||||
out.close();
|
out.close();
|
||||||
} catch (IOException err) {
|
} catch (IOException err) {
|
||||||
// Ignore any close errors.
|
// Ignore any close errors.
|
||||||
|
@ -314,4 +316,23 @@ public void close() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Tell the peer we are disconnecting, if it cares to know. */
|
||||||
|
protected void endOut() {
|
||||||
|
if (outNeedsEnd && out != null) {
|
||||||
|
try {
|
||||||
|
outNeedsEnd = false;
|
||||||
|
pckOut.end();
|
||||||
|
} catch (IOException e) {
|
||||||
|
try {
|
||||||
|
out.close();
|
||||||
|
} catch (IOException err) {
|
||||||
|
// Ignore any close errors.
|
||||||
|
} finally {
|
||||||
|
out = null;
|
||||||
|
pckOut = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -264,6 +264,8 @@ class SshFetchConnection extends BasePackFetchConnection {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
|
endOut();
|
||||||
|
|
||||||
if (errorThread != null) {
|
if (errorThread != null) {
|
||||||
try {
|
try {
|
||||||
errorThread.join();
|
errorThread.join();
|
||||||
|
@ -331,6 +333,8 @@ class SshPushConnection extends BasePackPushConnection {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
|
endOut();
|
||||||
|
|
||||||
if (errorThread != null) {
|
if (errorThread != null) {
|
||||||
try {
|
try {
|
||||||
errorThread.join();
|
errorThread.join();
|
||||||
|
|
Loading…
Reference in New Issue