8157749: Improve handling of DNS error replies

Reviewed-by: chegar, rriggs, coffeys
This commit is contained in:
Mark Sheppard 2016-07-15 20:57:41 +01:00
parent 7d3e084125
commit 6caa8f09c4
2 changed files with 2 additions and 7 deletions

View File

@ -273,13 +273,10 @@ int cmpScopeID (unsigned int scope, struct sockaddr *him) {
#endif
void
NET_ThrowByNameWithLastError(JNIEnv *env, const char *name,
const char *defaultDetail) {
char errmsg[255];
sprintf(errmsg, "errno: %d, error: %s\n", errno, defaultDetail);
JNU_ThrowByNameWithLastError(env, name, errmsg);
JNU_ThrowByNameWithMessageAndLastError(env, name, defaultDetail);
}
void

View File

@ -205,9 +205,7 @@ NET_ThrowCurrent(JNIEnv *env, char *msg)
void
NET_ThrowByNameWithLastError(JNIEnv *env, const char *name,
const char *defaultDetail) {
char errmsg[255];
sprintf(errmsg, "errno: %d, error: %s\n", WSAGetLastError(), defaultDetail);
JNU_ThrowByNameWithLastError(env, name, errmsg);
JNU_ThrowByNameWithMessageAndLastError(env, name, defaultDetail);
}
jfieldID