From 7736082ca63e1de7de3c1a62e7c209a43ad03a5a Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 18 Feb 2005 16:52:46 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=5474 --- checkin_notes | 10 ++++++- client/http.C | 17 ++++++++---- client/http.h | 8 +++--- doc/build.php | 7 +++++ doc/build_system.php | 5 ++++ doc/make_project.php | 64 +++++++++++++++++++++++++------------------- 6 files changed, 75 insertions(+), 36 deletions(-) diff --git a/checkin_notes b/checkin_notes index be094bce40..4264ae003a 100755 --- a/checkin_notes +++ b/checkin_notes @@ -23392,7 +23392,7 @@ David 28 Jan 2005 time_stats.C,h David 28 Jan 2005 - - add notion of CONNECTED_STATE; + - core client: add notion of CONNECTED_STATE; can be CONNECTED, NOT_CONNECTED, or UNKNOWN. Implemented get_connected_state() on Windows - if connected state is UNKNOWN, @@ -24999,3 +24999,11 @@ Rom 17 Feb 2005 client/ http.C +David 18 Feb 2005 + - core client HTTP: in a POST operation (i.e. scheduler RPC) + when start to read reply body, + reset bytes_xferred and file_offset to zero + (otherwise length calculation at the end will fail) + + client/ + http.C,h diff --git a/client/http.C b/client/http.C index ece3a879ef..ff4b7e363e 100644 --- a/client/http.C +++ b/client/http.C @@ -385,7 +385,9 @@ int HTTP_OP::init_head(const char* url) { // Initialize HTTP GET operation // -int HTTP_OP::init_get(const char* url, const char* out, bool del_old_file, double off) { +int HTTP_OP::init_get( + const char* url, const char* out, bool del_old_file, double off +) { char proxy_buf[256]; if (del_old_file) { @@ -407,7 +409,9 @@ int HTTP_OP::init_get(const char* url, const char* out, bool del_old_file, doubl sprintf(proxy_buf, "/%s", filename); } if (!pi.use_http_auth) { - http_get_request_header(request_header, url_hostname, port, proxy_buf, (int)file_offset); + http_get_request_header( + request_header, url_hostname, port, proxy_buf, (int)file_offset + ); } else { char id_passwd[512]; string encstr = ""; @@ -779,8 +783,11 @@ bool HTTP_OP_SET::poll(double) { case HTTP_OP_POST: retval = unlink(htp->outfile); // no error check here because file need not already exist - // + + bytes_xferred = 0; + file_offset = 0; // fall through + // case HTTP_OP_GET: htp->http_op_state = HTTP_STATE_REPLY_BODY; @@ -823,9 +830,9 @@ bool HTTP_OP_SET::poll(double) { scope_messages.printf("HTTP_OP_SET::poll(): got reply body\n"); htp->http_op_retval = 0; if (htp->hrh.content_length) { - if ((htp->bytes_xferred-htp->file_offset) != htp->hrh.content_length) { + if ((htp->bytes_xferred - htp->file_offset) != htp->hrh.content_length) { scope_messages.printf( - "HTTP_OP_SET::poll(): ERR_IO: bytes transfred: %d," + "HTTP_OP_SET::poll(): ERR_IO: bytes_xferred: %d," "file offset: %d, expected content length: %d\n", htp->bytes_xferred, htp->file_offset, htp->hrh.content_length ); diff --git a/client/http.h b/client/http.h index d1b98bf246..755e744cd2 100644 --- a/client/http.h +++ b/client/http.h @@ -48,15 +48,17 @@ struct HTTP_REPLY_HEADER { }; #define HTTP_OP_NONE 0 -// For the first 4, data source/sink are files #define HTTP_OP_GET 1 + // data sink is a file (used for file download) #define HTTP_OP_POST 2 + // data source and sink are files (used for scheduler op) #define HTTP_OP_HEAD 4 + // no data (used for file upload) #define HTTP_OP_POST2 5 // a POST operation where the request comes from a combination // of a string and a file w/offset, - // and the reply goes into a memory buffer - // Used exclusively for file upload + // and the reply goes into a memory buffer. + // Used for file upload class HTTP_OP : public PROXY { public: diff --git a/doc/build.php b/doc/build.php index 67c9d807f5..19af61cb49 100644 --- a/doc/build.php +++ b/doc/build.php @@ -163,6 +163,13 @@ or (Redhat) go to System Settings/Add Software. Notes for Debian Linux. +

Apache notes

+

+Make sure httpd.conf sets the default MIME type as follows: +

+DefaultType application/octet-stream
+
+

Windows

diff --git a/doc/build_system.php b/doc/build_system.php index b719cb45ed..5625a0f8e7 100644 --- a/doc/build_system.php +++ b/doc/build_system.php @@ -118,6 +118,11 @@ To make source distributions: gmake dist +

Strict warning

+To compile BOINC with strict compiler warnings, use +
+./configure -CXXFLAGS=\"-Wall -W -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -fno-common -Wnested-externs\"
+
"; page_tail(); ?> diff --git a/doc/make_project.php b/doc/make_project.php index 9f82e14844..8bee3c148b 100644 --- a/doc/make_project.php +++ b/doc/make_project.php @@ -3,17 +3,14 @@ require_once("docutil.php"); page_head("The make_project script"); echo "

-BOINC provides a script for setting up a BOINC project. -This has been tested only on Linux and Solaris hosts; -it may work with small modifications on Windows also. +BOINC provides a script make_project +for creating the server components of a BOINC project. +It has been tested on Linux and Solaris. -

Creating the server

First, install all components listed in the Software Prerequisites page. - -

-Run the make_project script. +Then run the make_project script. For example:

     cd tools/
@@ -23,24 +20,13 @@ creates a project with master URL
 http://<hostname>/cplan/
 whose directory structure is rooted at
 \$HOME/projects/cplan.
-
-    cd tools/
-    ./make_project --base \$HOME/boinc --url_base http://boink/ cplan 'Cunning Plan'
-
-creates a project with master URL -http://boink/cplan/ and long name Cunning Plan, -rooted at \$HOME/boinc/projects/cplan.

-See 'make_project --help' for more command-line options available (such as -finer control of directory structure or clobbering an existing installation). - -

-The script does the following: +More specifically, make_project does the following:

-The PHP scripts need access to the database, -so the user that Apache runs under needs SELECT,INSERT,UPDATE,DELETE -to the database just created. - -

-You should also make sure httpd.conf sets the default MIME type as follows: +The command-line syntax is as follows:

-DefaultType application/octet-stream
+make_project [options] project_name [ 'Project Long Name ' ]
 
+Options are: "; +list_start(); +list_bar("directory options"); +list_item("--project_root", + "Project root directory path. Default: \$HOME/projects/PROJECT_NAME" +); +list_item("--key_dir", "Where keys are stored. Default: PROJECT_ROOT/keys"); +list_item("--url_base", "Determines master URL Default: http://\$NODENAME/"); +list_item("--no_query", "Accept all directories without querying"); +list_item("--delete_prev_inst", "Delete project-root first (from prev installation)"); + +list_bar("URL options"); +list_item("--html_user_url", "User URL. Default: URL_BASE/PROJECT/"); +list_item("--html_ops_url", "Admin URL. Default: URL_BASE/PROJECT_ops/"); +list_item("--cgi_url", "CGI URL. Default: URL_BASE/PROJECT_cgi/"); + +list_bar("database options"); +list_item("--db_host", "Database host. Default: none (this host)"); +list_item("--db_name", "Database name. Default: PROJECT"); +list_item("--db_user", "Database user. Default: this user"); +list_item("--db_passwd", "Database password. Default: None"); +list_item("--drop_db_first", "Drop database first (from prev installation)"); + +list_bar("debugging options"); +list_item("--verbose={0,1,2}", "default: 1"); +list_item("-v", "alias for --verbose=2"); +list_item("-h or --help", "Show options"); + +list_end(); page_tail(); ?>