Skip to content

Commit 7544dc5

Browse files
author
Ajay Kannan
committed
---
yaml --- r: 4505 b: refs/heads/logging-alpha c: 4d8d986 h: refs/heads/master i: 4503: b61118c
1 parent 3dfadb7 commit 7544dc5

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ refs/heads/compute-alpha: 969cba2627f1d53d352cc4a5ffe0879dacf65e6c
1212
refs/heads/dns-alpha: 2f90e7e338349287ace33375896907af0f032ca1
1313
refs/heads/dns-alpha-batch: 17442b07867021b85d0452f5f3eda29a3413288f
1414
refs/heads/gcs-nio: 283aeaf15efdcf3621eb6859f05e55ad7764375d
15-
refs/heads/logging-alpha: 71ac555a9f0160c6295c1508c91f68a4159317c6
15+
refs/heads/logging-alpha: 4d8d986b2ad0455914f8c95cac72d0900d290378
1616
refs/tags/v0.1.0: a615317f7424ed58621b1f65d5c4d8cbbe8a6ed8
1717
refs/tags/v0.1.1: 7a7f6985fe465e9dd6a075af55493f42b4933be0
1818
refs/tags/v0.1.2: 3eb3fe866ba22487686048f45d927b8c8638ea3f

branches/logging-alpha/gcloud-java-datastore/src/main/java/com/google/gcloud/datastore/testing/LocalGcdHelper.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ private static void extractFile(ZipInputStream zipIn, File filePath) throws IOEx
526526

527527
public static boolean sendQuitRequest(int port) {
528528
StringBuilder result = new StringBuilder();
529+
String shutdownMsg = "Shutting down local server";
529530
try {
530531
URL url = new URL("http", "localhost", port, "/_ah/admin/quit");
531532
HttpURLConnection con = (HttpURLConnection) url.openConnection();
@@ -537,13 +538,13 @@ public static boolean sendQuitRequest(int port) {
537538
out.flush();
538539
InputStream in = con.getInputStream();
539540
int currByte = 0;
540-
while ((currByte = in.read()) != -1) {
541+
while ((currByte = in.read()) != -1 && result.length() < shutdownMsg.length()) {
541542
result.append(((char) currByte));
542543
}
543544
} catch (IOException ignore) {
544545
// ignore
545546
}
546-
return result.toString().startsWith("Shutting down local server");
547+
return result.toString().startsWith(shutdownMsg);
547548
}
548549

549550
public void stop() throws IOException, InterruptedException {

0 commit comments

Comments
 (0)