Skip to content

Commit

Permalink
Merge pull request #434 from jcao219/master
Browse files Browse the repository at this point in the history
This should make CurlException error string messages more informative
  • Loading branch information
andralex committed Feb 18, 2012
2 parents bdba8b7 + 8d02b47 commit 44b2f8e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion std/net/curl.d
Expand Up @@ -3339,7 +3339,9 @@ struct Curl

private string errorString(CurlCode code)
{
return format("%s on handle %s", curl_easy_strerror(code), handle);
auto msgZ = curl_easy_strerror(code);
// doing the following (instead of just using std.conv.to!string) avoids 1 allocation
return format("%s on handle %s", cast(string) msgZ[0 .. core.stdc.string.strlen(msgZ)], handle);
}

private void throwOnStopped(string message = null)
Expand Down

0 comments on commit 44b2f8e

Please sign in to comment.