Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Improve error message shown when file upload is incomplete.

  • Loading branch information...
commit 62aa07adcf556f7ebc91c9226e9c59324c722ee6 1 parent 41160df
@FooBarWidget FooBarWidget authored
Showing with 16 additions and 2 deletions.
  1. +16 −2 ext/apache2/Hooks.cpp
View
18 ext/apache2/Hooks.cpp
@@ -1105,7 +1105,14 @@ class Hooks {
}
if (contentLength != NULL && ftell(tempFile->handle) != atol(contentLength)) {
- throw IOException("The HTTP client sent incomplete upload data.");
+ string message = "It looks like the browser did not finish the file upload: "
+ "it said it will upload ";
+ message.append(contentLength);
+ message.append(" bytes, but it closed the connection after sending ");
+ message.append(toString(ftell(tempFile->handle)));
+ message.append(" bytes. The user probably clicked Stop in the browser "
+ "or his Internet connection stalled.");
+ throw IOException(message);
}
return tempFile;
}
@@ -1139,7 +1146,14 @@ class Hooks {
}
if (contentLength != NULL && buffer.size() != l_contentLength) {
- throw IOException("The HTTP client sent incomplete upload data.");
+ string message = "It looks like the browser did not finish the file upload: "
+ "it said it will upload ";
+ message.append(contentLength);
+ message.append(" bytes, but it closed the connection after sending ");
+ message.append(toString(buffer.size()));
+ message.append(" bytes. The user probably clicked Stop in the browser "
+ "or his Internet connection stalled.");
+ throw IOException(message);
}
}

0 comments on commit 62aa07a

Please sign in to comment.
Something went wrong with that request. Please try again.