diff --git a/doc/chapters/largerpost.inc b/doc/chapters/largerpost.inc index dd3f9d6f..07e62470 100644 --- a/doc/chapters/largerpost.inc +++ b/doc/chapters/largerpost.inc @@ -1,7 +1,7 @@ --- NOTE: This does not work flawlessly with the beta release because there is a bug preventing early busy messages from being sent --- -The previous chapter introduced a way to upload data to the server but the developed example program +The previous chapter introduced a way to upload data to the server, but the developed example program has some shortcomings, such as not being able to handle larger chunks of data. In this chapter, we are going to discuss a more advanced server program that allows clients to upload a file in order to have it stored on the server's filesystem. The server shall also watch and limit the number of @@ -11,24 +11,24 @@ clients concurrently uploading, responding with a proper busy message if necessa @heading Prepared answers We choose to operate the server with the @code{SELECT_INTERNALLY} method. This makes it easier to synchronize the global states at the cost of possible delays for other connections if the processing -of a request is to slow. A variable that needs to be shared for all connections is the total number -of clients which are uploading. +of a request is too slow. One of these variables that needs to be shared for all connections is the +total number of clients that are uploading. @verbatim #define MAXCLIENTS 2 -static unsigned char nr_of_uploading_clients = 0; +static unsigned char nr_of_uploading_clients = 0; @end verbatim @noindent If there are too many clients uploading, we want the server to respond to all requests with a busy -message +message. @verbatim const char* busypage = "This server is busy, please try again later."; @end verbatim @noindent -Otherwise, the server will send a form that informs the user of the current number of uploading clients, -and ask her to pick a file on her local filesystem for uploading. +Otherwise, the server will send a @emph{form} that informs the user of the current number of uploading clients, +and ask her to pick a file on her local filesystem which is to be uploaded. @verbatim const char* askpage = "\n\ Upload a file, please!
\n\ @@ -54,9 +54,9 @@ const char* fileexistspage = "This file already exists.answercode = MHD_HTTP_INTERNAL_SERVER_ERROR; @end verbatim @noindent -In the "askpage" form, we told the client to label its post data with the "file" key. Anything else +In the "askpage" @emph{form}, we told the client to label its post data with the "file" key. Anything else would be an error. @verbatim @@ -253,7 +253,7 @@ if (size > 0) @end verbatim @noindent -If this point has been reached, everything worked flawless for this iteration and the response can +If this point has been reached, everything worked well for this iteration and the response can be set to success again. If the upload has finished, this iterator function will not be called again. @verbatim con_info->answerstring = completepage; @@ -299,4 +299,4 @@ This is essentially the whole example @code{largepost.c}. @heading Remarks Now that the clients are able to create files on the server, security aspects are becoming even more important than before. Aside from proper client authentication, the server should always make sure -explicitly that no files will be written outside a dedicated upload directory. +explicitly that no files will be created outside of a dedicated upload directory.