*** empty log message ***

svn path=/trunk/boinc/; revision=5796
This commit is contained in:
David Anderson 2005-04-07 22:32:04 +00:00
parent e87c5debd8
commit 1e199fb916
3 changed files with 23 additions and 1 deletions

View File

@ -26812,3 +26812,15 @@ David 6 April 2005
host_edit_form.php
sched/
handle_request.C
David 6 April 2005
- Core client: deal correctly with HTTP servers that don't support
the Range: option.
Namely: if we issue an HTTP GET request with a Range option,
and the reply header is 200 OK (rather than 206 Partial Content)
then assume the server is sending us the whole file;
reset bytes_xfered and offset to zero,
and open the file in "wb" rather than "ab" mode.
client/
http.C,h

View File

@ -799,7 +799,16 @@ bool HTTP_OP_SET::poll(double) {
case HTTP_OP_GET:
htp->http_op_state = HTTP_STATE_REPLY_BODY;
htp->file = boinc_fopen(htp->outfile, "ab");
// if server doesn't support range request,
// prepare to receive the entire file
//
if (htp->hrh.http_status == HTTP_STATUS_PARTIAL_CONTENT) {
htp->file = boinc_fopen(htp->outfile, "ab");
} else {
htp->file = boinc_fopen(htp->outfile, "wb");
htp->file_offset = 0;
htp->bytes_xferred = 0;
}
if (!htp->file) {
msg_printf(NULL, MSG_ERROR,
"HTTP_OP_SET::poll(): can't open output file %s\n",

View File

@ -28,6 +28,7 @@
// official HTTP status codes
#define HTTP_STATUS_OK 200
#define HTTP_STATUS_PARTIAL_CONTENT 206
#define HTTP_STATUS_RANGE_REQUEST_ERROR 416
#define HTTP_STATUS_MOVED_PERM 301
#define HTTP_STATUS_MOVED_TEMP 302