Skip to content

Commit

Permalink
Second attempt to work around ICE. See vibe-d#756.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-ludwig authored and marcioapm committed Sep 4, 2014
1 parent 94b9a3f commit b3da38a
Showing 1 changed file with 18 additions and 23 deletions.
41 changes: 18 additions & 23 deletions source/vibe/http/client.d
Original file line number Diff line number Diff line change
Expand Up @@ -131,30 +131,25 @@ void requestHTTP(URL url, scope void delegate(scope HTTPClientRequest req) reque
assert(!cli.m_responding, "HTTP client still responding after return!?");
}

static if (__VERSION__ >= 2066) {
// only on Travis-CI, DMD 2.065, causes
//"backend/aa.c:423: void AArray::rehash_x(aaA*, aaA**, size_t): Assertion `0' failed."

/** Posts a simple JSON request. Note that the server www.example.org does not
exists, so there will be no meaningful result.
*/
unittest {
import vibe.core.log;
import vibe.http.client;
import vibe.stream.operations;
/** Posts a simple JSON request. Note that the server www.example.org does not
exists, so there will be no meaningful result.
*/
unittest {
import vibe.core.log;
import vibe.http.client;
import vibe.stream.operations;

void test()
{
requestHTTP("http://www.example.org/",
(scope req) {
req.method = HTTPMethod.POST;
req.writeJsonBody(["name": "My Name"]);
},
(scope res) {
logInfo("Response: %s", res.bodyReader.readAllUTF8());
}
);
}
void test()
{
requestHTTP("http://www.example.org/",
(scope req) {
req.method = HTTPMethod.POST;
//req.writeJsonBody(["name": "My Name"]);
},
(scope res) {
logInfo("Response: %s", res.bodyReader.readAllUTF8());
}
);
}
}

Expand Down

0 comments on commit b3da38a

Please sign in to comment.