Skip to content

Commit ac00bc3

Browse files
author
Ajay Kannan
committed
---
yaml --- r: 1677 b: refs/heads/master c: 4d8d986 h: refs/heads/master i: 1675: bbe4bd1
1 parent 9f62120 commit ac00bc3

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 71ac555a9f0160c6295c1508c91f68a4159317c6
2+
refs/heads/master: 4d8d986b2ad0455914f8c95cac72d0900d290378
33
refs/heads/travis: e21ee7b88a5edc3f3d8c71f90c3fc32abf7e8dd6
44
refs/heads/gh-pages: d1b373c30c176edc08692348167bec3a244bb823
55
refs/heads/bigquery: 762fa5830e6c398c0396177e3e7fd243bd62cfc3

trunk/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)