libmicrohttpd2

HTTP server C library (MHD 2.x, alpha)
Log | Files | Refs | README | LICENSE

commit c8e0a9b1e5bd697fa59dcd995249d50c9730bd82
parent 2924e82e59c26fbe7594d972e5d46f96865d3391
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Wed,  5 Mar 2025 05:37:29 +0100

work on manual

This commit includes minor changes by EG:
+ disabled SUBDIRS in doc/Makefile.am
+ updated configure.ac

Diffstat:
Mconfigure.ac | 3---
Acontrib/mhd2.m4 | 50++++++++++++++++++++++++++++++++++++++++++++++++++
Mdoc/.gitignore | 76++++++++++++----------------------------------------------------------------
Mdoc/Makefile.am | 5+++--
Ddoc/chapters/basicauthentication.inc | 202-------------------------------------------------------------------------------
Ddoc/chapters/bibliography.inc | 32--------------------------------
Ddoc/chapters/exploringrequests.inc | 109-------------------------------------------------------------------------------
Ddoc/chapters/hellobrowser.inc | 222-------------------------------------------------------------------------------
Ddoc/chapters/introduction.inc | 24------------------------
Ddoc/chapters/largerpost.inc | 319-------------------------------------------------------------------------------
Ddoc/chapters/processingpost.inc | 238-------------------------------------------------------------------------------
Ddoc/chapters/responseheaders.inc | 193-------------------------------------------------------------------------------
Ddoc/chapters/sessions.inc | 88-------------------------------------------------------------------------------
Ddoc/chapters/tlsauthentication.inc | 495-------------------------------------------------------------------------------
Ddoc/chapters/websocket.inc | 886-------------------------------------------------------------------------------
Ddoc/examples/.gitignore | 4----
Ddoc/examples/Makefile.am | 34----------------------------------
Adoc/examples/basic-authentication.c | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/examples/external-select.c | 204+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/examples/host-example.c | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/examples/init-example.c | 38++++++++++++++++++++++++++++++++++++++
Adoc/examples/options-example.c | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/examples/sigpipe.c | 37+++++++++++++++++++++++++++++++++++++
Ddoc/libmicrohttpd-tutorial.texi | 193-------------------------------------------------------------------------------
Mdoc/libmicrohttpd.3 | 26+++++++++++++-------------
Ddoc/libmicrohttpd.texi | 4760-------------------------------------------------------------------------------
Adoc/libmicrohttpd2-tutorial.texi | 193+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/libmicrohttpd2.texi | 180+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ddoc/libmicrohttpd_performance_data.eps | 8468-------------------------------------------------------------------------------
Ddoc/libmicrohttpd_performance_data.png | 0
Ddoc/m1.txt | 194-------------------------------------------------------------------------------
Adoc/manual/actions.inc | 419+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/manual/authentication.inc | 877+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/manual/callbacks.inc | 258+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/manual/daemon_options.inc | 1317+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/manual/doptions.inc | 107+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/manual/external.inc | 296+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/manual/http-status-texi.gen | 131+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/manual/init.inc | 385+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/manual/introduction.inc | 377+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/manual/introspection.inc | 605+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/manual/migration.inc | 503+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/manual/postprocessor.inc | 370+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/manual/requests.inc | 654+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/manual/response_options.inc | 282+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/manual/responses.inc | 1236+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/manual/select.inc | 56++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/manual/structs.inc | 137+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adoc/manual/utility.inc | 167+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mdoc/run-gendocs.sh | 0
50 files changed, 9088 insertions(+), 16543 deletions(-)

diff --git a/configure.ac b/configure.ac @@ -7361,9 +7361,6 @@ w32/common/microhttpd_dll_res_vc.rc Makefile contrib/Makefile doc/Makefile -doc/doxygen/libmicrohttpd.doxy -doc/doxygen/Makefile -doc/examples/Makefile m4/Makefile src/Makefile src/incl_priv/Makefile diff --git a/contrib/mhd2.m4 b/contrib/mhd2.m4 @@ -0,0 +1,50 @@ +# mhd2.m4 + +# This file is part of GNU libmicrohttpd +# Copyright (C) 2025 Taler Systems SA +# +# GNU libmicrohttpd is free software; you can redistribute it and/or modify it under the +# terms of the GNU Lesser General Public License as published by the Free Software +# Foundation; either version 3, or (at your option) any later version. +# +# GNU libmicrohttpd is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License along with +# GNU libmicrohttpd; see the file COPYING. If not, If not, see <http://www.gnu.org/license> + +# serial 1 + +dnl MHD2_VERSION_AT_LEAST([VERSION]) +dnl +dnl Check that microhttpd2.h can be used to build a program that prints out +dnl the MHD_VERSION tuple in X.Y.Z format, and that X.Y.Z is greater or equal +dnl to VERSION. If not, display message and cause the configure script to +dnl exit failurefully. +dnl +dnl This uses AX_COMPARE_VERSION to do the job. +dnl It sets shell var mhd_cv_version, as well. +dnl +AC_DEFUN([MHD2_VERSION_AT_LEAST], + [AC_CACHE_CHECK([libmicrohttpd2 version],[mhd2_cv_version], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include <stdio.h> + #include <microhttpd2.h> +]],[[ + int v = MHD_VERSION; + printf ("%x.%x.%x\n", + (v >> 24) & 0xff, + (v >> 16) & 0xff, + (v >> 8) & 0xff); +]])], + [mhd2_cv_version=$(./conftest)], + [mhd2_cv_version=0])]) +AX_COMPARE_VERSION([$mhd2_cv_version],[ge],[$1], + [libmhd2=1], + [libmhd2=0]) +AM_CONDITIONAL([HAVE_MHD2], [test "x$libmhd2" = "x1"]) +AC_DEFINE_UNQUOTED([HAVE_MHD2], [$libmhd2], + [Defined to 1 if libmicrohttpd2 is available]) +]) +# mhd2.m4 ends here diff --git a/doc/.gitignore b/doc/.gitignore @@ -1,64 +1,12 @@ -/libmicrohttpd.vr -/libmicrohttpd.tps -/libmicrohttpd.tp -/libmicrohttpd.toc -/libmicrohttpd.pg -/libmicrohttpd.ky -/libmicrohttpd.fns -/libmicrohttpd.fn -/libmicrohttpd.cps -/libmicrohttpd.cp -/libmicrohttpd.aux -/texinfo.tex -/libmicrohttpd-tutorial.info -/libmicrohttpd.info -/libmicrohttpd.html -/microhttpd-tutorial.vr -/microhttpd-tutorial.tp -/microhttpd-tutorial.toc -/microhttpd-tutorial.pg -/microhttpd-tutorial.pdf -/microhttpd-tutorial.log -/microhttpd-tutorial.ky -/microhttpd-tutorial.info -/microhttpd-tutorial.html -/microhttpd-tutorial.fn -/microhttpd-tutorial.cp -/microhttpd-tutorial.aux -/libmicrohttpd-tutorial.vr -/libmicrohttpd-tutorial.tp -/libmicrohttpd-tutorial.pg -/libmicrohttpd-tutorial.pdf -/libmicrohttpd-tutorial.log -/libmicrohttpd-tutorial.ky -/libmicrohttpd-tutorial.html -/libmicrohttpd-tutorial.fn -/libmicrohttpd-tutorial.cp -/libmicrohttpd-tutorial.cps -/microhttpd.html -/version.texi.orig -/libmicrohttpd-tutorial.toc -/libmicrohttpd-tutorial.aux -/stamp-vti.orig -/microhttpd.info.orig -/microhttpd.vr -/microhttpd.tps -/microhttpd.tp -/microhttpd.toc -/microhttpd.pg -/microhttpd.pdf -/microhttpd.log -/microhttpd.ky -/microhttpd.fns -/microhttpd.fn -/microhttpd.cps -/microhttpd.cp -/microhttpd.aux -/tutorial -/microhttpd -/libmicrohttpdtutorial -/version.texi -/stamp-vti -/microhttpd.info -/mdate-sh -/doxygen +libmicrohttpd2.aux +libmicrohttpd2.cp +libmicrohttpd2.cps +libmicrohttpd2.fn +libmicrohttpd2.fns +libmicrohttpd2.log +libmicrohttpd2.pdf +libmicrohttpd2.toc +libmicrohttpd2.tp +libmicrohttpd2.tps +texput.log +version.texi diff --git a/doc/Makefile.am b/doc/Makefile.am @@ -1,10 +1,11 @@ # This Makefile.am is in the public domain dist_man_MANS = libmicrohttpd.3 -SUBDIRS = . doxygen +SUBDIRS = . +#SUBDIRS += doxygen if BUILD_EXAMPLES -SUBDIRS += examples +#SUBDIRS += examples endif DISTCLEANFILES = \ diff --git a/doc/chapters/basicauthentication.inc b/doc/chapters/basicauthentication.inc @@ -1,202 +0,0 @@ -With the small exception of IP address based access control, -requests from all connecting clients where served equally until now. -This chapter discusses a first method of client's authentication and -its limits. - -A very simple approach feasible with the means already discussed would -be to expect the password in the @emph{URI} string before granting access to -the secured areas. The password could be separated from the actual resource identifier -by a certain character, thus the request line might look like -@verbatim -GET /picture.png?mypassword -@end verbatim -@noindent - -In the rare situation where the client is customized enough and the connection -occurs through secured lines (e.g., a embedded device directly attached to -another via wire) and where the ability to embed a password in the URI or to -pass on a URI with a password are desired, this can be a reasonable choice. - -But when it is assumed that the user connecting does so with an ordinary -Internet browser, this implementation brings some problems about. For example, -the URI including the password stays in the address field or at least in the -history of the browser for anybody near enough to see. It will also be -inconvenient to add the password manually to any new URI when the browser does -not know how to compose this automatically. - -At least the convenience issue can be addressed by employing the simplest -built-in password facilities of HTTP compliant browsers, hence we want to -start there. It will, however, turn out to have still severe weaknesses in -terms of security which need consideration. - -Before we will start implementing @emph{Basic Authentication} as described in -@emph{RFC 2617}, we will also abandon the simplistic and generally -problematic practice of responding every request the first time our callback -is called for a given connection. Queuing a response upon the first request -is akin to generating an error response (even if it is a "200 OK" reply!). -The reason is that MHD usually calls the callback in three phases: - -@enumerate -@item -First, to initially tell the application about the connection and inquire whether -it is OK to proceed. This call typically happens before the client could upload -the request body, and can be used to tell the client to not proceed with the -upload (if the client requested "Expect: 100 Continue"). Applications may queue -a reply at this point, but it will force the connection to be closed and thus -prevent keep-alive / pipelining, which is generally a bad idea. Applications -wanting to proceed with the request throughout the other phases should just return -"MHD_YES" and not queue any response. Note that when an application suspends -a connection in this callback, the phase does not advance and the application -will be called again in this first phase. -@item -Next, to tell the application about upload data provided by the client. -In this phase, the application may not queue replies, and trying to do so -will result in MHD returning an error code from @code{MHD_queue_response}. -If there is no upload data, this phase is skipped. -@item -Finally, to obtain a regular response from the application. This can be -almost any type of response, including ones indicating failures. The -one exception is a "100 Continue" response, which applications must never -generate: MHD generates that response automatically when necessary in the -first phase. If the application does not queue a response, MHD may call -the callback repeatedly (depending a bit on the threading model, the -application should suspend the connection). -@end enumerate - -But how can we tell whether the callback has been called before for the -particular request? Initially, the pointer this parameter references is -set by @emph{MHD} in the callback. But it will also be "remembered" on the -next call (for the same request). Thus, we can use the @code{req_cls} -location to keep track of the request state. For now, we will simply -generate no response until the parameter is non-null---implying the callback -was called before at least once. We do not need to share information between -different calls of the callback, so we can set the parameter to any address -that is assured to be not null. The pointer to the @code{connection} structure -will be pointing to a legal address, so we take this. - -The first time @code{answer_to_connection} is called, we will not even look at the headers. - -@verbatim -static int -answer_to_connection (void *cls, struct MHD_Connection *connection, - const char *url, const char *method, const char *version, - const char *upload_data, size_t *upload_data_size, - void **req_cls) -{ - if (0 != strcmp(method, "GET")) return MHD_NO; - if (NULL == *req_cls) {*req_cls = connection; return MHD_YES;} - - ... - /* else respond accordingly */ - ... -} -@end verbatim -@noindent - -Note how we lop off the connection on the first condition (no "GET" request), -but return asking for more on the other one with @code{MHD_YES}. With this -minor change, we can proceed to implement the actual authentication process. - -@heading Request for authentication - -Let us assume we had only files not intended to be handed out without the -correct username/password, so every "GET" request will be challenged. -@emph{RFC 7617} describes how the server shall ask for authentication by -adding a @emph{WWW-Authenticate} response header with the name of the -@emph{realm} protected. MHD can generate and queue such a failure response -for you using the @code{MHD_queue_basic_auth_fail_response} API. The only -thing you need to do is construct a response with the error page to be shown -to the user if he aborts basic authentication. But first, you should check if -the proper credentials were already supplied using the -@code{MHD_basic_auth_get_username_password} call. - -Your code would then look like this: -@verbatim -static enum MHD_Result -answer_to_connection (void *cls, struct MHD_Connection *connection, - const char *url, const char *method, - const char *version, const char *upload_data, - size_t *upload_data_size, void **req_cls) -{ - struct MHD_BasicAuthInfo *auth_info; - enum MHD_Result ret; - struct MHD_Response *response; - - if (0 != strcmp (method, "GET")) - return MHD_NO; - if (NULL == *req_cls) - { - *req_cls = connection; - return MHD_YES; - } - auth_info = MHD_basic_auth_get_username_password3 (connection); - if (NULL == auth_info) - { - static const char *page = - "<html><body>Authorization required</body></html>"; - response = MHD_create_response_from_buffer_static (strlen (page), page); - ret = MHD_queue_basic_auth_fail_response3 (connection, - "admins", - MHD_YES, - response); - } - else if ((strlen ("root") != auth_info->username_len) || - (0 != memcmp (auth_info->username, "root", - auth_info->username_len)) || - /* The next check against NULL is optional, - * if 'password' is NULL then 'password_len' is always zero. */ - (NULL == auth_info->password) || - (strlen ("pa$$w0rd") != auth_info->password_len) || - (0 != memcmp (auth_info->password, "pa$$w0rd", - auth_info->password_len))) - { - static const char *page = - "<html><body>Wrong username or password</body></html>"; - response = MHD_create_response_from_buffer_static (strlen (page), page); - ret = MHD_queue_basic_auth_fail_response3 (connection, - "admins", - MHD_YES, - response); - } - else - { - static const char *page = "<html><body>A secret.</body></html>"; - response = MHD_create_response_from_buffer_static (strlen (page), page); - ret = MHD_queue_response (connection, MHD_HTTP_OK, response); - } - if (NULL != auth_info) - MHD_free (auth_info); - MHD_destroy_response (response); - return ret; -} -@end verbatim - -See the @code{examples} directory for the complete example file. - -@heading Remarks -For a proper server, the conditional statements leading to a return of @code{MHD_NO} should yield a -response with a more precise status code instead of silently closing the connection. For example, -failures of memory allocation are best reported as @emph{internal server error} and unexpected -authentication methods as @emph{400 bad request}. - -@heading Exercises -@itemize @bullet -@item -Make the server respond to wrong credentials (but otherwise well-formed requests) with the recommended -@emph{401 unauthorized} status code. If the client still does not authenticate correctly within the -same connection, close it and store the client's IP address for a certain time. (It is OK to check for -expiration not until the main thread wakes up again on the next connection.) If the client fails -authenticating three times during this period, add it to another list for which the -@code{AcceptPolicyCallback} function denies connection (temporally). - -@item -With the network utility @code{netcat} connect and log the response of a "GET" request as you -did in the exercise of the first example, this time to a file. Now stop the server and let @emph{netcat} -listen on the same port the server used to listen on and have it fake being the proper server by giving -the file's content as the response (e.g. @code{cat log | nc -l -p 8888}). Pretending to think your were -connecting to the actual server, browse to the eavesdropper and give the correct credentials. - -Copy and paste the encoded string you see in @code{netcat}'s output to some of the Base64 decode tools available online -and see how both the user's name and password could be completely restored. - -@end itemize diff --git a/doc/chapters/bibliography.inc b/doc/chapters/bibliography.inc @@ -1,32 +0,0 @@ -@heading API reference -@itemize @bullet -@item -The @emph{GNU libmicrohttpd} manual by Marco Maggi and Christian Grothoff 2008 -@uref{http://gnunet.org/libmicrohttpd/microhttpd.html} - -@item -All referenced RFCs can be found on the website of @emph{The Internet Engineering Task Force} -@uref{http://www.ietf.org/} - -@item -@emph{RFC 2616}: Fielding, R., Gettys, J., Mogul, J., Frystyk, H., and T. Berners-Lee, -"Hypertext Transfer Protocol -- HTTP/1.1", RFC 2016, January 1997. - -@item -@emph{RFC 2617}: Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., Leach, P., -Luotonen, A., and L. Stewart, "HTTP Authentication: Basic and Digest Access Authentication", RFC 2617, June 1999. - -@item -@emph{RFC 6455}: Fette, I., Melnikov, A., "The WebSocket Protocol", RFC 6455, December 2011. - - -@item -A well--structured @emph{HTML} reference can be found on -@uref{http://www.echoecho.com/html.htm} - -For those readers understanding German or French, there is an excellent document both for learning -@emph{HTML} and for reference, whose English version unfortunately has been discontinued. -@uref{http://de.selfhtml.org/} and @uref{http://fr.selfhtml.org/} - - -@end itemize diff --git a/doc/chapters/exploringrequests.inc b/doc/chapters/exploringrequests.inc @@ -1,109 +0,0 @@ -This chapter will deal with the information which the client sends to the -server at every request. We are going to examine the most useful fields of such an request -and print them out in a readable manner. This could be useful for logging facilities. - -The starting point is the @emph{hellobrowser} program with the former response removed. - -This time, we just want to collect information in the callback function, thus we will -just return MHD_NO after we have probed the request. This way, the connection is closed -without much ado by the server. - -@verbatim -static int -answer_to_connection (void *cls, struct MHD_Connection *connection, - const char *url, - const char *method, const char *version, - const char *upload_data, - size_t *upload_data_size, void **req_cls) -{ - ... - return MHD_NO; -} -@end verbatim -@noindent -The ellipsis marks the position where the following instructions shall be inserted. - - -We begin with the most obvious information available to the server, the request line. You should -already have noted that a request consists of a command (or "HTTP method") and a URI (e.g. a filename). -It also contains a string for the version of the protocol which can be found in @code{version}. -To call it a "new request" is justified because we return only @code{MHD_NO}, thus ensuring the -function will not be called again for this connection. -@verbatim -printf ("New %s request for %s using version %s\n", method, url, version); -@end verbatim -@noindent - -The rest of the information is a bit more hidden. Nevertheless, there is lot of it sent from common -Internet browsers. It is stored in "key-value" pairs and we want to list what we find in the header. -As there is no mandatory set of keys a client has to send, each key-value pair is printed out one by -one until there are no more left. We do this by writing a separate function which will be called for -each pair just like the above function is called for each HTTP request. -It can then print out the content of this pair. -@verbatim -int print_out_key (void *cls, enum MHD_ValueKind kind, - const char *key, const char *value) -{ - printf ("%s: %s\n", key, value); - return MHD_YES; -} -@end verbatim -@noindent - -To start the iteration process that calls our new function for every key, the line -@verbatim -MHD_get_connection_values (connection, MHD_HEADER_KIND, &print_out_key, NULL); -@end verbatim -@noindent -needs to be inserted in the connection callback function too. The second parameter tells the function -that we are only interested in keys from the general HTTP header of the request. Our iterating -function @code{print_out_key} does not rely on any additional information to fulfill its duties -so the last parameter can be NULL. - -All in all, this constitutes the complete @code{logging.c} program for this chapter which can be -found in the @code{examples} section. - -Connecting with any modern Internet browser should yield a handful of keys. You should try to -interpret them with the aid of @emph{RFC 2616}. -Especially worth mentioning is the "Host" key which is often used to serve several different websites -hosted under one single IP address but reachable by different domain names (this is called virtual hosting). - -@heading Conclusion -The introduced capabilities to itemize the content of a simple GET request---especially the -URI---should already allow the server to satisfy clients' requests for small specific resources -(e.g. files) or even induce alteration of server state. However, the latter is not -recommended as the GET method (including its header data) is by convention considered a "safe" -operation, which should not change the server's state in a significant way. By convention, -GET operations can thus be performed by crawlers and other automatic software. Naturally -actions like searching for a passed string are fine. - -Of course, no transmission can occur while the return value is still set to @code{MHD_NO} in the -callback function. - -@heading Exercises -@itemize @bullet -@item -By parsing the @code{url} string and delivering responses accordingly, implement a small server for -"virtual" files. When asked for @code{/index.htm@{l@}}, let the response consist of a HTML page -containing a link to @code{/another.html} page which is also to be created "on the fly" in case of -being requested. If neither of these two pages are requested, @code{MHD_HTTP_NOT_FOUND} shall be -returned accompanied by an informative message. - -@item -A very interesting information has still been ignored by our logger---the client's IP address. -Implement a callback function -@verbatim -static int on_client_connect (void *cls, - const struct sockaddr *addr, - socklen_t addrlen) -@end verbatim -@noindent -that prints out the IP address in an appropriate format. You might want to use the POSIX function -@code{inet_ntoa} but bear in mind that @code{addr} is actually just a structure containing other -substructures and is @emph{not} the variable this function expects. -Make sure to return @code{MHD_YES} so that the library knows the client is allowed to connect -(and to then process the request). If one wanted to limit access basing on IP addresses, this would be the place -to do it. The address of your @code{on_client_connect} function must be passed as the third parameter to the -@code{MHD_start_daemon} call. - -@end itemize diff --git a/doc/chapters/hellobrowser.inc b/doc/chapters/hellobrowser.inc @@ -1,222 +0,0 @@ -The most basic task for a HTTP server is to deliver a static text message to any client connecting to it. -Given that this is also easy to implement, it is an excellent problem to start with. - -For now, the particular URI the client asks for shall have no effect on the message that will -be returned. In addition, the server shall end the connection after the message has been sent so that -the client will know there is nothing more to expect. - -The C program @code{hellobrowser.c}, which is to be found in the examples section, does just that. -If you are very eager, you can compile and start it right away but it is advisable to type the -lines in by yourself as they will be discussed and explained in detail. - -After the necessary includes and the definition of the port which our server should listen on -@verbatim -#include <sys/types.h> -#include <sys/select.h> -#include <sys/socket.h> -#include <microhttpd.h> - -#define PORT 8888 - -@end verbatim - -@noindent -the desired behaviour of our server when HTTP request arrive has to be implemented. We already have -agreed that it should not care about the particular details of the request, such as who is requesting -what. The server will respond merely with the same small HTML page to every request. - -The function we are going to write now will be called by @emph{GNU libmicrohttpd} every time an -appropriate request comes in. While the name of this callback function is arbitrary, its parameter -list has to follow a certain layout. So please, ignore the lot of parameters for now, they will be -explained at the point they are needed. We have to use only one of them, -@code{struct MHD_Connection *connection}, for the minimalistic functionality we want to achieve at the moment. - -This parameter is set by the @emph{libmicrohttpd} daemon and holds the necessary information to -relate the call with a certain connection. Keep in mind that a server might have to satisfy hundreds -of concurrent connections and we have to make sure that the correct data is sent to the destined -client. Therefore, this variable is a means to refer to a particular connection if we ask the -daemon to sent the reply. - -Talking about the reply, it is defined as a string right after the function header -@verbatim -int answer_to_connection (void *cls, struct MHD_Connection *connection, - const char *url, - const char *method, const char *version, - const char *upload_data, - size_t *upload_data_size, void **req_cls) -{ - const char *page = "<html><body>Hello, browser!</body></html>"; - -@end verbatim - -@noindent -HTTP is a rather strict protocol and the client would certainly consider it "inappropriate" if we -just sent the answer string "as is". Instead, it has to be wrapped with additional information stored in so-called headers and footers. Most of the work in this area is done by the library for us---we -just have to ask. Our reply string packed in the necessary layers will be called a "response". -To obtain such a response we hand our data (the reply--string) and its size over to the -@code{MHD_create_response_from_buffer} function. The last two parameters basically tell @emph{MHD} -that we do not want it to dispose the message data for us when it has been sent and there also needs -no internal copy to be done because the @emph{constant} string won't change anyway. - -@verbatim - struct MHD_Response *response; - int ret; - - response = MHD_create_response_from_buffer (strlen (page), - (void*) page, MHD_RESPMEM_PERSISTENT); - -@end verbatim - -@noindent -Now that the the response has been laced up, it is ready for delivery and can be queued for sending. -This is done by passing it to another @emph{GNU libmicrohttpd} function. As all our work was done in -the scope of one function, the recipient is without doubt the one associated with the -local variable @code{connection} and consequently this variable is given to the queue function. -Every HTTP response is accompanied by a status code, here "OK", so that the client knows -this response is the intended result of his request and not due to some error or malfunction. - -Finally, the packet is destroyed and the return value from the queue returned, -already being set at this point to either MHD_YES or MHD_NO in case of success or failure. - -@verbatim - ret = MHD_queue_response (connection, MHD_HTTP_OK, response); - MHD_destroy_response (response); - - return ret; -} - -@end verbatim - -@noindent -With the primary task of our server implemented, we can start the actual server daemon which will listen -on @code{PORT} for connections. This is done in the main function. -@verbatim -int main () -{ - struct MHD_Daemon *daemon; - - daemon = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD, PORT, NULL, NULL, - &answer_to_connection, NULL, MHD_OPTION_END); - if (NULL == daemon) return 1; - -@end verbatim - -@noindent -The first parameter is one of three possible modes of operation. Here we want the daemon to run in -a separate thread and to manage all incoming connections in the same thread. This means that while -producing the response for one connection, the other connections will be put on hold. In this -example, where the reply is already known and therefore the request is served quickly, this poses no problem. - -We will allow all clients to connect regardless of their name or location, therefore we do not check -them on connection and set the third and fourth parameter to NULL. - -Parameter five is the address of the function we want to be called whenever a new connection has been -established. Our @code{answer_to_connection} knows best what the client wants and needs no additional -information (which could be passed via the next parameter) so the next (sixth) parameter is NULL. Likewise, -we do not need to pass extra options to the daemon so we just write the MHD_OPTION_END as the last parameter. - -As the server daemon runs in the background in its own thread, the execution flow in our main -function will continue right after the call. Because of this, we must delay the execution flow in the -main thread or else the program will terminate prematurely. We let it pause in a processing-time -friendly manner by waiting for the enter key to be pressed. In the end, we stop the daemon so it can -do its cleanup tasks. -@verbatim - getchar (); - - MHD_stop_daemon (daemon); - return 0; -} - -@end verbatim - -@noindent -The first example is now complete. - -Compile it with -@verbatim -cc hellobrowser.c -o hellobrowser -I$PATH_TO_LIBMHD_INCLUDES - -L$PATH_TO_LIBMHD_LIBS -lmicrohttpd -@end verbatim -with the two paths set accordingly and run it. - -Now open your favorite Internet browser and go to the address @code{http://localhost:8888/}, provided that 8888 -is the port you chose. If everything works as expected, the browser will present the message of the -static HTML page it got from our minimal server. - -@heading Remarks -To keep this first example as small as possible, some drastic shortcuts were taken and are to be -discussed now. - -Firstly, there is no distinction made between the kinds of requests a client could send. We implied -that the client sends a GET request, that means, that he actually asked for some data. Even when -it is not intended to accept POST requests, a good server should at least recognize that this -request does not constitute a legal request and answer with an error code. This can be easily -implemented by checking if the parameter @code{method} equals the string "GET" and returning a -@code{MHD_NO} if not so. - -Secondly, the above practice of queuing a response upon the first call of the callback function -brings with it some limitations. This is because the content of the message body will not be -received if a response is queued in the first iteration. Furthermore, the connection will be closed -right after the response has been transferred then. This is typically not what you want as it -disables HTTP pipelining. The correct approach is to simply not queue a message on the first -callback unless there is an error. The @code{void**} argument to the callback provides a location -for storing information about the history of the connection; for the first call, the pointer -will point to NULL. A simplistic way to differentiate the first call from others is to check -if the pointer is NULL and set it to a non-NULL value during the first call. - -Both of these issues you will find addressed in the official @code{minimal_example.c} residing in -the @code{src/examples} directory of the @emph{MHD} package. The source code of this -program should look very familiar to you by now and easy to understand. - -For our example, we create the response from a static (persistent) buffer in memory and thus pass @code{MHD_RESPMEM_PERSISTENT} to the response construction -function. In the usual case, responses are not transmitted immediately -after being queued. For example, there might be other data on the system that needs to be sent with -a higher priority. Nevertheless, the queue function will return successfully---raising the problem -that the data we have pointed to may be invalid by the time it is about being sent. This is not an -issue here because we can expect the @code{page} string, which is a constant @emph{string literal} -here, to be static. That means it will be present and unchanged for as long as the program runs. -For dynamic data, one could choose to either have @emph{MHD} free the memory @code{page} points -to itself when it is not longer needed (by passing @code{MHD_RESPMEM_MUST_FREE}) or, alternatively, have the library to make and manage -its own copy of it (by passing @code{MHD_RESPMEM_MUST_COPY}). Naturally, this last option is the most expensive. - -@heading Exercises -@itemize @bullet -@item -While the server is running, use a program like @code{telnet} or @code{netcat} to connect to it. Try to form a -valid HTTP 1.1 request yourself like -@verbatim -GET /dontcare HTTP/1.1 -Host: itsme -<enter> -@end verbatim -@noindent -and see what the server returns to you. - - -@item -Also, try other requests, like POST, and see how our server does not mind and why. -How far in malforming a request can you go before the builtin functionality of @emph{MHD} intervenes -and an altered response is sent? Make sure you read about the status codes in the @emph{RFC}. - - -@item -Add the option @code{MHD_USE_PEDANTIC_CHECKS} to the start function of the daemon in @code{main}. -Mind the special format of the parameter list here which is described in the manual. How indulgent -is the server now to your input? - - -@item -Let the main function take a string as the first command line argument and pass @code{argv[1]} to -the @code{MHD_start_daemon} function as the sixth parameter. The address of this string will be -passed to the callback function via the @code{cls} variable. Decorate the text given at the command -line when the server is started with proper HTML tags and send it as the response instead of the -former static string. - - -@item -@emph{Demanding:} Write a separate function returning a string containing some useful information, -for example, the time. Pass the function's address as the sixth parameter and evaluate this function -on every request anew in @code{answer_to_connection}. Remember to free the memory of the string -every time after satisfying the request. - -@end itemize diff --git a/doc/chapters/introduction.inc b/doc/chapters/introduction.inc @@ -1,23 +0,0 @@ -This tutorial is for developers who want to learn how they can add HTTP serving -capabilities to their applications with the @emph{GNU libmicrohttpd} library, -abbreviated @emph{MHD}. The reader will learn how to -implement basic HTTP functions from simple executable -sample programs that implement various features. - -The text is supposed to be a supplement to the API reference manual of -@emph{GNU libmicrohttpd} and for that reason does not explain many of the parameters. -Therefore, the reader should always consult the manual to find the exact meaning -of the functions used in the tutorial. Furthermore, the reader is -encouraged to study the relevant @emph{RFCs}, which document the HTTP standard. - -@emph{GNU libmicrohttpd} is assumed to be already installed. This tutorial -is written for version @value{VERSION}. At the time being, -this tutorial has only been tested on @emph{GNU/Linux} machines even though -efforts were made not to rely on anything that would prevent the samples from being -built on similar systems. - -@section History - -This tutorial was originally written by Sebastian Gerhardt for MHD -0.4.0. It was slightly polished and updated to MHD 0.9.0 by Christian -Grothoff. -\ No newline at end of file diff --git a/doc/chapters/largerpost.inc b/doc/chapters/largerpost.inc @@ -1,319 +0,0 @@ -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 -clients concurrently uploading, responding with a proper busy message if necessary. - - -@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 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 int 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. -@verbatim -const char* busypage = - "<html><body>This server is busy, please try again later.</body></html>"; -@end verbatim -@noindent - -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 = "<html><body>\n\ - Upload a file, please!<br>\n\ - There are %u clients uploading at the moment.<br>\n\ - <form action=\"/filepost\" method=\"post\" \ - enctype=\"multipart/form-data\">\n\ - <input name=\"file\" type=\"file\">\n\ - <input type=\"submit\" value=\" Send \"></form>\n\ - </body></html>"; -@end verbatim -@noindent - -If the upload has succeeded, the server will respond with a message saying so. -@verbatim -const char* completepage = "<html><body>The upload has been completed.</body></html>"; -@end verbatim -@noindent - -We want the server to report internal errors, such as memory shortage or file access problems, -adequately. -@verbatim -const char* servererrorpage - = "<html><body>An internal server error has occurred.</body></html>"; -const char* fileexistspage - = "<html><body>This file already exists.</body></html>"; -@end verbatim -@noindent - -It would be tolerable to send all these responses undifferentiated with a @code{200 HTTP_OK} -status code but in order to improve the @code{HTTP} conformance of our server a bit, we extend the -@code{send_page} function so that it accepts individual status codes. - -@verbatim -static int -send_page (struct MHD_Connection *connection, - const char* page, int status_code) -{ - int ret; - struct MHD_Response *response; - - response = MHD_create_response_from_buffer (strlen (page), (void*) page, - MHD_RESPMEM_MUST_COPY); - if (!response) return MHD_NO; - - ret = MHD_queue_response (connection, status_code, response); - MHD_destroy_response (response); - - return ret; -} -@end verbatim -@noindent - -Note how we ask @emph{MHD} to make its own copy of the message data. The reason behind this will -become clear later. - - -@heading Connection cycle -The decision whether the server is busy or not is made right at the beginning of the connection. To -do that at this stage is especially important for @emph{POST} requests because if no response is -queued at this point, and @code{MHD_YES} returned, @emph{MHD} will not sent any queued messages until -a postprocessor has been created and the post iterator is called at least once. - -@verbatim -static int -answer_to_connection (void *cls, struct MHD_Connection *connection, - const char *url, - const char *method, const char *version, - const char *upload_data, - size_t *upload_data_size, void **req_cls) -{ - if (NULL == *req_cls) - { - struct connection_info_struct *con_info; - - if (nr_of_uploading_clients >= MAXCLIENTS) - return send_page(connection, busypage, MHD_HTTP_SERVICE_UNAVAILABLE); -@end verbatim -@noindent - -If the server is not busy, the @code{connection_info} structure is initialized as usual, with -the addition of a filepointer for each connection. - -@verbatim - con_info = malloc (sizeof (struct connection_info_struct)); - if (NULL == con_info) return MHD_NO; - con_info->fp = 0; - - if (0 == strcmp (method, "POST")) - { - ... - } - else con_info->connectiontype = GET; - - *req_cls = (void*) con_info; - - return MHD_YES; - } -@end verbatim -@noindent - -For @emph{POST} requests, the postprocessor is created and we register a new uploading client. From -this point on, there are many possible places for errors to occur that make it necessary to interrupt -the uploading process. We need a means of having the proper response message ready at all times. -Therefore, the @code{connection_info} structure is extended to hold the most current response -message so that whenever a response is sent, the client will get the most informative message. Here, -the structure is initialized to "no error". -@verbatim - if (0 == strcmp (method, "POST")) - { - con_info->postprocessor - = MHD_create_post_processor (connection, POSTBUFFERSIZE, - iterate_post, (void*) con_info); - - if (NULL == con_info->postprocessor) - { - free (con_info); - return MHD_NO; - } - - nr_of_uploading_clients++; - - con_info->connectiontype = POST; - con_info->answercode = MHD_HTTP_OK; - con_info->answerstring = completepage; - } - else con_info->connectiontype = GET; -@end verbatim -@noindent - -If the connection handler is called for the second time, @emph{GET} requests will be answered with -the @emph{form}. We can keep the buffer under function scope, because we asked @emph{MHD} to make its -own copy of it for as long as it is needed. -@verbatim - if (0 == strcmp (method, "GET")) - { - int ret; - char buffer[1024]; - - sprintf (buffer, askpage, nr_of_uploading_clients); - return send_page (connection, buffer, MHD_HTTP_OK); - } -@end verbatim -@noindent - - -The rest of the @code{answer_to_connection} function is very similar to the @code{simplepost.c} -example, except the more flexible content of the responses. The @emph{POST} data is processed until -there is none left and the execution falls through to return an error page if the connection -constituted no expected request method. -@verbatim - if (0 == strcmp (method, "POST")) - { - struct connection_info_struct *con_info = *req_cls; - - if (0 != *upload_data_size) - { - MHD_post_process (con_info->postprocessor, - upload_data, *upload_data_size); - *upload_data_size = 0; - - return MHD_YES; - } - else - return send_page (connection, con_info->answerstring, - con_info->answercode); - } - - return send_page(connection, errorpage, MHD_HTTP_BAD_REQUEST); -} -@end verbatim -@noindent - - -@heading Storing to data -Unlike the @code{simplepost.c} example, here it is to be expected that post iterator will be called -several times now. This means that for any given connection (there might be several concurrent of them) -the posted data has to be written to the correct file. That is why we store a file handle in every -@code{connection_info}, so that the it is preserved between successive iterations. -@verbatim -static int -iterate_post (void *coninfo_cls, enum MHD_ValueKind kind, - const char *key, - const char *filename, const char *content_type, - const char *transfer_encoding, const char *data, - uint64_t off, size_t size) -{ - struct connection_info_struct *con_info = coninfo_cls; -@end verbatim -@noindent - -Because the following actions depend heavily on correct file processing, which might be error prone, -we default to reporting internal errors in case anything will go wrong. - -@verbatim -con_info->answerstring = servererrorpage; -con_info->answercode = MHD_HTTP_INTERNAL_SERVER_ERROR; -@end verbatim -@noindent - -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 - if (0 != strcmp (key, "file")) return MHD_NO; -@end verbatim -@noindent - -If the iterator is called for the first time, no file will have been opened yet. The @code{filename} -string contains the name of the file (without any paths) the user selected on his system. We want to -take this as the name the file will be stored on the server and make sure no file of that name exists -(or is being uploaded) before we create one (note that the code below technically contains a -race between the two "fopen" calls, but we will overlook this for portability sake). -@verbatim - if (!con_info->fp) - { - if (NULL != (fp = fopen (filename, "rb")) ) - { - fclose (fp); - con_info->answerstring = fileexistspage; - con_info->answercode = MHD_HTTP_FORBIDDEN; - return MHD_NO; - } - - con_info->fp = fopen (filename, "ab"); - if (!con_info->fp) return MHD_NO; - } -@end verbatim -@noindent - - -Occasionally, the iterator function will be called even when there are 0 new bytes to process. The -server only needs to write data to the file if there is some. -@verbatim -if (size > 0) - { - if (!fwrite (data, size, sizeof(char), con_info->fp)) - return MHD_NO; - } -@end verbatim -@noindent - -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; - con_info->answercode = MHD_HTTP_OK; - - return MHD_YES; -} -@end verbatim -@noindent - - -The new client was registered when the postprocessor was created. Likewise, we unregister the client -on destroying the postprocessor when the request is completed. -@verbatim -void request_completed (void *cls, struct MHD_Connection *connection, - void **req_cls, - enum MHD_RequestTerminationCode toe) -{ - struct connection_info_struct *con_info = *req_cls; - - if (NULL == con_info) return; - - if (con_info->connectiontype == POST) - { - if (NULL != con_info->postprocessor) - { - MHD_destroy_post_processor (con_info->postprocessor); - nr_of_uploading_clients--; - } - - if (con_info->fp) fclose (con_info->fp); - } - - free (con_info); - *req_cls = NULL; -} -@end verbatim -@noindent - - -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 created outside of a dedicated upload directory. In particular, -filenames must be checked to not contain strings like "../". diff --git a/doc/chapters/processingpost.inc b/doc/chapters/processingpost.inc @@ -1,238 +0,0 @@ -The previous chapters already have demonstrated a variety of possibilities to send information -to the HTTP server, but it is not recommended that the @emph{GET} method is used to alter the way -the server operates. To induce changes on the server, the @emph{POST} method is preferred over -and is much more powerful than @emph{GET} and will be introduced in this chapter. - -We are going to write an application that asks for the visitor's name and, after the user has posted it, -composes an individual response text. Even though it was not mandatory to use the @emph{POST} method here, -as there is no permanent change caused by the POST, it is an illustrative example on how to share data -between different functions for the same connection. Furthermore, the reader should be able to extend -it easily. - -@heading GET request -When the first @emph{GET} request arrives, the server shall respond with a HTML page containing an -edit field for the name. - -@verbatim -const char* askpage = "<html><body>\ - What's your name, Sir?<br>\ - <form action=\"/namepost\" method=\"post\">\ - <input name=\"name\" type=\"text\"\ - <input type=\"submit\" value=\" Send \"></form>\ - </body></html>"; -@end verbatim -@noindent - -The @code{action} entry is the @emph{URI} to be called by the browser when posting, and the -@code{name} will be used later to be sure it is the editbox's content that has been posted. - -We also prepare the answer page, where the name is to be filled in later, and an error page -as the response for anything but proper @emph{GET} and @emph{POST} requests: - -@verbatim -const char* greatingpage="<html><body><h1>Welcome, %s!</center></h1></body></html>"; - -const char* errorpage="<html><body>This doesn't seem to be right.</body></html>"; -@end verbatim -@noindent - -Whenever we need to send a page, we use an extra function -@code{int send_page(struct MHD_Connection *connection, const char* page)} -for this, which does not contain anything new and whose implementation is therefore -not discussed further in the tutorial. - - -@heading POST request -Posted data can be of arbitrary and considerable size; for example, if a user uploads a big -image to the server. Similar to the case of the header fields, there may also be different streams -of posted data, such as one containing the text of an editbox and another the state of a button. -Likewise, we will have to register an iterator function that is going to be called maybe several times -not only if there are different POSTs but also if one POST has only been received partly yet and -needs processing before another chunk can be received. - -Such an iterator function is called by a @emph{postprocessor}, which must be created upon arriving -of the post request. We want the iterator function to read the first post data which is tagged -@code{name} and to create an individual greeting string based on the template and the name. -But in order to pass this string to other functions and still be able to differentiate different -connections, we must first define a structure to share the information, holding the most import entries. - -@verbatim -struct connection_info_struct -{ - int connectiontype; - char *answerstring; - struct MHD_PostProcessor *postprocessor; -}; -@end verbatim -@noindent - -With these information available to the iterator function, it is able to fulfill its task. -Once it has composed the greeting string, it returns @code{MHD_NO} to inform the post processor -that it does not need to be called again. Note that this function does not handle processing -of data for the same @code{key}. If we were to expect that the name will be posted in several -chunks, we had to expand the namestring dynamically as additional parts of it with the same @code{key} -came in. But in this example, the name is assumed to fit entirely inside one single packet. - -@verbatim -static int -iterate_post (void *coninfo_cls, enum MHD_ValueKind kind, const char *key, - const char *filename, const char *content_type, - const char *transfer_encoding, const char *data, - uint64_t off, size_t size) -{ - struct connection_info_struct *con_info = coninfo_cls; - - if (0 == strcmp (key, "name")) - { - if ((size > 0) && (size <= MAXNAMESIZE)) - { - char *answerstring; - answerstring = malloc (MAXANSWERSIZE); - if (!answerstring) return MHD_NO; - - snprintf (answerstring, MAXANSWERSIZE, greatingpage, data); - con_info->answerstring = answerstring; - } - else con_info->answerstring = NULL; - - return MHD_NO; - } - - return MHD_YES; -} -@end verbatim -@noindent - -Once a connection has been established, it can be terminated for many reasons. As these -reasons include unexpected events, we have to register another function that cleans up any resources -that might have been allocated for that connection by us, namely the post processor and the greetings -string. This cleanup function must take into account that it will also be called for finished -requests other than @emph{POST} requests. - -@verbatim -void request_completed (void *cls, struct MHD_Connection *connection, - void **req_cls, - enum MHD_RequestTerminationCode toe) -{ - struct connection_info_struct *con_info = *req_cls; - - if (NULL == con_info) return; - if (con_info->connectiontype == POST) - { - MHD_destroy_post_processor (con_info->postprocessor); - if (con_info->answerstring) free (con_info->answerstring); - } - - free (con_info); - *req_cls = NULL; -} -@end verbatim -@noindent - -@emph{GNU libmicrohttpd} is informed that it shall call the above function when the daemon is started -in the main function. - -@verbatim -... -daemon = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD, PORT, NULL, NULL, - &answer_to_connection, NULL, - MHD_OPTION_NOTIFY_COMPLETED, &request_completed, NULL, - MHD_OPTION_END); -... -@end verbatim -@noindent - -@heading Request handling -With all other functions prepared, we can now discuss the actual request handling. - -On the first iteration for a new request, we start by allocating a new instance of a -@code{struct connection_info_struct} structure, which will store all necessary information for later -iterations and other functions. - -@verbatim -static int -answer_to_connection (void *cls, struct MHD_Connection *connection, - const char *url, - const char *method, const char *version, - const char *upload_data, - size_t *upload_data_size, void **req_cls) -{ - if(NULL == *req_cls) - { - struct connection_info_struct *con_info; - - con_info = malloc (sizeof (struct connection_info_struct)); - if (NULL == con_info) return MHD_NO; - con_info->answerstring = NULL; -@end verbatim -@noindent - -If the new request is a @emph{POST}, the postprocessor must be created now. In addition, the type -of the request is stored for convenience. -@verbatim - if (0 == strcmp (method, "POST")) - { - con_info->postprocessor - = MHD_create_post_processor (connection, POSTBUFFERSIZE, - iterate_post, (void*) con_info); - - if (NULL == con_info->postprocessor) - { - free (con_info); - return MHD_NO; - } - con_info->connectiontype = POST; - } - else con_info->connectiontype = GET; -@end verbatim -@noindent - -The address of our structure will both serve as the indicator for successive iterations and to remember -the particular details about the connection. -@verbatim - *req_cls = (void*) con_info; - return MHD_YES; - } -@end verbatim -@noindent - -The rest of the function will not be executed on the first iteration. A @emph{GET} request is easily -satisfied by sending the question form. -@verbatim - if (0 == strcmp (method, "GET")) - { - return send_page (connection, askpage); - } -@end verbatim -@noindent - -In case of @emph{POST}, we invoke the post processor for as long as data keeps incoming, setting -@code{*upload_data_size} to zero in order to indicate that we have processed---or at least have -considered---all of it. -@verbatim - if (0 == strcmp (method, "POST")) - { - struct connection_info_struct *con_info = *req_cls; - - if (*upload_data_size != 0) - { - MHD_post_process (con_info->postprocessor, upload_data, - *upload_data_size); - *upload_data_size = 0; - - return MHD_YES; - } - else if (NULL != con_info->answerstring) - return send_page (connection, con_info->answerstring); - } -@end verbatim -@noindent - -Finally, if they are neither @emph{GET} nor @emph{POST} requests, the error page is returned. -@verbatim - return send_page(connection, errorpage); -} -@end verbatim -@noindent - -These were the important parts of the program @code{simplepost.c}. diff --git a/doc/chapters/responseheaders.inc b/doc/chapters/responseheaders.inc @@ -1,193 +0,0 @@ -Now that we are able to inspect the incoming request in great detail, -this chapter discusses the means to enrich the outgoing responses likewise. - -As you have learned in the @emph{Hello, Browser} chapter, some obligatory -header fields are added and set automatically for simple responses by the library -itself but if more advanced features are desired, additional fields have to be created. -One of the possible fields is the content type field and an example will be developed around it. -This will lead to an application capable of correctly serving different types of files. - - -When we responded with HTML page packed in the static string previously, the client had no choice -but guessing about how to handle the response, because the server had not told him. -What if we had sent a picture or a sound file? Would the message have been understood -or merely been displayed as an endless stream of random characters in the browser? -This is what the mime content types are for. The header of the response is extended -by certain information about how the data is to be interpreted. - -To introduce the concept, a picture of the format @emph{PNG} will be sent to the client -and labeled accordingly with @code{image/png}. -Once again, we can base the new example on the @code{hellobrowser} program. - -@verbatim -#define FILENAME "picture.png" -#define MIMETYPE "image/png" - -static int -answer_to_connection (void *cls, struct MHD_Connection *connection, - const char *url, - const char *method, const char *version, - const char *upload_data, - size_t *upload_data_size, void **req_cls) -{ - unsigned char *buffer = NULL; - struct MHD_Response *response; -@end verbatim -@noindent - -We want the program to open the file for reading and determine its size: -@verbatim - int fd; - int ret; - struct stat sbuf; - - if (0 != strcmp (method, "GET")) - return MHD_NO; - if ( (-1 == (fd = open (FILENAME, O_RDONLY))) || - (0 != fstat (fd, &sbuf)) ) - { - /* error accessing file */ - /* ... (see below) */ - } - /* ... (see below) */ -@end verbatim -@noindent - -When dealing with files, there is a lot that could go wrong on the -server side and if so, the client should be informed with @code{MHD_HTTP_INTERNAL_SERVER_ERROR}. - -@verbatim - /* error accessing file */ - if (fd != -1) close (fd); - const char *errorstr = - "<html><body>An internal server error has occurred!\ - </body></html>"; - response = - MHD_create_response_from_buffer (strlen (errorstr), - (void *) errorstr, - MHD_RESPMEM_PERSISTENT); - if (response) - { - ret = - MHD_queue_response (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, - response); - MHD_destroy_response (response); - - return MHD_YES; - } - else - return MHD_NO; - if (!ret) - { - const char *errorstr = "<html><body>An internal server error has occurred!\ - </body></html>"; - - if (buffer) free(buffer); - - response = MHD_create_response_from_buffer (strlen(errorstr), (void*) errorstr, - MHD_RESPMEM_PERSISTENT); - - if (response) - { - ret = MHD_queue_response (connection, - MHD_HTTP_INTERNAL_SERVER_ERROR, - response); - MHD_destroy_response (response); - - return MHD_YES; - } - else return MHD_NO; - } -@end verbatim -@noindent - -Note that we nevertheless have to create a response object even for sending a simple error code. -Otherwise, the connection would just be closed without comment, leaving the client curious about -what has happened. - -But in the case of success a response will be constructed directly from the file descriptor: - -@verbatim - /* error accessing file */ - /* ... (see above) */ - } - - response = - MHD_create_response_from_fd_at_offset (sbuf.st_size, fd, 0); - MHD_add_response_header (response, "Content-Type", MIMETYPE); - ret = MHD_queue_response (connection, MHD_HTTP_OK, response); - MHD_destroy_response (response); -@end verbatim -@noindent - -Note that the response object will take care of closing the file descriptor for us. - -Up to this point, there was little new. The actual novelty is that we enhance the header with the -meta data about the content. Aware of the field's name we want to add, it is as easy as that: -@verbatim -MHD_add_response_header(response, "Content-Type", MIMETYPE); -@end verbatim -@noindent -We do not have to append a colon expected by the protocol behind the first -field---@emph{GNU libhttpdmicro} will take care of this. - -The function finishes with the well-known lines -@verbatim - ret = MHD_queue_response (connection, MHD_HTTP_OK, response); - MHD_destroy_response (response); - return ret; -} -@end verbatim -@noindent - -The complete program @code{responseheaders.c} is in the @code{examples} section as usual. -Find a @emph{PNG} file you like and save it to the directory the example is run from under the name -@code{picture.png}. You should find the image displayed on your browser if everything worked well. - -@heading Remarks -The include file of the @emph{MHD} library comes with the header types mentioned in @emph{RFC 2616} -already defined as macros. Thus, we could have written @code{MHD_HTTP_HEADER_CONTENT_TYPE} instead -of @code{"Content-Type"} as well. However, one is not limited to these standard headers and could -add custom response headers without violating the protocol. Whether, and how, the client would react -to these custom header is up to the receiver. Likewise, the client is allowed to send custom request -headers to the server as well, opening up yet more possibilities how client and server could -communicate with each other. - -The method of creating the response from a file on disk only works for static content. -Serving dynamically created responses will be a topic of a future chapter. - -@heading Exercises -@itemize @bullet - -@item -Remember that the original program was written under a few assumptions---a static response -using a local file being one of them. In order to simulate a very large or hard to reach file that cannot be provided -instantly, postpone the queuing in the callback with the @code{sleep} function for 30 seconds -@emph{if} the file @code{/big.png} is requested (but deliver the same as above). A request for -@code{/picture.png} should provide just the same but without any artificial delays. - -Now start two instances of your browser (or even use two machines) and see how the second client -is put on hold while the first waits for his request on the slow file to be fulfilled. - -Finally, change the sourcecode to use @code{MHD_USE_THREAD_PER_CONNECTION} when the daemon is -started and try again. - - -@item -Did you succeed in implementing the clock exercise yet? This time, let the server save the -program's start time @code{t} and implement a response simulating a countdown that reaches 0 at -@code{t+60}. Returning a message saying on which point the countdown is, the response should -ultimately be to reply "Done" if the program has been running long enough, - -An unofficial, but widely understood, response header line is @code{Refresh: DELAY; url=URL} with -the uppercase words substituted to tell the client it should request the given resource after -the given delay again. Improve your program in that the browser (any modern browser should work) -automatically reconnects and asks for the status again every 5 seconds or so. The URL would have -to be composed so that it begins with "http://", followed by the @emph{URI} the server is reachable -from the client's point of view. - -Maybe you want also to visualize the countdown as a status bar by creating a -@code{<table>} consisting of one row and @code{n} columns whose fields contain small images of either -a red or a green light. - -@end itemize diff --git a/doc/chapters/sessions.inc b/doc/chapters/sessions.inc @@ -1,88 +0,0 @@ -This chapter discusses how one should manage sessions, that is, share state between multiple -HTTP requests from the same user. We use a simple example where the user submits multiple -forms and the server is supposed to accumulate state from all of these forms. Naturally, as -this is a network protocol, our session mechanism must support having many users with -many concurrent sessions at the same time. - -In order to track users, we use a simple session cookie. A session cookie expires when the -user closes the browser. Changing from session cookies to persistent cookies only requires -adding an expiration time to the cookie. The server creates a fresh session cookie whenever -a request without a cookie is received, or if the supplied session cookie is not known to -the server. - -@heading Looking up the cookie - -Since MHD parses the HTTP cookie header for us, looking up an existing cookie -is straightforward: - -@verbatim -const char *value; - -value = MHD_lookup_connection_value (connection, - MHD_COOKIE_KIND, - "KEY"); -@end verbatim - -Here, "KEY" is the name we chose for our session cookie. - - -@heading Setting the cookie header - -MHD requires the user to provide the full cookie format string in order to set -cookies. In order to generate a unique cookie, our example creates a random -64-character text string to be used as the value of the cookie: - -@verbatim -char value[128]; -char raw_value[65]; - -for (unsigned int i=0;i<sizeof (raw_value);i++) - raw_value = 'A' + (rand () % 26); /* bad PRNG! */ -raw_value[64] = '\0'; -snprintf (value, sizeof (value), - "%s=%s", - "KEY", - raw_value); -@end verbatim - -Given this cookie value, we can then set the cookie header in our HTTP response -as follows: - -@verbatim -assert (MHD_YES == - MHD_set_connection_value (connection, - MHD_HEADER_KIND, - MHD_HTTP_HEADER_SET_COOKIE, - value)); -@end verbatim - - -@heading Remark: Session expiration - -It is of course possible that clients stop their interaction with the -server at any time. In order to avoid using too much storage, the -server must thus discard inactive sessions at some point. Our example -implements this by discarding inactive sessions after a certain amount -of time. Alternatively, the implementation may limit the total number -of active sessions. Which bounds are used for idle sessions or the -total number of sessions obviously depends largely on the type of -the application and available server resources. - -@heading Example code - -A sample application implementing a website with multiple -forms (which are dynamically created using values from previous -POST requests from the same session) is available -as the example @code{sessions.c}. - -Note that the example uses a simple, $O(n)$ linked list traversal to -look up sessions and to expire old sessions. Using a hash table and a -heap would be more appropriate if a large number of concurrent -sessions is expected. - -@heading Remarks - -Naturally, it is quite conceivable to store session data in a database -instead of in memory. Still, having mechanisms to expire data -associated with long-time idle sessions (where the business process -has still not finished) is likely a good idea. diff --git a/doc/chapters/tlsauthentication.inc b/doc/chapters/tlsauthentication.inc @@ -1,495 +0,0 @@ -We left the basic authentication chapter with the unsatisfactory conclusion that -any traffic, including the credentials, could be intercepted by anyone between -the browser client and the server. Protecting the data while it is sent over -unsecured lines will be the goal of this chapter. - -Since version 0.4, the @emph{MHD} library includes support for encrypting the -traffic by employing SSL/TSL. If @emph{GNU libmicrohttpd} has been configured to -support these, encryption and decryption can be applied transparently on the -data being sent, with only minimal changes to the actual source code of the example. - - -@heading Preparation - -First, a private key for the server will be generated. With this key, the server -will later be able to authenticate itself to the client---preventing anyone else -from stealing the password by faking its identity. The @emph{OpenSSL} suite, which -is available on many operating systems, can generate such a key. For the scope of -this tutorial, we will be content with a 1024 bit key: -@verbatim -> openssl genrsa -out server.key 1024 -@end verbatim -@noindent - -In addition to the key, a certificate describing the server in human readable tokens -is also needed. This certificate will be attested with our aforementioned key. In this way, -we obtain a self-signed certificate, valid for one year. - -@verbatim -> openssl req -days 365 -out server.pem -new -x509 -key server.key -@end verbatim -@noindent - -To avoid unnecessary error messages in the browser, the certificate needs to -have a name that matches the @emph{URI}, for example, "localhost" or the domain. -If you plan to have a publicly reachable server, you will need to ask a trusted third party, -called @emph{Certificate Authority}, or @emph{CA}, to attest the certificate for you. This way, -any visitor can make sure the server's identity is real. - -Whether the server's certificate is signed by us or a third party, once it has been accepted -by the client, both sides will be communicating over encrypted channels. From this point on, -it is the client's turn to authenticate itself. But this has already been implemented in the basic -authentication scheme. - - -@heading Changing the source code - -We merely have to extend the server program so that it loads the two files into memory, - -@verbatim -int -main () -{ - struct MHD_Daemon *daemon; - char *key_pem; - char *cert_pem; - - key_pem = load_file (SERVERKEYFILE); - cert_pem = load_file (SERVERCERTFILE); - - if ((key_pem == NULL) || (cert_pem == NULL)) - { - printf ("The key/certificate files could not be read.\n"); - return 1; - } -@end verbatim -@noindent - -and then we point the @emph{MHD} daemon to it upon initialization. -@verbatim - - daemon = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_SSL, - PORT, NULL, NULL, - &answer_to_connection, NULL, - MHD_OPTION_HTTPS_MEM_KEY, key_pem, - MHD_OPTION_HTTPS_MEM_CERT, cert_pem, - MHD_OPTION_END); - - if (NULL == daemon) - { - printf ("%s\n", cert_pem); - - free (key_pem); - free (cert_pem); - - return 1; - } -@end verbatim -@noindent - - -The rest consists of little new besides some additional memory cleanups. -@verbatim - - getchar (); - - MHD_stop_daemon (daemon); - free (key_pem); - free (cert_pem); - - return 0; -} -@end verbatim -@noindent - - -The rather unexciting file loader can be found in the complete example @code{tlsauthentication.c}. - - -@heading Remarks -@itemize @bullet -@item -While the standard @emph{HTTP} port is 80, it is 443 for @emph{HTTPS}. The common internet browsers assume -standard @emph{HTTP} if they are asked to access other ports than these. Therefore, you will have to type -@code{https://localhost:8888} explicitly when you test the example, or the browser will not know how to -handle the answer properly. - -@item -The remaining weak point is the question how the server will be trusted initially. Either a @emph{CA} signs the -certificate or the client obtains the key over secure means. Anyway, the clients have to be aware (or configured) -that they should not accept certificates of unknown origin. - -@item -The introduced method of certificates makes it mandatory to set an expiration date---making it less feasible to -hardcode certificates in embedded devices. - -@item -The cryptographic facilities consume memory space and computing time. For this reason, websites usually consists -both of uncritically @emph{HTTP} parts and secured @emph{HTTPS}. - -@end itemize - - -@heading Client authentication - -You can also use MHD to authenticate the client via SSL/TLS certificates -(as an alternative to using the password-based Basic or Digest authentication). -To do this, you will need to link your application against @emph{gnutls}. -Next, when you start the MHD daemon, you must specify the root CA that you're -willing to trust: -@verbatim - daemon = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_SSL, - PORT, NULL, NULL, - &answer_to_connection, NULL, - MHD_OPTION_HTTPS_MEM_KEY, key_pem, - MHD_OPTION_HTTPS_MEM_CERT, cert_pem, - MHD_OPTION_HTTPS_MEM_TRUST, root_ca_pem, - MHD_OPTION_END); -@end verbatim - -With this, you can then obtain client certificates for each session. -In order to obtain the identity of the client, you first need to -obtain the raw GnuTLS session handle from @emph{MHD} using -@code{MHD_get_connection_info}. - -@verbatim -#include <gnutls/gnutls.h> -#include <gnutls/x509.h> - -gnutls_session_t tls_session; -union MHD_ConnectionInfo *ci; - -ci = MHD_get_connection_info (connection, - MHD_CONNECTION_INFO_GNUTLS_SESSION); -tls_session = (gnutls_session_t) ci->tls_session; -@end verbatim - -You can then extract the client certificate: - -@verbatim -/** - * Get the client's certificate - * - * @param tls_session the TLS session - * @return NULL if no valid client certificate could be found, a pointer - * to the certificate if found - */ -static gnutls_x509_crt_t -get_client_certificate (gnutls_session_t tls_session) -{ - unsigned int listsize; - const gnutls_datum_t * pcert; - gnutls_certificate_status_t client_cert_status; - gnutls_x509_crt_t client_cert; - - if (tls_session == NULL) - return NULL; - if (gnutls_certificate_verify_peers2(tls_session, - &client_cert_status)) - return NULL; - if (0 != client_cert_status) - { - fprintf (stderr, - "Failed client certificate invalid: %d\n", - client_cert_status); - return NULL; - } - pcert = gnutls_certificate_get_peers(tls_session, - &listsize); - if ( (pcert == NULL) || - (listsize == 0)) - { - fprintf (stderr, - "Failed to retrieve client certificate chain\n"); - return NULL; - } - if (gnutls_x509_crt_init(&client_cert)) - { - fprintf (stderr, - "Failed to initialize client certificate\n"); - return NULL; - } - /* Note that by passing values between 0 and listsize here, you - can get access to the CA's certs */ - if (gnutls_x509_crt_import(client_cert, - &pcert[0], - GNUTLS_X509_FMT_DER)) - { - fprintf (stderr, - "Failed to import client certificate\n"); - gnutls_x509_crt_deinit(client_cert); - return NULL; - } - return client_cert; -} -@end verbatim - -Using the client certificate, you can then get the client's distinguished name -and alternative names: - -@verbatim -/** - * Get the distinguished name from the client's certificate - * - * @param client_cert the client certificate - * @return NULL if no dn or certificate could be found, a pointer - * to the dn if found - */ -char * -cert_auth_get_dn(gnutls_x509_crt_t client_cert) -{ - char* buf; - size_t lbuf; - - lbuf = 0; - gnutls_x509_crt_get_dn(client_cert, NULL, &lbuf); - buf = malloc(lbuf); - if (buf == NULL) - { - fprintf (stderr, - "Failed to allocate memory for certificate dn\n"); - return NULL; - } - gnutls_x509_crt_get_dn(client_cert, buf, &lbuf); - return buf; -} - - -/** - * Get the alternative name of specified type from the client's certificate - * - * @param client_cert the client certificate - * @param nametype The requested name type - * @param index The position of the alternative name if multiple names are - * matching the requested type, 0 for the first matching name - * @return NULL if no matching alternative name could be found, a pointer - * to the alternative name if found - */ -char * -MHD_cert_auth_get_alt_name(gnutls_x509_crt_t client_cert, - int nametype, - unsigned int index) -{ - char* buf; - size_t lbuf; - unsigned int seq; - unsigned int subseq; - unsigned int type; - int result; - - subseq = 0; - for (seq=0;;seq++) - { - lbuf = 0; - result = gnutls_x509_crt_get_subject_alt_name2(client_cert, seq, NULL, &lbuf, - &type, NULL); - if (result == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) - return NULL; - if (nametype != (int) type) - continue; - if (subseq == index) - break; - subseq++; - } - buf = malloc(lbuf); - if (buf == NULL) - { - fprintf (stderr, - "Failed to allocate memory for certificate alt name\n"); - return NULL; - } - result = gnutls_x509_crt_get_subject_alt_name2(client_cert, - seq, - buf, - &lbuf, - NULL, NULL); - if (result != nametype) - { - fprintf (stderr, - "Unexpected return value from gnutls: %d\n", - result); - free (buf); - return NULL; - } - return buf; -} -@end verbatim - -Finally, you should release the memory associated with the client -certificate: - -@verbatim -gnutls_x509_crt_deinit (client_cert); -@end verbatim - - - -@heading Using TLS Server Name Indication (SNI) - -SNI enables hosting multiple domains under one IP address with TLS. So -SNI is the TLS-equivalent of virtual hosting. To use SNI with MHD, you -need at least GnuTLS 3.0. The main change compared to the simple hosting -of one domain is that you need to provide a callback instead of the key -and certificate. For example, when you start the MHD daemon, you could -do this: -@verbatim - daemon = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_SSL, - PORT, NULL, NULL, - &answer_to_connection, NULL, - MHD_OPTION_HTTPS_CERT_CALLBACK, &sni_callback, - MHD_OPTION_END); -@end verbatim -Here, @code{sni_callback} is the name of a function that you will have to -implement to retrieve the X.509 certificate for an incoming connection. -The callback has type @code{gnutls_certificate_retrieve_function2} and -is documented in the GnuTLS API for the @code{gnutls_certificate_set_retrieve_function2} -as follows: - -@deftypefn {Function Pointer} int {*gnutls_certificate_retrieve_function2} (gnutls_session_t, const gnutls_datum_t* req_ca_dn, int nreqs, const gnutls_pk_algorithm_t* pk_algos, int pk_algos_length, gnutls_pcert_st** pcert, unsigned int *pcert_length, gnutls_privkey_t * pkey) - -@table @var -@item req_ca_cert -is only used in X.509 certificates. Contains a list with the CA names that the server considers trusted. Normally we should send a certificate that is signed by one of these CAs. These names are DER encoded. To get a more meaningful value use the function @code{gnutls_x509_rdn_get()}. - -@item pk_algos -contains a list with server’s acceptable signature algorithms. The certificate returned should support the server’s given algorithms. - -@item pcert -should contain a single certificate and public or a list of them. - -@item pcert_length -is the size of the previous list. - -@item pkey -is the private key. -@end table -@end deftypefn - -A possible implementation of this callback would look like this: - -@verbatim -struct Hosts -{ - struct Hosts *next; - const char *hostname; - gnutls_pcert_st pcrt; - gnutls_privkey_t key; -}; - -static struct Hosts *hosts; - -int -sni_callback (gnutls_session_t session, - const gnutls_datum_t* req_ca_dn, - int nreqs, - const gnutls_pk_algorithm_t* pk_algos, - int pk_algos_length, - gnutls_pcert_st** pcert, - unsigned int *pcert_length, - gnutls_privkey_t * pkey) -{ - char name[256]; - size_t name_len; - struct Hosts *host; - unsigned int type; - - name_len = sizeof (name); - if (GNUTLS_E_SUCCESS != - gnutls_server_name_get (session, - name, - &name_len, - &type, - 0 /* index */)) - return -1; - for (host = hosts; NULL != host; host = host->next) - if (0 == strncmp (name, host->hostname, name_len)) - break; - if (NULL == host) - { - fprintf (stderr, - "Need certificate for %.*s\n", - (int) name_len, - name); - return -1; - } - fprintf (stderr, - "Returning certificate for %.*s\n", - (int) name_len, - name); - *pkey = host->key; - *pcert_length = 1; - *pcert = &host->pcrt; - return 0; -} -@end verbatim - -Note that MHD cannot offer passing a closure or any other additional information -to this callback, as the GnuTLS API unfortunately does not permit this at this -point. - -The @code{hosts} list can be initialized by loading the private keys and X.509 -certificates from disk as follows: - -@verbatim -static void -load_keys(const char *hostname, - const char *CERT_FILE, - const char *KEY_FILE) -{ - int ret; - gnutls_datum_t data; - struct Hosts *host; - - host = malloc (sizeof (struct Hosts)); - host->hostname = hostname; - host->next = hosts; - hosts = host; - - ret = gnutls_load_file (CERT_FILE, &data); - if (ret < 0) - { - fprintf (stderr, - "*** Error loading certificate file %s.\n", - CERT_FILE); - exit(1); - } - ret = - gnutls_pcert_import_x509_raw (&host->pcrt, &data, GNUTLS_X509_FMT_PEM, - 0); - if (ret < 0) - { - fprintf(stderr, - "*** Error loading certificate file: %s\n", - gnutls_strerror (ret)); - exit(1); - } - gnutls_free (data.data); - - ret = gnutls_load_file (KEY_FILE, &data); - if (ret < 0) - { - fprintf (stderr, - "*** Error loading key file %s.\n", - KEY_FILE); - exit(1); - } - - gnutls_privkey_init (&host->key); - ret = - gnutls_privkey_import_x509_raw (host->key, - &data, GNUTLS_X509_FMT_PEM, - NULL, 0); - if (ret < 0) - { - fprintf (stderr, - "*** Error loading key file: %s\n", - gnutls_strerror (ret)); - exit(1); - } - gnutls_free (data.data); -} -@end verbatim - -The code above was largely lifted from GnuTLS. You can find other -methods for initializing certificates and keys in the GnuTLS manual -and source code. diff --git a/doc/chapters/websocket.inc b/doc/chapters/websocket.inc @@ -1,886 +0,0 @@ -Websockets are a genuine way to implement push notifications, -where the server initiates the communication while the client can be idle. -Usually a HTTP communication is half-duplex and always requested by the client, -but websockets are full-duplex and only initialized by the client. -In the further communication both sites can use the websocket at any time -to send data to the other site. - -To initialize a websocket connection the client sends a special HTTP request -to the server and initializes -a handshake between client and server which switches from the HTTP protocol -to the websocket protocol. -Thus both the server as well as the client must support websockets. -If proxys are used, they must support websockets too. -In this chapter we take a look on server and client, but with a focus on -the server with @emph{libmicrohttpd}. - -Since version 0.9.52 @emph{libmicrohttpd} supports upgrading requests, -which is required for switching from the HTTP protocol. -Since version 0.9.74 the library @emph{libmicrohttpd_ws} has been added -to support the websocket protocol. - -@heading Upgrading connections with libmicrohttpd - -To support websockets we need to enable upgrading of HTTP connections first. -This is done by passing the flag @code{MHD_ALLOW_UPGRADE} to -@code{MHD_start_daemon()}. - - -@verbatim -daemon = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD | - MHD_USE_THREAD_PER_CONNECTION | - MHD_ALLOW_UPGRADE | - MHD_USE_ERROR_LOG, - PORT, NULL, NULL, - &access_handler, NULL, - MHD_OPTION_END); -@end verbatim -@noindent - - -The next step is to turn a specific request into an upgraded connection. -This done in our @code{access_handler} by calling -@code{MHD_create_response_for_upgrade()}. -An @code{upgrade_handler} will be passed to perform the low-level actions -on the socket. - -@emph{Please note that the socket here is just a regular socket as provided -by the operating system. -To use it as a websocket, some more steps from the following -chapters are required.} - - -@verbatim -static enum MHD_Result -access_handler (void *cls, - struct MHD_Connection *connection, - const char *url, - const char *method, - const char *version, - const char *upload_data, - size_t *upload_data_size, - void **ptr) -{ - /* ... */ - /* some code to decide whether to upgrade or not */ - /* ... */ - - /* create the response for upgrade */ - response = MHD_create_response_for_upgrade (&upgrade_handler, - NULL); - - /* ... */ - /* additional headers, etc. */ - /* ... */ - - ret = MHD_queue_response (connection, - MHD_HTTP_SWITCHING_PROTOCOLS, - response); - MHD_destroy_response (response); - - return ret; -} -@end verbatim -@noindent - - -In the @code{upgrade_handler} we receive the low-level socket, -which is used for the communication with the specific client. -In addition to the low-level socket we get: -@itemize @bullet -@item -Some data, which has been read too much while @emph{libmicrohttpd} was -switching the protocols. -This value is usually empty, because it would mean that the client -has sent data before the handshake was complete. - -@item -A @code{struct MHD_UpgradeResponseHandle} which is used to perform -special actions like closing, corking or uncorking the socket. -These commands are executed by passing the handle -to @code{MHD_upgrade_action()}. - - -@end itemize - -Depending of the flags specified while calling @code{MHD_start_deamon()} -our @code{upgrade_handler} is either executed in the same thread -as our daemon or in a thread specific for each connection. -If it is executed in the same thread then @code{upgrade_handler} is -a blocking call for our webserver and -we should finish it as fast as possible (i. e. by creating a thread and -passing the information there). -If @code{MHD_USE_THREAD_PER_CONNECTION} was passed to -@code{MHD_start_daemon()} then a separate thread is used and -thus our @code{upgrade_handler} needs not to start a separate thread. - -An @code{upgrade_handler}, which is called with a separate thread -per connection, could look like this: - - -@verbatim -static void -upgrade_handler (void *cls, - struct MHD_Connection *connection, - void *req_cls, - const char *extra_in, - size_t extra_in_size, - MHD_socket fd, - struct MHD_UpgradeResponseHandle *urh) -{ - /* ... */ - /* do something with the socket `fd` like `recv()` or `send()` */ - /* ... */ - - /* close the socket when it is not needed anymore */ - MHD_upgrade_action (urh, - MHD_UPGRADE_ACTION_CLOSE); -} -@end verbatim -@noindent - - -This is all you need to know for upgrading connections -with @emph{libmicrohttpd}. -The next chapters focus on using the websocket protocol -with @emph{libmicrohttpd_ws}. - - -@heading Websocket handshake with libmicrohttpd_ws - -To request a websocket connection the client must send -the following information with the HTTP request: - -@itemize @bullet -@item -A @code{GET} request must be sent. - -@item -The version of the HTTP protocol must be 1.1 or higher. - -@item -A @code{Host} header field must be sent - -@item -A @code{Upgrade} header field containing the keyword "websocket" -(case-insensitive). -Please note that the client could pass multiple protocols separated by comma. - -@item -A @code{Connection} header field that includes the token "Upgrade" -(case-insensitive). -Please note that the client could pass multiple tokens separated by comma. - -@item -A @code{Sec-WebSocket-Key} header field with a base64-encoded value. -The decoded the value is 16 bytes long -and has been generated randomly by the client. - -@item -A @code{Sec-WebSocket-Version} header field with the value "13". - -@end itemize - - -Optionally the client can also send the following information: - - -@itemize @bullet -@item -A @code{Origin} header field can be used to determine the source -of the client (i. e. the website). - -@item -A @code{Sec-WebSocket-Protocol} header field can contain a list -of supported protocols by the client, which can be sent over the websocket. - -@item -A @code{Sec-WebSocket-Extensions} header field which may contain extensions -to the websocket protocol. The extensions must be registered by IANA. - -@end itemize - - -A valid example request from the client could look like this: - - -@verbatim -GET /chat HTTP/1.1 -Host: server.example.com -Upgrade: websocket -Connection: Upgrade -Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ== -Sec-WebSocket-Version: 13 -@end verbatim -@noindent - - -To complete the handshake the server must respond with -some specific response headers: - -@itemize @bullet -@item -The HTTP response code @code{101 Switching Protocols} must be answered. - -@item -An @code{Upgrade} header field containing the value "websocket" must be sent. - -@item -A @code{Connection} header field containing the value "Upgrade" must be sent. - -@item -A @code{Sec-WebSocket-Accept} header field containing a value, which -has been calculated from the @code{Sec-WebSocket-Key} request header field, -must be sent. - -@end itemize - - -Optionally the server may send following headers: - - -@itemize @bullet -@item -A @code{Sec-WebSocket-Protocol} header field containing a protocol -of the list specified in the corresponding request header field. - -@item -A @code{Sec-WebSocket-Extension} header field containing all used extensions -of the list specified in the corresponding request header field. - -@end itemize - - -A valid websocket HTTP response could look like this: - -@verbatim -HTTP/1.1 101 Switching Protocols -Upgrade: websocket -Connection: Upgrade -Sec-WebSocket-Accept: s3pPLMBiTxaQ9kYGzzhZRbK+xOo= -@end verbatim -@noindent - - -To upgrade a connection to a websocket the @emph{libmicrohttpd_ws} provides -some helper functions for the @code{access_handler} callback function: - -@itemize @bullet -@item -@code{MHD_websocket_check_http_version()} checks whether the HTTP version -is 1.1 or above. - -@item -@code{MHD_websocket_check_connection_header()} checks whether the value -of the @code{Connection} request header field contains -an "Upgrade" token (case-insensitive). - -@item -@code{MHD_websocket_check_upgrade_header()} checks whether the value -of the @code{Upgrade} request header field contains -the "websocket" keyword (case-insensitive). - -@item -@code{MHD_websocket_check_version_header()} checks whether the value -of the @code{Sec-WebSocket-Version} request header field is "13". - -@item -@code{MHD_websocket_create_accept_header()} takes the value from -the @code{Sec-WebSocket-Key} request header and calculates the value -for the @code{Sec-WebSocket-Accept} response header field. - -@end itemize - - -The @code{access_handler} example of the previous chapter can now be -extended with these helper functions to perform the websocket handshake: - -@verbatim -static enum MHD_Result -access_handler (void *cls, - struct MHD_Connection *connection, - const char *url, - const char *method, - const char *version, - const char *upload_data, - size_t *upload_data_size, - void **ptr) -{ - static int aptr; - struct MHD_Response *response; - int ret; - - (void) cls; /* Unused. Silent compiler warning. */ - (void) upload_data; /* Unused. Silent compiler warning. */ - (void) upload_data_size; /* Unused. Silent compiler warning. */ - - if (0 != strcmp (method, "GET")) - return MHD_NO; /* unexpected method */ - if (&aptr != *ptr) - { - /* do never respond on first call */ - *ptr = &aptr; - return MHD_YES; - } - *ptr = NULL; /* reset when done */ - - if (0 == strcmp (url, "/")) - { - /* Default page for visiting the server */ - struct MHD_Response *response = MHD_create_response_from_buffer ( - strlen (PAGE), - PAGE, - MHD_RESPMEM_PERSISTENT); - ret = MHD_queue_response (connection, - MHD_HTTP_OK, - response); - MHD_destroy_response (response); - } - else if (0 == strcmp (url, "/chat")) - { - char is_valid = 1; - const char* value = NULL; - char sec_websocket_accept[29]; - - if (0 != MHD_websocket_check_http_version (version)) - { - is_valid = 0; - } - value = MHD_lookup_connection_value (connection, - MHD_HEADER_KIND, - MHD_HTTP_HEADER_CONNECTION); - if (0 != MHD_websocket_check_connection_header (value)) - { - is_valid = 0; - } - value = MHD_lookup_connection_value (connection, - MHD_HEADER_KIND, - MHD_HTTP_HEADER_UPGRADE); - if (0 != MHD_websocket_check_upgrade_header (value)) - { - is_valid = 0; - } - value = MHD_lookup_connection_value (connection, - MHD_HEADER_KIND, - MHD_HTTP_HEADER_SEC_WEBSOCKET_VERSION); - if (0 != MHD_websocket_check_version_header (value)) - { - is_valid = 0; - } - value = MHD_lookup_connection_value (connection, - MHD_HEADER_KIND, - MHD_HTTP_HEADER_SEC_WEBSOCKET_KEY); - if (0 != MHD_websocket_create_accept_header (value, sec_websocket_accept)) - { - is_valid = 0; - } - - if (1 == is_valid) - { - /* upgrade the connection */ - response = MHD_create_response_for_upgrade (&upgrade_handler, - NULL); - MHD_add_response_header (response, - MHD_HTTP_HEADER_CONNECTION, - "Upgrade"); - MHD_add_response_header (response, - MHD_HTTP_HEADER_UPGRADE, - "websocket"); - MHD_add_response_header (response, - MHD_HTTP_HEADER_SEC_WEBSOCKET_ACCEPT, - sec_websocket_accept); - ret = MHD_queue_response (connection, - MHD_HTTP_SWITCHING_PROTOCOLS, - response); - MHD_destroy_response (response); - } - else - { - /* return error page */ - struct MHD_Response*response = MHD_create_response_from_buffer ( - strlen (PAGE_INVALID_WEBSOCKET_REQUEST), - PAGE_INVALID_WEBSOCKET_REQUEST, - MHD_RESPMEM_PERSISTENT); - ret = MHD_queue_response (connection, - MHD_HTTP_BAD_REQUEST, - response); - MHD_destroy_response (response); - } - } - else - { - struct MHD_Response*response = MHD_create_response_from_buffer ( - strlen (PAGE_NOT_FOUND), - PAGE_NOT_FOUND, - MHD_RESPMEM_PERSISTENT); - ret = MHD_queue_response (connection, - MHD_HTTP_NOT_FOUND, - response); - MHD_destroy_response (response); - } - - return ret; -} -@end verbatim -@noindent - -Please note that we skipped the check of the Host header field here, -because we don't know the host for this example. - -@heading Decoding/encoding the websocket protocol with libmicrohttpd_ws - -Once the websocket connection is established you can receive/send frame data -with the low-level socket functions @code{recv()} and @code{send()}. -The frame data which goes over the low-level socket is encoded according -to the websocket protocol. -To use received payload data, you need to decode the frame data first. -To send payload data, you need to encode it into frame data first. - -@emph{libmicrohttpd_ws} provides several functions for encoding of -payload data and decoding of frame data: - -@itemize @bullet -@item -@code{MHD_websocket_decode()} decodes received frame data. -The payload data may be of any kind, depending upon what the client has sent. -So this decode function is used for all kind of frames and returns -the frame type along with the payload data. - -@item -@code{MHD_websocket_encode_text()} encodes text. -The text must be encoded with UTF-8. - -@item -@code{MHD_websocket_encode_binary()} encodes binary data. - -@item -@code{MHD_websocket_encode_ping()} encodes a ping request to -check whether the websocket is still valid and to test latency. - -@item -@code{MHD_websocket_encode_ping()} encodes a pong response to -answer a received ping request. - -@item -@code{MHD_websocket_encode_close()} encodes a close request. - -@item -@code{MHD_websocket_free()} frees data returned by the encode/decode functions. - -@end itemize - -Since you could receive or send fragmented data (i. e. due to a too -small buffer passed to @code{recv}) all of these encode/decode -functions require a pointer to a @code{struct MHD_WebSocketStream} passed -as argument. -In this structure @emph{libmicrohttpd_ws} stores information -about encoding/decoding of the particular websocket. -For each websocket you need a unique @code{struct MHD_WebSocketStream} -to encode/decode with this library. - -To create or destroy @code{struct MHD_WebSocketStream} -we have additional functions: - -@itemize @bullet -@item -@code{MHD_websocket_stream_init()} allocates and initializes -a new @code{struct MHD_WebSocketStream}. -You can specify some options here to alter the behavior of the websocket stream. - -@item -@code{MHD_websocket_stream_free()} frees a previously allocated -@code{struct MHD_WebSocketStream}. - -@end itemize - -With these encode/decode functions we can improve our @code{upgrade_handler} -callback function from an earlier example to a working websocket: - - -@verbatim -static void -upgrade_handler (void *cls, - struct MHD_Connection *connection, - void *req_cls, - const char *extra_in, - size_t extra_in_size, - MHD_socket fd, - struct MHD_UpgradeResponseHandle *urh) -{ - /* make the socket blocking (operating-system-dependent code) */ - make_blocking (fd); - - /* create a websocket stream for this connection */ - struct MHD_WebSocketStream* ws; - int result = MHD_websocket_stream_init (&ws, - 0, - 0); - if (0 != result) - { - /* Couldn't create the websocket stream. - * So we close the socket and leave - */ - MHD_upgrade_action (urh, - MHD_UPGRADE_ACTION_CLOSE); - return; - } - - /* Let's wait for incoming data */ - const size_t buf_len = 256; - char buf[buf_len]; - ssize_t got; - while (MHD_WEBSOCKET_VALIDITY_VALID == MHD_websocket_stream_is_valid (ws)) - { - got = recv (fd, - buf, - buf_len, - 0); - if (0 >= got) - { - /* the TCP/IP socket has been closed */ - break; - } - - /* parse the entire received data */ - size_t buf_offset = 0; - while (buf_offset < (size_t) got) - { - size_t new_offset = 0; - char *frame_data = NULL; - size_t frame_len = 0; - int status = MHD_websocket_decode (ws, - buf + buf_offset, - ((size_t) got) - buf_offset, - &new_offset, - &frame_data, - &frame_len); - if (0 > status) - { - /* an error occurred and the connection must be closed */ - if (NULL != frame_data) - { - MHD_websocket_free (ws, frame_data); - } - break; - } - else - { - buf_offset += new_offset; - if (0 < status) - { - /* the frame is complete */ - switch (status) - { - case MHD_WEBSOCKET_STATUS_TEXT_FRAME: - /* The client has sent some text. - * We will display it and answer with a text frame. - */ - if (NULL != frame_data) - { - printf ("Received message: %s\n", frame_data); - MHD_websocket_free (ws, frame_data); - frame_data = NULL; - } - result = MHD_websocket_encode_text (ws, - "Hello", - 5, /* length of "Hello" */ - 0, - &frame_data, - &frame_len, - NULL); - if (0 == result) - { - send_all (fd, - frame_data, - frame_len); - } - break; - - case MHD_WEBSOCKET_STATUS_CLOSE_FRAME: - /* if we receive a close frame, we will respond with one */ - MHD_websocket_free (ws, - frame_data); - frame_data = NULL; - - result = MHD_websocket_encode_close (ws, - 0, - NULL, - 0, - &frame_data, - &frame_len); - if (0 == result) - { - send_all (fd, - frame_data, - frame_len); - } - break; - - case MHD_WEBSOCKET_STATUS_PING_FRAME: - /* if we receive a ping frame, we will respond */ - /* with the corresponding pong frame */ - { - char *pong = NULL; - size_t pong_len = 0; - result = MHD_websocket_encode_pong (ws, - frame_data, - frame_len, - &pong, - &pong_len); - if (0 == result) - { - send_all (fd, - pong, - pong_len); - } - MHD_websocket_free (ws, - pong); - } - break; - - default: - /* Other frame types are ignored - * in this minimal example. - * This is valid, because they become - * automatically skipped if we receive them unexpectedly - */ - break; - } - } - if (NULL != frame_data) - { - MHD_websocket_free (ws, frame_data); - } - } - } - } - - /* free the websocket stream */ - MHD_websocket_stream_free (ws); - - /* close the socket when it is not needed anymore */ - MHD_upgrade_action (urh, - MHD_UPGRADE_ACTION_CLOSE); -} - -/* This helper function is used for the case that - * we need to resend some data - */ -static void -send_all (MHD_socket fd, - const char *buf, - size_t len) -{ - ssize_t ret; - size_t off; - - for (off = 0; off < len; off += ret) - { - ret = send (fd, - &buf[off], - (int) (len - off), - 0); - if (0 > ret) - { - if (EAGAIN == errno) - { - ret = 0; - continue; - } - break; - } - if (0 == ret) - break; - } -} - -/* This helper function contains operating-system-dependent code and - * is used to make a socket blocking. - */ -static void -make_blocking (MHD_socket fd) -{ -#if defined(MHD_POSIX_SOCKETS) - int flags; - - flags = fcntl (fd, F_GETFL); - if (-1 == flags) - return; - if ((flags & ~O_NONBLOCK) != flags) - if (-1 == fcntl (fd, F_SETFL, flags & ~O_NONBLOCK)) - abort (); -#elif defined(MHD_WINSOCK_SOCKETS) - unsigned long flags = 0; - - ioctlsocket (fd, FIONBIO, &flags); -#endif /* MHD_WINSOCK_SOCKETS */ -} - -@end verbatim -@noindent - - -Please note that the websocket in this example is only half-duplex. -It waits until the blocking @code{recv()} call returns and -only does then something. -In this example all frame types are decoded by @emph{libmicrohttpd_ws}, -but we only do something when a text, ping or close frame is received. -Binary and pong frames are ignored in our code. -This is legit, because the server is only required to implement at -least support for ping frame or close frame (the other frame types -could be skipped in theory, because they don't require an answer). -The pong frame doesn't require an answer and whether text frames or -binary frames get an answer simply belongs to your server application. -So this is a valid minimal example. - -Until this point you've learned everything you need to basically -use websockets with @emph{libmicrohttpd} and @emph{libmicrohttpd_ws}. -These libraries offer much more functions for some specific cases. - - -The further chapters of this tutorial focus on some specific problems -and the client site programming. - - -@heading Using full-duplex websockets - -To use full-duplex websockets you can simply create two threads -per websocket connection. -One of these threads is used for receiving data with -a blocking @code{recv()} call and the other thread is triggered -by the application internal codes and sends the data. - -A full-duplex websocket example is implemented in the example file -@code{websocket_chatserver_example.c}. - -@heading Error handling - -The most functions of @emph{libmicrohttpd_ws} return a value -of @code{enum MHD_WEBSOCKET_STATUS}. -The values of this enumeration can be converted into an integer -and have an easy interpretation: - -@itemize @bullet -@item -If the value is less than zero an error occurred and the call has failed. -Check the enumeration values for more specific information. - -@item -If the value is equal to zero, the call succeeded. - -@item -If the value is greater than zero, the call succeeded and the value -specifies the decoded frame type. -Currently positive values are only returned by @code{MHD_websocket_decode()} -(of the functions with this return enumeration type). - -@end itemize - -A websocket stream can also get broken when invalid frame data is received. -Also the other site could send a close frame which puts the stream into -a state where it may not be used for regular communication. -Whether a stream has become broken, can be checked with -@code{MHD_websocket_stream_is_valid()}. - - -@heading Fragmentation - -In addition to the regular TCP/IP fragmentation the websocket protocol also -supports fragmentation. -Fragmentation could be used for continuous payload data such as video data -from a webcam. -Whether or not you want to receive fragmentation is specified upon -initialization of the websocket stream. -If you pass @code{MHD_WEBSOCKET_FLAG_WANT_FRAGMENTS} in the flags parameter -of @code{MHD_websocket_stream_init()} then you can receive fragments. -If you don't pass this flag (in the most cases you just pass zero as flags) -then you don't want to handle fragments on your own. -@emph{libmicrohttpd_ws} removes then the fragmentation for you -in the background. -You only get the completely assembled frames. - -Upon encoding you specify whether or not you want to create a fragmented frame -by passing a flag to the corresponding encode function. -Only @code{MHD_websocket_encode_text()} and @code{MHD_websocket_encode_binary()} -can be used for fragmentation, because the other frame types may -not be fragmented. -Encoding fragmented frames is independent of -the @code{MHD_WEBSOCKET_FLAG_WANT_FRAGMENTS} flag upon initialization. - -@heading Quick guide to websockets in JavaScript - -Websockets are supported in all modern web browsers. -You initialize a websocket connection by creating an instance of -the @code{WebSocket} class provided by the web browser. - -There are some simple rules for using websockets in the browser: - -@itemize @bullet -@item -When you initialize the instance of the websocket class you must pass an URL. -The URL must either start with @code{ws://} -(for not encrypted websocket protocol) or @code{wss://} -(for TLS-encrypted websocket protocol). - -@strong{IMPORTANT:} If your website is accessed via @code{https://} -then you are in a security context, which means that you are only allowed to -access other secure protocols. -So you can only use @code{wss://} for websocket connections then. -If you try to @code{ws://} instead then your websocket connection will -automatically fail. - -@item -The WebSocket class uses events to handle the receiving of data. -JavaScript is per definition a single-threaded language so -the receiving events will never overlap. -Sending is done directly by calling a method of the instance of -the WebSocket class. - -@end itemize - - -Here is a short example for receiving/sending data to the same host -as the website is running on: - -@verbatim -<!DOCTYPE html> -<html> -<head> -<meta charset="UTF-8"> -<title>Websocket Demo</title> -<script> - -let url = 'ws' + (window.location.protocol === 'https:' ? 's' : '') + '://' + - window.location.host + '/chat'; -let socket = null; - -window.onload = function(event) { - socket = new WebSocket(url); - socket.onopen = function(event) { - document.write('The websocket connection has been established.<br>'); - - // Send some text - socket.send('Hello from JavaScript!'); - } - - socket.onclose = function(event) { - document.write('The websocket connection has been closed.<br>'); - } - - socket.onerror = function(event) { - document.write('An error occurred during the websocket communication.<br>'); - } - - socket.onmessage = function(event) { - document.write('Websocket message received: ' + event.data + '<br>'); - } -} - -</script> -</head> -<body> -</body> -</html> - -@end verbatim -@noindent diff --git a/doc/examples/.gitignore b/doc/examples/.gitignore @@ -1,4 +0,0 @@ -*.exe -*.o -*.lo -*.la diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am @@ -1,34 +0,0 @@ -# This Makefile.am is in the public domain -SUBDIRS = . - -AM_CPPFLAGS = \ - -I$(top_srcdir)/src/include \ - $(CPPFLAGS_ac) - -AM_CFLAGS = $(CFLAGS_ac) @LIBGCRYPT_CFLAGS@ - -AM_LDFLAGS = $(LDFLAGS_ac) - -AM_TESTS_ENVIRONMENT = $(TESTS_ENVIRONMENT_ac) - -if USE_COVERAGE - AM_CFLAGS += --coverage -endif - -$(top_builddir)/src/microhttpd/libmicrohttpd.la: $(top_builddir)/src/microhttpd/Makefile - @echo ' cd $(top_builddir)/src/microhttpd && $(MAKE) $(AM_MAKEFLAGS) libmicrohttpd.la'; \ - $(am__cd) $(top_builddir)/src/microhttpd && $(MAKE) $(AM_MAKEFLAGS) libmicrohttpd.la - -# example programs -noinst_PROGRAMS = - -if MHD_SUPPORT_AUTH_BASIC -noinst_PROGRAMS += -if MHD_SUPPORT_HTTPS -noinst_PROGRAMS += -endif -endif - -if MHD_SUPPORT_POST_PARSER -noinst_PROGRAMS += -endif diff --git a/doc/examples/basic-authentication.c b/doc/examples/basic-authentication.c @@ -0,0 +1,66 @@ +/* examples/basic-authentication.c */ + +#include <microhttpd2.h> +#include <assert.h> + + +static struct MHD_Action * +handle_request (void *cls, + struct MHD_Request *request, + const struct MHD_String *path, + enum MHD_HTTP_Method method, + uint_fast64_t upload_size) +{ + union MHD_RequestInfoDynamicData dd; + + if (MHD_SC_OK != + MHD_request_get_info_dynamic (request, + MHD_REQUEST_INFO_DYNAMIC_AUTH_BASIC_CREDS, + &dd)) + { + struct MHD_Response *r; + + r = MHD_response_from_empty (MHD_HTTP_STATUS_UNAUTHORIZED); + if (MHD_SC_OK != + MHD_response_add_auth_basic_challenge (r, + "test", + MHD_YES)) + { + MHD_response_destroy (r); + return MHD_action_abort_request (request); + } + return MHD_action_from_response (request, + r); + } + fprintf (stderr, + "User `%s' has password `%s' (do not log this in real code)\n", + dd.v_auth_basic_creds.username.cstr, + dd.v_auth_basic_creds.password.cstr); + /* You may want to check that username/password are + actually OK here, and if not fail similar to + the MHD_HTTP_STATUS_UNAUTHORIZED returned above. */ + + /* Success! */ + return MHD_action_from_response ( + request, + MHD_response_from_empty (MHD_HTTP_NO_CONTENT)); +} + + +int +main () +{ + struct MHD_Daemon *d; + + /* Create an HTTP server and use "handle_request()" to + handle all requests. */ + d = MHD_daemon_create (&handle_request, + NULL); + /* We run with everything on default, so port 80, no TLS */ + MHD_daemon_start (d); + /* Wait for input on stdin */ + (void) getchar (); + /* Then just shut everything down */ + MHD_daemon_stop (d); + return 0; +} diff --git a/doc/examples/external-select.c b/doc/examples/external-select.c @@ -0,0 +1,204 @@ +/* examples/external-select.c */ + +/* Must be defined before including "microhttpd2.h" */ +#define MHD_APP_SOCKET_CNTX_TYPE struct AppSockContext +#include <microhttpd2.h> +#include <assert.h> +#include <sys/select.h> + + +/** + * We keep the sockets we are waiting on in a DLL. + */ +struct AppSockContext +{ + struct AppSockContext *next; + struct AppSockContext *prev; + struct MHD_EventUpdateContext *ecb_cntx; + MHD_Socket fd; +}; + + +/** + * Current read set. + */ +static fd_set rs; + +/** + * Current write set. + */ +static fd_set ws; + +/** + * Current error set. + */ +static fd_set es; + +/** + * Maximum FD in any set. + */ +static int max_fd; + +/** + * Head of our internal list of sockets to select() on. + */ +static struct AppSockContext *head; + + +/* This is the function MHD will call when the external event + loop needs to change how it watches out for changes to + some socket's state */ +static MHD_APP_SOCKET_CNTX_TYPE * +sock_reg_update_cb ( + void *cls, + MHD_Socket fd, + enum MHD_FdState watch_for, + MHD_APP_SOCKET_CNTX_TYPE *app_cntx, + struct MHD_EventUpdateContext *ecb_cntx) +{ + assert (NULL == cls); + /* Note: This code only works on UNIX where MHD_Socket is an "int". */ + if (fd >= FD_SETSIZE) + return NULL; /* not allowed by select() */ + if (MHD_FD_STATE_NONE == watch_for) + { + /* Remove from DLL */ + if (app_cntx == head) + head = app_cntx->next; + if (NULL != app_cntx->prev) + app_cntx->prev->next = app_cntx->next; + if (NULL != app_cntx->next) + app_cntx->next->prev = app_cntx->prev; + free (app_cntx); + return NULL; + } + if (NULL == app_cntx) + { + /* First time, allocate data structure to keep + the socket and MHD's context */ + app_cntx = malloc (sizeof (MHD_APP_SOCKET_CNTX_TYPE)); + if (NULL == app_cntx) + return NULL; /* closes connection */ + /* prepend to DLL */ + app_cntx->prev = NULL; + app_cntx->next = head; + head->prev = app_cntx; + head = app_cntx; + app_cntx->fd = fd; + } + else + { + /* socket must not change */ + assert (fd == app_cntx->fd); + } + /* MHD could change its associated context, so always update */ + app_cntx->ecb_cntx = ecb_cntx; + /* Since we are level-triggered and thus called by MHD in every + iteration, we simply build the event sets for select() + here directly. */ + if (watch_for & MHD_FD_STATE_RECV) + FD_SET (fd, + &rs); + if (watch_for & MHD_FD_STATE_SEND) + FD_SET (fd, + &ws); + if (watch_for & MHD_FD_STATE_EXCEPT) + FD_SET (fd, + &es); + if (fd > max_fd) + max_fd = fd; + return app_cntx; +} + + +/** + * We "handle" request by just closing the connection. + */ +static struct MHD_Action * +handle_request (void *cls, + struct MHD_Request *request, + const struct MHD_String *path, + enum MHD_HTTP_Method method, + uint_fast64_t upload_size) +{ + /* We passed NULL in main() for the closure */ + assert (NULL == cls); + /* This simply closes the connection after receiving + the HTTP header, never return actually returning + any data. */ + return MHD_action_abort_request (request); +} + + +int +main () +{ + struct MHD_Daemon *d; + + /* Create an HTTP server and use "handle_request()" to + handle all requests. */ + d = MHD_daemon_create (&handle_request, + NULL); + if (MHD_SC_OK != + MHD_daemon_set_options (daemon, + MHD_D_OPTION_WM_EXTERNAL_EVENT_LOOP_LEVEL ( + &sock_reg_update_cb, + NULL))) + { + /* Maybe external event loop type not supported by build? */ + MHD_daemon_destroy (d); + return 1; + } + /* We run with everything on default, so port 80, no TLS */ + MHD_daemon_start (d); + while (1) { + struct timeval ts; + struct AppSockContext *pos; + uint_fast64_t next_wait; + + FD_ZERO (&rs); + FD_ZERO (&ws); + FD_ZERO (&es); + FD_SET (STDIN_FILENO, + &rs); + max_fd = STDIN_FILENO; + /* This will cause MHD to call the #sock_reg_update_cb() */ + MHD_daemon_process_reg_events (daemon, + &next_wait); + ts.tv_sec = next_wait / 1000000; + ts.tv_usec = next_wait % 1000000; + /* Real applications may do nicer error handling here */ + (void) select (max_fd + 1, + &rs, + &ws, + &es, + &ts); + if (FD_ISSET (STDIN_FILENO, + &rs)) + break; /* exit on input on stdin */ + + /* Now we need to tell MHD which events were triggered */ + for (pos = head; NULL != pos; pos = pos->next) + { + enum MHD_FdState current_state = MHD_FD_STATE_NONE; + + if (FD_ISSET (pos->fd, + &rs)) + current_state |= MHD_FD_STATE_READ; + if (FD_ISSET (pos->fd, + &ws)) + current_state |= MHD_FD_STATE_SEND; + if (FD_ISSET (pos->fd, + &es)) + current_state |= MHD_FD_STATE_EXCEPT; + if (MHD_FD_STATE_NONE == current_state) + continue; /* not triggered */ + MHD_daemon_event_update (daemon, + pos->ecb_cntx, + current_state); + } + } + /* Finally, just shut everything down */ + MHD_daemon_stop (d); + return 0; +} diff --git a/doc/examples/host-example.c b/doc/examples/host-example.c @@ -0,0 +1,57 @@ +/* examples/host-example.c */ + +#include <microhttpd2.h> +#include <assert.h> + + +static struct MHD_Action * +handle_request (void *cls, + struct MHD_Request *request, + const struct MHD_String *path, + enum MHD_HTTP_Method method, + uint_fast64_t upload_size) +{ + struct MHD_String *host; + + /* We passed NULL in main() for the closure */ + assert (NULL == cls); + /* MHD_HTTP_HEADER_HOST is literally just "Host" */ + host = MHD_request_get_value (request, + MHD_VK_HEADER, + MHD_HTTP_HEADER_HOST); + if (NULL == host) + { + /* In HTTP/1.0, the 'Host' header was optional! */ + fprintf (stderr, + "No 'Host:' header provided\n"); + } + else + { + fprintf (stderr, + "'Host:' is %s\n", + host->cstr); + } + /* This simply closes the connection after receiving + the HTTP header, never return actually returning + any data. */ + return MHD_action_abort_request (request); +} + + +int +main () +{ + struct MHD_Daemon *d; + + /* Create an HTTP server and use "handle_request()" to + handle all requests. */ + d = MHD_daemon_create (&handle_request, + NULL); + /* We run with everything on default, so port 80, no TLS */ + MHD_daemon_start (d); + /* Wait for input on stdin */ + (void) getchar (); + /* Then just shut everything down */ + MHD_daemon_stop (d); + return 0; +} diff --git a/doc/examples/init-example.c b/doc/examples/init-example.c @@ -0,0 +1,38 @@ +/* examples/init-example.c */ + +#include <microhttpd2.h> +#include <assert.h> + +static struct MHD_Action * +handle_request (void *cls, + struct MHD_Request *request, + const struct MHD_String *path, + enum MHD_HTTP_Method method, + uint_fast64_t upload_size) +{ + /* We passed NULL in main() for the closure */ + assert (NULL == cls); + /* This simply closes the connection after receiving + the HTTP header, never return actually returning + any data. */ + return MHD_action_abort_request (request); +} + + +int +main () +{ + struct MHD_Daemon *d; + + /* Create an HTTP server and use "handle_request()" to + handle all requests. */ + d = MHD_daemon_create (&handle_request, + NULL); + /* We run with everything on default, so port 80, no TLS */ + MHD_daemon_start (d); + /* Wait for input on stdin */ + (void) getchar (); + /* Then just shut everything down */ + MHD_daemon_stop (d); + return 0; +} diff --git a/doc/examples/options-example.c b/doc/examples/options-example.c @@ -0,0 +1,58 @@ +/* examples/options-example.c */ + +#include <microhttpd2.h> +#include <assert.h> + + +static struct MHD_Action * +handle_request (void *cls, + struct MHD_Request *request, + const struct MHD_String *path, + enum MHD_HTTP_Method method, + uint_fast64_t upload_size) +{ + struct MHD_String *host; + + /* We passed NULL in main() for the closure */ + assert (NULL == cls); + /* This simply closes the connection after receiving + the HTTP header, never return actually returning + any data. */ + return MHD_action_abort_request (request); +} + + +int +main () +{ + struct MHD_Daemon *d; + static const struct MHD_DaemonOptionAndValue bind_opt + = MHD_D_OPTION_BIND_PORT (MHD_AF_AUTO, + 80); + + /* Create an HTTP server and use "handle_request()" to + handle all requests. */ + d = MHD_daemon_create (&handle_request, + NULL); + if (MHD_SC_OK != + MHD_DAEMON_SET_OPTIONS (d, + MHD_D_OPTION_LISTEN_BACKLOG (5), + MHD_D_OPTION_SUPPRESS_DATE_HEADER ())) + fprintf (stderr, + "That's OK, we don't care too much about these\n"); + if (MHD_SC_OK != + MHD_daemon_set_option (d, + &bind_opt)) + { + fprintf (stderr, + "Failed to set port to bind to!\n"); + MHD_daemon_stop (d); + return 1; + } + MHD_daemon_start (d); + /* Wait for input on stdin */ + (void) getchar (); + /* Then just shut everything down */ + MHD_daemon_stop (d); + return 0; +} diff --git a/doc/examples/sigpipe.c b/doc/examples/sigpipe.c @@ -0,0 +1,37 @@ +/* examples/sigpipe.c */ + +static void +catcher (int sig) +{ + /* Ignore the signal */ +} + + +static void +ignore_sigpipe (void) +{ + struct sigaction oldsig; + struct sigaction sig; + + sig.sa_handler = &catcher; + sigemptyset (&sig.sa_mask); +#ifdef SA_INTERRUPT + sig.sa_flags = SA_INTERRUPT; /* SunOS */ +#else + sig.sa_flags = SA_RESTART; +#endif + if (0 != sigaction (SIGPIPE, + &sig, + &oldsig)) + fprintf (stderr, + "Failed to install SIGPIPE handler: %s\n", strerror (errno)); +} + + +int +main () +{ + ignore_sigpipe (); + /* Do actual application work here */ + return 0; +} diff --git a/doc/libmicrohttpd-tutorial.texi b/doc/libmicrohttpd-tutorial.texi @@ -1,193 +0,0 @@ -\input texinfo @c -*-texinfo-*- -@finalout -@setfilename libmicrohttpd-tutorial.info -@set UPDATED 2 April 2016 -@set UPDATED-MONTH April 2016 -@set EDITION 0.9.48 -@set VERSION 0.9.48 -@settitle A tutorial for GNU libmicrohttpd -@c Unify all the indices into concept index. -@syncodeindex fn cp -@syncodeindex vr cp -@syncodeindex ky cp -@syncodeindex pg cp -@syncodeindex tp cp - -@dircategory Software libraries -@direntry -* libmicrohttpdtutorial: (libmicrohttpd-tutorial). A tutorial for GNU libmicrohttpd. -@end direntry - -@copying -This tutorial documents GNU libmicrohttpd version @value{VERSION}, last -updated @value{UPDATED}. - -Copyright (c) 2008 Sebastian Gerhardt. - -Copyright (c) 2010, 2011, 2012, 2013, 2016, 2021 Christian Grothoff. -@quotation -Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.3 -or any later version published by the Free Software Foundation; -with no Invariant Sections, no Front-Cover Texts, and no Back-Cover -Texts. A copy of the license is included in the section entitled "GNU -Free Documentation License". -@end quotation -@end copying - -@titlepage -@title A Tutorial for GNU libmicrohttpd -@subtitle Version @value{VERSION} -@subtitle @value{UPDATED} -@author Sebastian Gerhardt (@email{sebgerhardt@@gmx.net}) -@author Christian Grothoff (@email{christian@@grothoff.org}) -@author Matthieu Speder (@email{mspeder@@users.sourceforge.net}) - -@page -@vskip 0pt plus 1filll -@insertcopying -@end titlepage - - - -@contents - -@ifnottex -@node Top -@top A Tutorial for GNU libmicrohttpd -@insertcopying -@end ifnottex - -@menu -* Introduction:: -* Hello browser example:: -* Exploring requests:: -* Response headers:: -* Supporting basic authentication:: -* Processing POST data:: -* Improved processing of POST data:: -* Session management:: -* Adding a layer of security:: -* Websockets:: -* Bibliography:: -* License text:: -* Example programs:: -@end menu - -@node Introduction -@chapter Introduction -@include chapters/introduction.inc - -@node Hello browser example -@chapter Hello browser example -@include chapters/hellobrowser.inc - -@node Exploring requests -@chapter Exploring requests -@include chapters/exploringrequests.inc - -@node Response headers -@chapter Response headers -@include chapters/responseheaders.inc - -@node Supporting basic authentication -@chapter Supporting basic authentication -@include chapters/basicauthentication.inc - -@node Processing POST data -@chapter Processing POST data -@include chapters/processingpost.inc - -@node Improved processing of POST data -@chapter Improved processing of POST data -@include chapters/largerpost.inc - -@node Session management -@chapter Session management -@include chapters/sessions.inc - -@node Adding a layer of security -@chapter Adding a layer of security -@include chapters/tlsauthentication.inc - -@node Websockets -@chapter Websockets -@include chapters/websocket.inc - -@node Bibliography -@appendix Bibliography -@include chapters/bibliography.inc - -@node License text -@appendix GNU Free Documentation License -@include fdl-1.3.texi - -@node Example programs -@appendix Example programs -@menu -* hellobrowser.c:: -* logging.c:: -* responseheaders.c:: -* basicauthentication.c:: -* simplepost.c:: -* largepost.c:: -* sessions.c:: -* tlsauthentication.c:: -* websocket.c:: -@end menu - -@node hellobrowser.c -@section hellobrowser.c -@smalldisplay -@verbatiminclude examples/hellobrowser.c -@end smalldisplay - -@node logging.c -@section logging.c -@smalldisplay -@verbatiminclude examples/logging.c -@end smalldisplay - -@node responseheaders.c -@section responseheaders.c -@smalldisplay -@verbatiminclude examples/responseheaders.c -@end smalldisplay - -@node basicauthentication.c -@section basicauthentication.c -@smalldisplay -@verbatiminclude examples/basicauthentication.c -@end smalldisplay - -@node simplepost.c -@section simplepost.c -@smalldisplay -@verbatiminclude examples/simplepost.c -@end smalldisplay - -@node largepost.c -@section largepost.c -@smalldisplay -@verbatiminclude examples/largepost.c -@end smalldisplay - -@node sessions.c -@section sessions.c -@smalldisplay -@verbatiminclude examples/sessions.c -@end smalldisplay - -@node tlsauthentication.c -@section tlsauthentication.c -@smalldisplay -@verbatiminclude examples/tlsauthentication.c -@end smalldisplay - -@node websocket.c -@section websocket.c -@smalldisplay -@verbatiminclude examples/websocket.c -@end smalldisplay - -@bye diff --git a/doc/libmicrohttpd.3 b/doc/libmicrohttpd.3 @@ -1,10 +1,11 @@ -.Dd June 21, 2013 -.Dt LIBMICROHTTPD 3 +.Dd February 9, 2025 +.Dt LIBMICROHTTPD2 3 .Os .Sh NAME .Nm libmicrohttpd .Nd library for embedding HTTP servers .Sh LIBRARY +.ds doc-str-Lb-libmicrohttpd library for embedding HTTP servers (libmicrohttpd) .Lb libmicrohttpd .Sh SYNOPSIS .In microhttpd.h @@ -16,30 +17,29 @@ The details of the API are described in comments in the header file, a detailed libmicrohttpd is released under both the LGPL Version 2.1 or higher and the GNU GPL with eCos extension. For details on both licenses please read the respective appendix in the Texinfo manual. .Sh FILES .Bl -tag -width /etc/ttys -compact -.It Pa microhttpd.h +.It Pa microhttpd2.h libmicrohttpd include file -.It Pa libmicrohttpd.so +.It Pa libmicrohttpd2.so libmicrohttpd library .El .Sh SEE ALSO .Xr curl 1 , .Xr libcurl 3 , -info libmicrohttpd +.Xr libwget2 3 , +info libmicrohttpd2 .Sh AUTHORS GNU .Nm -was originally designed by +was originally designed and implemented by .An -nosplit -.An Christian Grothoff Aq Mt christian@grothoff.org +.An Christian Grothoff Aq Mt grothoff@gnu.org and -.An Chris GauthierDickey Aq Mt chrisg@cs.du.edu Ns . -The original implementation was done by -.An Daniel Pittman Aq Mt depittman@gmail.com -and Christian Grothoff. -SSL/TLS support was added by Sagie Amir using code from GnuTLS. See the AUTHORS file in the distribution for a more detailed list of contributors. +.An Evgeny Grin Aq Mt karlson2k@gnu.org Ns. + +See the AUTHORS file in the distribution for a more detailed list of contributors. .Sh AVAILABILITY You can obtain the latest version from .Lk https://www.gnu.org/software/libmicrohttpd/ Ns . .Sh BUGS Report bugs by using -.Lk https://gnunet.org/bugs/ "Mantis" Ns . +.Lk https://bugs.gnunet.org/set_project.php?project_id=10 "Mantis" Ns . diff --git a/doc/libmicrohttpd.texi b/doc/libmicrohttpd.texi @@ -1,4760 +0,0 @@ -\input texinfo -@setfilename libmicrohttpd.info -@documentencoding UTF-8 -@include version.texi -@settitle The GNU libmicrohttpd Reference Manual -@c Unify all the indices into concept index. -@syncodeindex vr cp -@syncodeindex ky cp -@syncodeindex pg cp -@copying -This manual is for GNU libmicrohttpd -(version @value{VERSION}, @value{UPDATED}), a library for embedding -an HTTP(S) server into C applications. - -Copyright @copyright{} 2007--2019 Christian Grothoff - -@quotation -Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.3 -or any later version published by the Free Software Foundation; -with no Invariant Sections, no Front-Cover Texts, and no Back-Cover -Texts. A copy of the license is included in the section entitled "GNU -Free Documentation License". -@end quotation -@end copying - -@dircategory Software libraries -@direntry -* libmicrohttpd: (libmicrohttpd). Embedded HTTP server library. -@end direntry - -@c -@c Titlepage -@c -@titlepage -@title The GNU libmicrohttpd Reference Manual -@subtitle Version @value{VERSION} -@subtitle @value{UPDATED} -@author Marco Maggi (@email{marco.maggi-ipsu@@poste.it}) -@author Christian Grothoff (@email{christian@@grothoff.org}) -@page -@vskip 0pt plus 1filll -@insertcopying -@end titlepage - -@summarycontents -@contents - -@c ------------------------------------------------------------ -@ifnottex -@node Top -@top The GNU libmicrohttpd Library -@insertcopying -@end ifnottex - -@menu -* microhttpd-intro:: Introduction. -* microhttpd-const:: Constants. -* microhttpd-struct:: Structures type definition. -* microhttpd-cb:: Callback functions definition. -* microhttpd-init:: Starting and stopping the server. -* microhttpd-inspect:: Implementing external @code{select}. -* microhttpd-requests:: Handling requests. -* microhttpd-responses:: Building responses to requests. -* microhttpd-flow:: Flow control. -* microhttpd-dauth:: Utilizing Authentication. -* microhttpd-post:: Adding a @code{POST} processor. -* microhttpd-info:: Obtaining and modifying status information. -* microhttpd-util:: Utilities. -* microhttpd-websocket:: Websockets. - -Appendices - -* GNU-LGPL:: The GNU Lesser General Public License says how you - can copy and share almost all of `libmicrohttpd'. -* eCos License:: The eCos License says how you can copy and share some parts of `libmicrohttpd'. -* GNU-GPL:: The GNU General Public License (with eCos extension) says how you can copy and share some parts of `libmicrohttpd'. -* GNU-FDL:: The GNU Free Documentation License says how you - can copy and share the documentation of `libmicrohttpd'. - -Indices - -* Concept Index:: Index of concepts and programs. -* Function and Data Index:: Index of functions, variables and data types. -* Type Index:: Index of data types. -@end menu - -@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -@c ------------------------------------------------------------ -@node microhttpd-intro -@chapter Introduction - - -@noindent -All symbols defined in the public API start with @code{MHD_}. MHD -is a small HTTP daemon library. As such, it does not have any API -for logging errors (you can only enable or disable logging to stderr). -Also, it may not support all of the HTTP features directly, where -applicable, portions of HTTP may have to be handled by clients of the -library. - -The library is supposed to handle everything that it must handle -(because the API would not allow clients to do this), such as basic -connection management. However, detailed interpretations of headers, -such as range requests, are left to the main application. In -particular, if an application developer wants to support range -requests, he needs to explicitly indicate support in responses and -also explicitly parse the range header and generate a response (for -example, using the @code{MHD_create_response_from_fd_at_offset} call -to serve ranges from a file). MHD does understands headers that -control connection management (specifically, @code{Connection: close} -and @code{Expect: 100 continue} are understood and handled -automatically). @code{Connection: upgrade} is supported by passing -control over the socket (or something that behaves like the real -socket in the case of TLS) to the application (after sending the -desired HTTP response header). - -MHD largely ignores the semantics of the different HTTP methods, -so clients are left to handle those. One exception is that MHD does -understand @code{HEAD} and will only send the headers of the response -and not the body, even if the client supplied a body. (In fact, -clients do need to construct a response with the correct length, even -for @code{HEAD} request.) - -MHD understands @code{POST} data and is able to decode certain -formats (at the moment only @code{application/x-www-form-urlencoded} -and @code{multipart/form-data}) using the post processor API. The -data stream of a POST is also provided directly to the main -application, so unsupported encodings could still be processed, just -not conveniently by MHD. - -The header file defines various constants used by the HTTP protocol. -This does not mean that MHD actually interprets all of these values. -The provided constants are exported as a convenience for users of the -library. MHD does not verify that transmitted HTTP headers are -part of the standard specification; users of the library are free to -define their own extensions of the HTTP standard and use those with -MHD. - -All functions are guaranteed to be completely reentrant and -thread-safe. MHD checks for allocation failures and tries to -recover gracefully (for example, by closing the connection). -Additionally, clients can specify resource limits on the overall -number of connections, number of connections per IP address and memory -used per connection to avoid resource exhaustion. - -@section Scope - -MHD is currently used in a wide range of implementations. -Examples based on reports we've received from developers include: -@itemize -@item Embedded HTTP server on a cortex M3 (128 KB code space) -@item Large-scale multimedia server (reportedly serving at the - simulator limit of 7.5 GB/s) -@item Administrative console (via HTTP/HTTPS) for network appliances -@c If you have other interesting examples, please let us know -@end itemize - -@section Thread modes and event loops -@cindex poll -@cindex epoll -@cindex select - -MHD supports four basic thread modes and up to three event loop -styles. - -The four basic thread modes are external sockets polling (MHD creates -no threads, event loop is fully managed by the application), internal -polling (MHD creates one thread for all connections), polling in -thread pool (MHD creates a thread pool which is used to process all -connections) and thread-per-connection (MHD creates one thread for -listen sockets and then one thread per accepted connection). - -These thread modes are then combined with the evet loop styles -(polling function type). MHD support select, poll and epoll. select -is available on all platforms, epoll and poll may not be available on -some platforms. Note that it is possible to combine MHD using epoll -with an external select-based event loop. - -The default (if no other option is passed) is ``external select''. -The highest performance can typically be obtained with a thread pool -using @code{epoll}. Apache Benchmark (ab) was used to compare the -performance of @code{select} and @code{epoll} when using a thread pool -and a large number of connections. @ref{fig:performance} shows the -resulting plot from the @code{benchmark.c} example, which measures the -latency between an incoming request and the completion of the -transmission of the response. In this setting, the @code{epoll} -thread pool with four threads was able to handle more than 45,000 -connections per second on loopback (with Apache Benchmark running -three processes on the same machine). -@cindex performance - - -@float Figure,fig:performance -@image{libmicrohttpd_performance_data,400pt,300pt,Data,.png} -@caption{Performance measurements for select vs. epoll (with thread-pool).} -@end float - - -Not all combinations of thread modes and event loop styles are -supported. This is partially to keep the API simple, and partially -because some combinations simply make no sense as others are strictly -superior. Note that the choice of style depends first of all on the -application logic, and then on the performance requirements. -Applications that perform a blocking operation while handling a -request within the callbacks from MHD must use a thread per -connection. This is typically rather costly. Applications that do -not support threads or that must run on embedded devices without -thread-support must use the external mode. Using @code{epoll} is only -supported on some platform, thus portable applications must at least -have a fallback option available. @ref{tbl:supported} lists the sane -combinations. - -@float Table,tbl:supported -@multitable {@b{thread-per-connection}} {@b{select}} {@b{poll}} {@b{epoll}} -@item @tab @b{select} @tab @b{poll} @tab @b{epoll} -@item @b{external} @tab yes @tab no @tab yes -@item @b{internal} @tab yes @tab yes @tab yes -@item @b{thread pool} @tab yes @tab yes @tab yes -@item @b{thread-per-connection} @tab yes @tab yes @tab no -@end multitable -@caption{Supported combinations of event styles and thread modes.} -@end float - - -@section Compiling GNU libmicrohttpd -@cindex compilation -@cindex embedded systems -@cindex portability - -MHD uses the standard GNU system where the usual build process -involves running -@verbatim -$ ./configure -$ make -$ make install -@end verbatim - -MHD supports various options to be given to configure to tailor the -binary to a specific situation. Note that some of these options will -remove portions of the MHD code that are required for -binary-compatibility. They should only be used on embedded systems -with tight resource constraints and no concerns about library -versioning. Standard distributions including MHD are expected to -always ship with all features enabled, otherwise unexpected -incompatibilities can arise! - -Here is a list of MHD-specific options that can be given to configure -(canonical configure options such as ``--prefix'' are also supported, for a -full list of options run ``./configure --help''): - -@table @code -@item ``--disable-curl'' -disable running testcases using libcurl - -@item ``--disable-largefile'' -disable support for 64-bit files - -@item ``--disable-messages'' -disable logging of error messages (smaller binary size, not so much fun for debugging) - -@item ``--disable-https'' -disable HTTPS support, even if GNUtls is found; this option must be used if eCOS license is desired as an option (in all cases the resulting binary falls under a GNU LGPL-only license) - -@item ``--disable-postprocessor'' -do not include the post processor API (results in binary incompatibility) - -@item ``--disable-dauth'' -do not include the authentication APIs (results in binary incompatibility) - -@item ``--disable-httpupgrade'' -do not build code for HTTP ``Upgrade'' (smaller binary size, binary incompatible library) - -@item ``--disable-epoll'' -do not include epoll support, even if it supported (minimally smaller binary size, good for portability testing) - -@item ``--enable-coverage'' -set flags for analysis of code-coverage with gcc/gcov (results in slow, large binaries) - -@item ``--with-threads=posix,w32,none,auto'' -sets threading library to use. With use ``none'' to not support threads. In this case, MHD will only support the ``external'' threading modes and not perform any locking of data structures! Use @code{MHD_is_feature_supported(MHD_FEATURE_THREADS)} to test if threads are available. Default is ``auto''. - -@item ``--with-gcrypt=PATH'' -specifies path to libgcrypt installation - -@item ``--with-gnutls=PATH'' -specifies path to libgnutls installation - -@end table - -To cross-compile MHD for Android, install the Android NDK and use: -@verbatim -./configure --target=arm-linux-androideabi --host=arm-linux-androideabi --disable-doc --disable-examples -make -@end verbatim - -Similar build commands should work for cross-compilation to other platforms. -Note that you may have to first cross-compile GnuTLS to get MHD with TLS support. - - -@section Validity of pointers - -MHD will give applications access to its internal data structures -via pointers via arguments and return values from its API. This -creates the question as to how long those pointers are assured to -stay valid. - -Most MHD data structures are associated with the connection of an -HTTP client. Thus, pointers associated with a connection are -typically valid until the connection is finished, at which point -MHD will call the @code{MHD_RequestCompletedCallback} if one is -registered. Applications that have such a callback registered -may assume that keys and values from the -@code{MHD_KeyValueIterator}, return values from -@code{MHD_lookup_connection_value} and the @code{url}, -@code{method} and @code{version} arguments to the -@code{MHD_AccessHandlerCallback} will remain valid until the -respective @code{MHD_RequestCompletedCallback} is invoked. - -In contrast, the @code{upload_data} argument of -@code{MHD_RequestCompletedCallback} as well as all pointers -from the @code{MHD_PostDataIterator} are only valid for the -duration of the callback. - -Pointers returned from @code{MHD_get_response_header} are -valid as long as the response itself is valid. - - -@section Including the microhttpd.h header -@cindex portability -@cindex microhttpd.h - -Ideally, before including "microhttpd.h" you should add the necessary -includes to define the @code{va_list}, @code{size_t}, @code{ssize_t}, -@code{intptr_t}, @code{off_t}, @code{uint8_t}, @code{uint16_t}, -@code{int32_t}, @code{uint32_t}, @code{int64_t}, @code{uint64_t}, -@code{fd_set}, @code{socklen_t} and @code{struct sockaddr} data types. -Which specific headers are needed may depend on your platform and your -build system might include some tests to provide you with the -necessary conditional operations. For possible suggestions consult -@code{platform.h} and @code{configure.ac} in the MHD distribution. - -Once you have ensured that you manually (!) included the right headers -for your platform before "microhttpd.h", you should also add a line -with @code{#define MHD_PLATFORM_H} which will prevent the -"microhttpd.h" header from trying (and, depending on your platform, -failing) to include the right headers. - -If you do not define MHD_PLATFORM_H, the "microhttpd.h" header will -automatically include headers needed on GNU/Linux systems (possibly -causing problems when porting to other platforms). - -@section SIGPIPE -@cindex signals -MHD does not install a signal handler for SIGPIPE. On platforms where -this is possible (such as GNU/Linux), it disables SIGPIPE for its I/O -operations (by passing MSG_NOSIGNAL or similar). On other platforms, -SIGPIPE signals may be generated from network operations by MHD and -will cause the process to die unless the developer explicitly installs -a signal handler for SIGPIPE. - -Hence portable code using MHD must install a SIGPIPE handler or -explicitly block the SIGPIPE signal. MHD does not do so in order to -avoid messing with other parts of the application that may need to -handle SIGPIPE in a particular way. You can make your application -handle SIGPIPE by calling the following function in @code{main}: - -@verbatim -static void -catcher (int sig) -{ -} - -static void -ignore_sigpipe () -{ - struct sigaction oldsig; - struct sigaction sig; - - sig.sa_handler = &catcher; - sigemptyset (&sig.sa_mask); -#ifdef SA_INTERRUPT - sig.sa_flags = SA_INTERRUPT; /* SunOS */ -#else - sig.sa_flags = SA_RESTART; -#endif - if (0 != sigaction (SIGPIPE, &sig, &oldsig)) - fprintf (stderr, - "Failed to install SIGPIPE handler: %s\n", strerror (errno)); -} -@end verbatim - -@section MHD_UNSIGNED_LONG_LONG -@cindex long long -@cindex MHD_LONG_LONG -@cindex IAR -@cindex ARM -@cindex cortex m3 -@cindex embedded systems - -Some platforms do not support @code{long long}. Hence MHD defines a -macro @code{MHD_UNSIGNED LONG_LONG} which will default to -@code{unsigned long long}. For standard desktop operating systems, -this is all you need to know. - -However, if your platform does not support @code{unsigned long long}, -you should change "platform.h" to define @code{MHD_LONG_LONG} and -@code{MHD_UNSIGNED_LONG_LONG} to an appropriate alternative type and -also define @code{MHD_LONG_LONG_PRINTF} and -@code{MHD_UNSIGNED_LONG_LONG_PRINTF} to the corresponding format -string for printing such a data type. Note that the ``signed'' -versions are deprecated. Also, for historical reasons, -@code{MHD_LONG_LONG_PRINTF} is without the percent sign, whereas -@code{MHD_UNSIGNED_LONG_LONG_PRINTF} is with the percent sign. Newly -written code should only use the unsigned versions. However, you need -to define both in "platform.h" if you need to change the definition -for the specific platform. - - -@section Portability to W32 - -libmicrohttpd in general ported well to W32. Most libmicrohttpd features -are supported. W32 do not support some functions, like epoll and -corresponding MHD features are not available on W32. - - -@section Portability to z/OS - -To compile MHD on z/OS, extract the archive and run - -@verbatim -iconv -f UTF-8 -t IBM-1047 contrib/ascebc > /tmp/ascebc.sh -chmod +x /tmp/ascebc.sh -for n in `find * -type f` -do - /tmp/ascebc.sh $n -done -@end verbatim -to convert all source files to EBCDIC. Note that you must run -@code{configure} from the directory where the configure script is -located. Otherwise, configure will fail to find the -@code{contrib/xcc} script (which is a wrapper around the z/OS c89 -compiler). - - - -@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -@c ------------------------------------------------------------ -@node microhttpd-const -@chapter Constants - - -@deftp {Enumeration} MHD_FLAG -Options for the MHD daemon. - -Note that MHD will run automatically in background thread(s) only if -@code{MHD_USE_INTERNAL_POLLING_THREAD} is used. Otherwise caller -(application) must use @code{MHD_run} or @code{MHD_run_from_select} to -have MHD processed network connections and data. - -Starting the daemon may also fail if a particular option is not -implemented or not supported on the target platform (i.e. no support -for @acronym{TLS}, threads or IPv6). TLS support generally depends on -options given during MHD compilation. - -@table @code -@item MHD_NO_FLAG -No options selected. - -@item MHD_USE_ERROR_LOG -If this flag is used, the library should print error messages and -warnings to stderr (or to custom error printer if it's specified by -options). Note that for this run-time option to have any effect, MHD -needs to be compiled with messages enabled. This is done by default -except you ran configure with the @code{--disable-messages} flag set. - -@item MHD_USE_DEBUG -@cindex debugging -Currently the same as @code{MHD_USE_ERROR_LOG}. - -@item MHD_USE_TLS -@cindex TLS -@cindex SSL -Run in HTTPS-mode. If you specify @code{MHD_USE_TLS} and MHD was -compiled without SSL support, @code{MHD_start_daemon} will return -NULL. - -@item MHD_USE_THREAD_PER_CONNECTION -Run using one thread per connection. - -@item MHD_USE_INTERNAL_POLLING_THREAD -Run using an internal thread doing @code{SELECT}. - -@item MHD_USE_IPv6 -@cindex IPv6 -Run using the IPv6 protocol (otherwise, MHD will just support IPv4). -If you specify @code{MHD_USE_IPV6} and the local platform does not -support it, @code{MHD_start_daemon} will return NULL. - -If you want MHD to support IPv4 and IPv6 using a single socket, pass -MHD_USE_DUAL_STACK, otherwise, if you only pass this option, MHD will -try to bind to IPv6-only (resulting in no IPv4 support). - -@item MHD_USE_DUAL_STACK -@cindex IPv6 -Use a single socket for IPv4 and IPv6. Note that this will mean -that IPv4 addresses are returned by MHD in the IPv6-mapped format -(the 'struct sockaddr_in6' format will be used for IPv4 and IPv6). - -@item MHD_USE_PEDANTIC_CHECKS -@cindex deprecated -Deprecated (use @code{MHD_OPTION_STRICT_FOR_CLIENT}). -Be pedantic about the protocol. -Specifically, at the moment, this flag causes MHD to reject HTTP -1.1 connections without a @code{Host} header. This is required by the -standard, but of course in violation of the ``be as liberal as possible -in what you accept'' norm. It is recommended to turn this @strong{ON} -if you are testing clients against MHD, and @strong{OFF} in -production. - -@item MHD_USE_POLL -@cindex FD_SETSIZE -@cindex poll -@cindex select -Use @code{poll()} instead of @code{select()}. This allows sockets with -descriptors @code{>= FD_SETSIZE}. This option currently only works in -conjunction with @code{MHD_USE_INTERNAL_POLLING_THREAD} (at this point). -If you specify @code{MHD_USE_POLL} and the local platform does not -support it, @code{MHD_start_daemon} will return NULL. - -@item MHD_USE_EPOLL -@cindex FD_SETSIZE -@cindex epoll -@cindex select -Use @code{epoll()} instead of @code{poll()} or @code{select()}. This -allows sockets with descriptors @code{>= FD_SETSIZE}. This option is -only available on some systems and does not work in conjunction with -@code{MHD_USE_THREAD_PER_CONNECTION} (at this point). If you specify -@code{MHD_USE_EPOLL} and the local platform does not support it, -@code{MHD_start_daemon} will return NULL. Using @code{epoll()} -instead of @code{select()} or @code{poll()} can in some situations -result in significantly higher performance as the system call has -fundamentally lower complexity (O(1) for @code{epoll()} vs. O(n) for -@code{select()}/@code{poll()} where n is the number of open -connections). - -@item MHD_USE_TURBO -@cindex performance -Enable optimizations to aggressively improve performance. - -Currently, the optimizations this option enables are based on -opportunistic reads and writes. Basically, MHD will simply try to -read or write or accept on a socket before checking that the socket is -ready for IO using the event loop mechanism. As the sockets are -non-blocking, this may fail (at a loss of performance), but generally -MHD does this in situations where the operation is likely to succeed, -in which case performance is improved. Setting the flag should generally -be safe (even though the code is slightly more experimental). You may -want to benchmark your application to see if this makes any difference -for you. - - -@item MHD_USE_SUPPRESS_DATE_NO_CLOCK -@cindex date -@cindex clock -@cindex embedded systems -Suppress (automatically) adding the 'Date:' header to HTTP responses. -This option should ONLY be used on systems that do not have a clock -and that DO provide other mechanisms for cache control. See also -RFC 2616, section 14.18 (exception 3). - - -@item MHD_USE_NO_LISTEN_SOCKET -@cindex listen -@cindex proxy -@cindex embedded systems -Run the HTTP server without any listen socket. This option only makes -sense if @code{MHD_add_connection} is going to be used exclusively to -connect HTTP clients to the HTTP server. This option is incompatible -with using a thread pool; if it is used, -@code{MHD_OPTION_THREAD_POOL_SIZE} is ignored. - - -@item MHD_USE_ITC -@cindex quiesce -Force MHD to use a signal inter-thread communication channel to notify -the event loop (of threads) of our shutdown and other events. This is -required if an application uses @code{MHD_USE_INTERNAL_POLLING_THREAD} -and then performs @code{MHD_quiesce_daemon} (which eliminates our -ability to signal termination via the listen socket). In these modes, -@code{MHD_quiesce_daemon} will fail if this option was not set. Also, -use of this option is automatic (as in, you do not even have to -specify it), if @code{MHD_USE_NO_LISTEN_SOCKET} is specified. In -"external" select mode, this option is always simply ignored. - -Using this option also guarantees that MHD will not call -@code{shutdown()} on the listen socket, which means a parent -process can continue to use the socket. - -@item MHD_ALLOW_SUSPEND_RESUME -Enables using @code{MHD_suspend_connection} and -@code{MHD_resume_connection}, as performing these calls requires some -additional inter-thred communication channels to be created, and code -not using these calls should not pay the cost. - -@item MHD_USE_TCP_FASTOPEN -@cindex listen -Enable TCP_FASTOPEN on the listen socket. TCP_FASTOPEN is currently -supported on Linux >= 3.6. On other systems using this option with -cause @code{MHD_start_daemon} to fail. - - -@item MHD_ALLOW_UPGRADE -@cindex upgrade -This option must be set if you want to upgrade connections -(via ``101 Switching Protocols'' responses). This requires MHD to -allocate additional resources, and hence we require this -special flag so we only use the resources that are really needed. - - -@item MHD_USE_AUTO -Automatically select best event loop style (polling function) -depending on requested mode by other MHD flags and functions available -on platform. If application doesn't have requirements for any -specific polling function, it's recommended to use this flag. This -flag is very convenient for multiplatform applications. - -@item MHD_USE_POST_HANDSHAKE_AUTH_SUPPORT -Tell the TLS library to support post handshake client authentication. -Only useful in combination with @code{MHD_USE_TLS}. - -This option will only work if the underlying TLS library -supports it (i.e. GnuTLS after 3.6.3). If the TLS library -does not support it, MHD may ignore the option and proceed -without supporting this features. - -@item MHD_USE_INSECURE_TLS_EARLY_DATA -Tell the TLS library to support TLS v1.3 early data (0-RTT) with the -resulting security drawbacks. Only enable this if you really know what -you are doing. MHD currently does NOT enforce that this only affects -GET requests! You have been warned. - -This option will only work if the underlying TLS library -supports it (i.e. GnuTLS after 3.6.3). If the TLS library -does not support it, MHD may ignore the option and proceed -without supporting this features. - -@end table -@end deftp - - -@deftp {Enumeration} MHD_OPTION -MHD options. Passed in the varargs portion of -@code{MHD_start_daemon()}. - -@table @code -@item MHD_OPTION_END -No more options / last option. This is used to terminate the VARARGs -list. - -@item MHD_OPTION_CONNECTION_MEMORY_LIMIT -@cindex memory, limiting memory utilization -Maximum memory size per connection (followed by a @code{size_t}). The -default is 32 kB (32*1024 bytes) as defined by the internal constant -@code{MHD_POOL_SIZE_DEFAULT}. Values above 128k are unlikely to -result in much benefit, as half of the memory will be typically used -for IO, and TCP buffers are unlikely to support window sizes above 64k -on most systems. - -@item MHD_OPTION_CONNECTION_MEMORY_INCREMENT -@cindex memory -Increment to use for growing the read buffer (followed by a -@code{size_t}). The default is 1024 (bytes). Increasing this value -will make MHD use memory for reading more aggressively, which can -reduce the number of @code{recvfrom} calls but may increase the number -of @code{sendto} calls. The given value must fit within -MHD_OPTION_CONNECTION_MEMORY_LIMIT. - -@item MHD_OPTION_CONNECTION_LIMIT -@cindex connection, limiting number of connections -Maximum number of concurrent connections to accept (followed by an -@code{unsigned int}). The default is @code{FD_SETSIZE - 4} (the -maximum number of file descriptors supported by @code{select} minus -four for @code{stdin}, @code{stdout}, @code{stderr} and the server -socket). In other words, the default is as large as possible. - -If the connection limit is reached, MHD's behavior depends a bit on -other options. If @code{MHD_USE_ITC} was given, MHD -will stop accepting connections on the listen socket. This will cause -the operating system to queue connections (up to the @code{listen()} -limit) above the connection limit. Those connections will be held -until MHD is done processing at least one of the active connections. -If @code{MHD_USE_ITC} is not set, then MHD will continue -to @code{accept()} and immediately @code{close()} these connections. - -Note that if you set a low connection limit, you can easily get into -trouble with browsers doing request pipelining. For example, if your -connection limit is ``1'', a browser may open a first connection to -access your ``index.html'' file, keep it open but use a second -connection to retrieve CSS files, images and the like. In fact, modern -browsers are typically by default configured for up to 15 parallel -connections to a single server. If this happens, MHD will refuse to -even accept the second connection until the first connection is -closed --- which does not happen until timeout. As a result, the -browser will fail to render the page and seem to hang. If you expect -your server to operate close to the connection limit, you should -first consider using a lower timeout value and also possibly add -a ``Connection: close'' header to your response to ensure that -request pipelining is not used and connections are closed immediately -after the request has completed: -@example -MHD_add_response_header (response, - MHD_HTTP_HEADER_CONNECTION, - "close"); -@end example - -@item MHD_OPTION_CONNECTION_TIMEOUT -@cindex timeout -After how many seconds of inactivity should a connection automatically -be timed out? (followed by an @code{unsigned int}; use zero for no -timeout). The default is zero (no timeout). - -@item MHD_OPTION_NOTIFY_COMPLETED -Register a function that should be called whenever a request has been -completed (this can be used for application-specific clean up). -Requests that have never been presented to the application (via -@code{MHD_AccessHandlerCallback()}) will not result in -notifications. - -This option should be followed by @strong{TWO} pointers. First a -pointer to a function of type @code{MHD_RequestCompletedCallback()} -and second a pointer to a closure to pass to the request completed -callback. The second pointer maybe @code{NULL}. - -@item MHD_OPTION_NOTIFY_CONNECTION -Register a function that should be called when the TCP connection to a -client is opened or closed. The registered callback is called twice per -TCP connection, with @code{MHD_CONNECTION_NOTIFY_STARTED} and -@code{MHD_CONNECTION_NOTIFY_CLOSED} respectively. An additional -argument can be used to store TCP connection specific information, -which can be retrieved using @code{MHD_CONNECTION_INFO_SOCKET_CONTEXT} -during the lifetime of the TCP connection. -Note @code{MHD_OPTION_NOTIFY_COMPLETED} and the @code{req_cls} argument -to the @code{MHD_AccessHandlerCallback} are per HTTP request (and there -can be multiple HTTP requests per TCP connection). - -This option should be followed by @strong{TWO} pointers. First a -pointer to a function of type @code{MHD_NotifyConnectionCallback()} -and second a pointer to a closure to pass to the request completed -callback. The second pointer maybe @code{NULL}. - -@item MHD_OPTION_PER_IP_CONNECTION_LIMIT -Limit on the number of (concurrent) connections made to the -server from the same IP address. Can be used to prevent one -IP from taking over all of the allowed connections. If the -same IP tries to establish more than the specified number of -connections, they will be immediately rejected. The option -should be followed by an @code{unsigned int}. The default is -zero, which means no limit on the number of connections -from the same IP address. - -@item MHD_OPTION_LISTEN_BACKLOG_SIZE -Set the size of the @code{listen()} back log queue of the TCP socket. -Takes an @code{unsigned int} as the argument. Default is the -platform-specific value of @code{SOMAXCONN}. - -@item MHD_OPTION_STRICT_FOR_CLIENT -Specify how strict we should enforce the HTTP protocol. -Takes an @code{int} as the argument. Default is zero. - -If set to 1, MHD will be strict about the protocol. Specifically, at -the moment, this flag uses MHD to reject HTTP 1.1 connections without -a "Host" header. This is required by the standard, but of course in -violation of the "be as liberal as possible in what you accept" norm. -It is recommended to set this to 1 if you are testing clients against -MHD, and 0 in production. - -If set to -1 MHD will be permissive about the protocol, allowing -slight deviations that are technically not allowed by the -RFC. Specifically, at the moment, this flag causes MHD to allow spaces -in header field names. This is disallowed by the standard. - -It is not recommended to set it to -1 on publicly available servers as -it may potentially lower level of protection. - -@item MHD_OPTION_SERVER_INSANITY -@cindex testing -Allows the application to disable certain sanity precautions in MHD. With -these, the client can break the HTTP protocol, so this should never be used in -production. The options are, however, useful for testing HTTP clients against -"broken" server implementations. This argument must be followed by an -@code{unsigned int}, corresponding to an @code{enum MHD_DisableSanityCheck}. - -Right now, no sanity checks can be disabled. - -@item MHD_OPTION_SOCK_ADDR -@cindex bind, restricting bind -Bind daemon to the supplied socket address. This option should be followed by a -@code{struct sockaddr *}. If @code{MHD_USE_IPv6} is specified, -the @code{struct sockaddr*} should point to a @code{struct sockaddr_in6}, -otherwise to a @code{struct sockaddr_in}. If this option is not specified, -the daemon will listen to incoming connections from anywhere. If you use this -option, the 'port' argument from @code{MHD_start_daemon} is ignored and the port -from the given @code{struct sockaddr *} will be used instead. - -@item MHD_OPTION_URI_LOG_CALLBACK -@cindex debugging -@cindex logging -@cindex query string -Specify a function that should be called before parsing the URI from -the client. The specified callback function can be used for processing -the URI (including the options) before it is parsed. The URI after -parsing will no longer contain the options, which maybe inconvenient for -logging. This option should be followed by two arguments, the first -one must be of the form -@example - void * my_logger(void * cls, const char * uri, struct MHD_Connection *con) -@end example -where the return value will be passed as -@code{*req_cls} in calls to the @code{MHD_AccessHandlerCallback} -when this request is processed later; returning a -value of @code{NULL} has no special significance; (however, -note that if you return non-@code{NULL}, you can no longer -rely on the first call to the access handler having -@code{NULL == *req_cls} on entry) -@code{cls} will be set to the second argument following -MHD_OPTION_URI_LOG_CALLBACK. Finally, @code{uri} will -be the 0-terminated URI of the request. - -Note that during the time of this call, most of the connection's state -is not initialized (as we have not yet parsed he headers). However, -information about the connecting client (IP, socket) is available. - -@item MHD_OPTION_HTTPS_MEM_KEY -@cindex SSL -@cindex TLS -Memory pointer to the private key to be used by the -HTTPS daemon. This option should be followed by an -"const char*" argument. -This should be used in conjunction with 'MHD_OPTION_HTTPS_MEM_CERT'. - -@item MHD_OPTION_HTTPS_KEY_PASSWORD -@cindex SSL -@cindex TLS -Memory pointer to the password that decrypts the -private key to be used by the HTTPS daemon. -This option should be followed by an -"const char*" argument. -This should be used in conjunction with 'MHD_OPTION_HTTPS_MEM_KEY'. - -The password (or passphrase) is only used immediately during -@code{MHD_start_daemon()}. Thus, the application may want to -erase it from memory afterwards for additional security. - -@item MHD_OPTION_HTTPS_MEM_CERT -@cindex SSL -@cindex TLS -Memory pointer to the certificate to be used by the -HTTPS daemon. This option should be followed by an -"const char*" argument. -This should be used in conjunction with 'MHD_OPTION_HTTPS_MEM_KEY'. - -@item MHD_OPTION_HTTPS_MEM_TRUST -@cindex SSL -@cindex TLS -Memory pointer to the CA certificate to be used by the -HTTPS daemon to authenticate and trust clients certificates. -This option should be followed by an "const char*" argument. -The presence of this option activates the request of certificate -to the client. The request to the client is marked optional, and -it is the responsibility of the server to check the presence -of the certificate if needed. -Note that most browsers will only present a client certificate -only if they have one matching the specified CA, not sending -any certificate otherwise. - -@item MHD_OPTION_HTTPS_CRED_TYPE -@cindex SSL -@cindex TLS -Daemon credentials type. Either certificate or anonymous, -this option should be followed by one of the values listed in -"enum gnutls_credentials_type_t". - -@item MHD_OPTION_HTTPS_PRIORITIES -@cindex SSL -@cindex TLS -@cindex cipher -SSL/TLS protocol version and ciphers. -This option must be followed by an "const char *" argument -specifying the SSL/TLS protocol versions and ciphers that -are acceptable for the application. The string is passed -unchanged to gnutls_priority_init. If this option is not -specified, ``NORMAL'' is used. - -@item MHD_OPTION_HTTPS_CERT_CALLBACK -@cindex SSL -@cindex TLS -@cindex SNI -Use a callback to determine which X.509 certificate should be used for -a given HTTPS connection. This option should be followed by a -argument of type "gnutls_certificate_retrieve_function2 *". This -option provides an alternative to MHD_OPTION_HTTPS_MEM_KEY and -MHD_OPTION_HTTPS_MEM_CERT. You must use this version if multiple -domains are to be hosted at the same IP address using TLS's Server -Name Indication (SNI) extension. In this case, the callback is -expected to select the correct certificate based on the SNI -information provided. The callback is expected to access the SNI data -using gnutls_server_name_get(). Using this option requires GnuTLS 3.0 -or higher. - -@item MHD_OPTION_HTTPS_CERT_CALLBACK2 -@cindex SSL -@cindex TLS -@cindex SNI -@cindex OCSP -Use a callback to determine which X.509 certificate should be -used for a given HTTPS connection. This option should be -followed by a argument of type `gnutls_certificate_retrieve_function3 *`. -This option provides an -alternative/extension to #MHD_OPTION_HTTPS_CERT_CALLBACK. -You must use this version if you want to use OCSP stapling. -Using this option requires GnuTLS 3.6.3 or higher. - -@item MHD_OPTION_GNUTLS_PSK_CRED_HANDLER -@cindex SSL -@cindex TLS -@cindex PSK -Use pre-shared key for TLS credentials. -Pass a pointer to callback of type -@code{MHD_PskServerCredentialsCallback} and a closure. -The function will be called to -retrieve the shared key for a given username. - -@item MHD_OPTION_DIGEST_AUTH_RANDOM -@cindex digest auth -@cindex random -Digest Authentication nonce's seed. - -This option should be followed by two arguments. First an integer of -type "size_t" which specifies the size of the buffer pointed to by the -second argument in bytes. Note that the application must ensure that -the buffer of the second argument remains allocated and unmodified -while the daemon is running. For security, you SHOULD provide a fresh -random nonce when using MHD with Digest Authentication. - -@item MHD_OPTION_NONCE_NC_SIZE -@cindex digest auth -@cindex replay attack - -Size of an array of nonce and nonce counter map. This option must be -followed by an "unsigned int" argument that have the size (number of -elements) of a map of a nonce and a nonce-counter. If this option -is not specified, a default value of 4 will be used (which might be -too small for servers handling many requests). If you do not use -digest authentication at all, you can specify a value of zero to -save some memory. - -You should calculate the value of NC_SIZE based on the number of -connections per second multiplied by your expected session duration -plus a factor of about two for hash table collisions. For example, if -you expect 100 digest-authenticated connections per second and the -average user to stay on your site for 5 minutes, then you likely need -a value of about 60000. On the other hand, if you can only expect -only 10 digest-authenticated connections per second, tolerate browsers -getting a fresh nonce for each request and expect a HTTP request -latency of 250 ms, then a value of about 5 should be fine. - - -@item MHD_OPTION_LISTEN_SOCKET -@cindex systemd -Listen socket to use. Pass a listen socket for MHD to use -(systemd-style). If this option is used, MHD will not open its own -listen socket(s). The argument passed must be of type "int" and refer -to an existing socket that has been bound to a port and is listening. - -@item MHD_OPTION_EXTERNAL_LOGGER -@cindex logging -Use the given function for logging error messages. -This option must be followed by two arguments; the -first must be a pointer to a function -of type 'void fun(void * arg, const char * fmt, va_list ap)' -and the second a pointer of type 'void*' which will -be passed as the "arg" argument to "fun". - -Note that MHD will not generate any log messages without -the MHD_USE_ERROR_LOG flag set and if MHD was compiled -with the "--disable-messages" flag. - -@item MHD_OPTION_THREAD_POOL_SIZE -@cindex performance -Number (unsigned int) of threads in thread pool. Enable -thread pooling by setting this value to to something -greater than 1. Currently, thread mode must be -MHD_USE_INTERNAL_POLLING_THREAD if thread pooling is enabled -(@code{MHD_start_daemon} returns @code{NULL} for an unsupported thread -mode). - -@item MHD_OPTION_ARRAY -@cindex options -@cindex foreign-function interface -This option can be used for initializing MHD using options from an -array. A common use for this is writing an FFI for MHD. The actual -options given are in an array of 'struct MHD_OptionItem', so this -option requires a single argument of type 'struct MHD_OptionItem'. -The array must be terminated with an entry @code{MHD_OPTION_END}. - -An example for code using MHD_OPTION_ARRAY is: -@example -struct MHD_OptionItem ops[] = @{ - @{ MHD_OPTION_CONNECTION_LIMIT, 100, NULL @}, - @{ MHD_OPTION_CONNECTION_TIMEOUT, 10, NULL @}, - @{ MHD_OPTION_END, 0, NULL @} -@}; -d = MHD_start_daemon(0, 8080, NULL, NULL, dh, NULL, - MHD_OPTION_ARRAY, ops, - MHD_OPTION_END); -@end example -For options that expect a single pointer argument, the -second member of the @code{struct MHD_OptionItem} is ignored. -For options that expect two pointer arguments, the first -argument must be cast to @code{intptr_t}. - -@item MHD_OPTION_UNESCAPE_CALLBACK -@cindex internationalization -@cindex escaping - -Specify a function that should be called for unescaping escape -sequences in URIs and URI arguments. Note that this function will NOT -be used by the MHD_PostProcessor. If this option is not specified, -the default method will be used which decodes escape sequences of the -form "%HH". This option should be followed by two arguments, the -first one must be of the form - -@example - size_t my_unescaper(void * cls, struct MHD_Connection *c, char *s) -@end example - -where the return value must be @code{strlen(s)} and @code{s} should be -updated. Note that the unescape function must not lengthen @code{s} -(the result must be shorter than the input and still be 0-terminated). -@code{cls} will be set to the second argument following -MHD_OPTION_UNESCAPE_CALLBACK. - - -@item MHD_OPTION_THREAD_STACK_SIZE -@cindex stack -@cindex thread -@cindex pthread -@cindex embedded systems -Maximum stack size for threads created by MHD. This option must be -followed by a @code{size_t}). Not specifying this option or using -a value of zero means using the system default (which is likely to -differ based on your platform). - -@item MHD_OPTION_TCP_FASTQUEUE_QUEUE_SIZE -@cindex listen -When the flag @code{MHD_USE_TCP_FASTOPEN} is used, this option sets the -connection handshake queue size for the TCP FASTOPEN connections. Note -that a TCP FASTOPEN connection handshake occupies more resources than a -TCP handshake as the SYN packets also contain DATA which is kept in the -associate state until handshake is completed. If this option is not -given the queue size is set to a default value of 10. This option must -be followed by a @code{unsigned int}. - -@item MHD_OPTION_HTTPS_MEM_DHPARAMS -@cindex TLS -@cindex SSL -@cindex DH -Memory pointer for the Diffie-Hellman parameters (dh.pem) to be used -by the HTTPS daemon for key exchange. This option must be followed by -a @code{const char *} argument. The argument would be a zero-terminated -string with a PEM encoded PKCS3 DH parameters structure suitable -for passing to @code{gnutls_dh_parms_import_pkcs3}. - -@item MHD_OPTION_LISTENING_ADDRESS_REUSE -@cindex bind, restricting bind -@cindex reusing listening address -This option must be followed by a @code{unsigned int} argument. -If this option is present and true (nonzero) parameter is given, allow reusing -the address:port of the listening socket (using @code{SO_REUSEPORT} on most -platforms, and @code{SO_REUSEADDR} on Windows). If a false (zero) parameter is -given, disallow reusing the the address:port of the listening socket (this -usually requires no special action, but @code{SO_EXCLUSIVEADDRUSE} is needed on -Windows). If this option is not present @code{SO_REUSEADDR} is used on all -platforms except Windows so reusing of address:port is disallowed. - -@end table -@end deftp - - -@deftp {C Struct} MHD_OptionItem -Entry in an MHD_OPTION_ARRAY. See the @code{MHD_OPTION_ARRAY} option -argument for its use. - -The @code{option} member is used to specify which option is specified -in the array. The other members specify the respective argument. - -Note that for options taking only a single pointer, the -@code{ptr_value} member should be set. For options taking two pointer -arguments, the first pointer must be cast to @code{intptr_t} and both -the @code{value} and the @code{ptr_value} members should be used to -pass the two pointers. -@end deftp - - -@deftp {Enumeration} MHD_ValueKind -The @code{MHD_ValueKind} specifies the source of the key-value pairs in -the HTTP protocol. - -@table @code -@item MHD_HEADER_KIND -HTTP header. - -@item MHD_COOKIE_KIND -@cindex cookie -Cookies. Note that the original HTTP header containing the cookie(s) -will still be available and intact. - -@item MHD_POSTDATA_KIND -@cindex POST method -@code{POST} data. This is available only if a content encoding -supported by MHD is used (currently only @acronym{URL} encoding), and -only if the posted content fits within the available memory pool. Note -that in that case, the upload data given to the -@code{MHD_AccessHandlerCallback()} will be empty (since it has -already been processed). - -@item MHD_GET_ARGUMENT_KIND -@code{GET} (URI) arguments. - -@item MHD_FOOTER_KIND -HTTP footer (only for http 1.1 chunked encodings). - -@end table -@end deftp - - -@deftp {Enumeration} MHD_RequestTerminationCode -The @code{MHD_RequestTerminationCode} specifies reasons why a request -has been terminated (or completed). - -@table @code -@item MHD_REQUEST_TERMINATED_COMPLETED_OK -We finished sending the response. - -@item MHD_REQUEST_TERMINATED_WITH_ERROR -Error handling the connection (resources exhausted, other side closed -connection, application error accepting request, etc.) - -@item MHD_REQUEST_TERMINATED_TIMEOUT_REACHED -No activity on the connection for the number of seconds specified using -@code{MHD_OPTION_CONNECTION_TIMEOUT}. - -@item MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN -We had to close the session since MHD was being shut down. -@end table -@end deftp - - -@deftp {Enumeration} MHD_ResponseMemoryMode -The @code{MHD_ResponeMemoryMode} specifies how MHD should treat -the memory buffer given for the response in -@code{MHD_create_response_from_buffer}. - -@table @code -@item MHD_RESPMEM_PERSISTENT -Buffer is a persistent (static/global) buffer that won't change -for at least the lifetime of the response, MHD should just use -it, not free it, not copy it, just keep an alias to it. - -@item MHD_RESPMEM_MUST_FREE -Buffer is heap-allocated with @code{malloc} (or equivalent) and -should be freed by MHD after processing the response has -concluded (response reference counter reaches zero). - -@item MHD_RESPMEM_MUST_COPY -Buffer is in transient memory, but not on the heap (for example, -on the stack or non-malloc allocated) and only valid during the -call to @code{MHD_create_response_from_buffer}. MHD must make its -own private copy of the data for processing. - -@end table -@end deftp - - -@deftp {Enumeration} MHD_ResponseFlags -Response-specific flags. Passed as an argument to -@code{MHD_set_response_options()}. - -@table @code -@item MHD_RF_NONE -No special handling. - -@item MHD_RF_HTTP_VERSION_1_0_ONLY -Only respond in conservative HTTP 1.0-mode. In particular, -do not (automatically) sent "Connection" headers and always -close the connection after generating the response. - -By default, MHD will respond using the same HTTP version which -was set in the request. You can also set the -@code{MHD_RF_HTTP_VERSION_1_0_RESPONSE} flag to force version 1.0 -in the response. - -@item MHD_RF_HTTP_VERSION_1_0_RESPONSE -Only respond in HTTP 1.0-mode. Contrary to the -@code{MHD_RF_HTTP_VERSION_1_0_ONLY} flag, the response's HTTP version will -always be set to 1.0 and ``Connection'' headers are still supported. - -You can even combine this option with MHD_RF_HTTP_VERSION_1_0_ONLY to -change the response's HTTP version while maintaining strict compliance -with HTTP 1.0 regarding connection management. - -This solution is not perfect as this flag is set on the response which -is created after header processing. So MHD will behave as a HTTP 1.1 -server until the response is queued. It means that an invalid HTTP 1.1 -request will fail even if the response is sent with HTTP 1.0 and the -request would be valid if interpreted with this version. For example, -this request will fail in strict mode: - -@verbatim -GET / HTTP/1.1 -@end verbatim - -as the ``Host'' header is missing and is mandatory in HTTP 1.1, but it -should succeed when interpreted with HTTP 1.0. - -@item MHD_RF_INSANITY_HEADER_CONTENT_LENGTH -Disable sanity check preventing clients from manually -setting the HTTP content length option. - -@end table -@end deftp - - -@deftp {Enumeration} MHD_ResponseOptions -Response-specific options. Passed in the varargs portion of -@code{MHD_set_response_options()}. - -@table @code -@item MHD_RO_END -No more options / last option. This is used to terminate the VARARGs -list. -@end table -@end deftp - - -@deftp {Enumeration} MHD_WEBSOCKET_FLAG -@cindex websocket -Options for the MHD websocket stream. - -This is used for initialization of a websocket stream when calling -@code{MHD_websocket_stream_init} or @code{MHD_websocket_stream_init2} and -alters the behavior of the websocket stream. - -Note that websocket streams are only available if you include the header file -@code{microhttpd_ws.h} and compiled @emph{libmicrohttpd} with websockets. - -@table @code -@item MHD_WEBSOCKET_FLAG_SERVER -The websocket stream is initialized in server mode (default). -Thus all outgoing payload will not be masked. -All incoming payload must be masked. - -This flag cannot be used together with @code{MHD_WEBSOCKET_FLAG_CLIENT}. - -@item MHD_WEBSOCKET_FLAG_CLIENT -The websocket stream is initialized in client mode. -You will usually never use that mode in combination with @emph{libmicrohttpd}, -because @emph{libmicrohttpd} provides a server and not a client. -In client mode all outgoing payload will be masked -(XOR-ed with random values). -All incoming payload must be unmasked. -If you use this mode, you must always call @code{MHD_websocket_stream_init2} -instead of @code{MHD_websocket_stream_init}, because you need -to pass a random number generator callback function for masking. - -This flag cannot be used together with @code{MHD_WEBSOCKET_FLAG_SERVER}. - -@item MHD_WEBSOCKET_FLAG_NO_FRAGMENTS -You don't want to get fragmented data while decoding (default). -Fragmented frames will be internally put together until -they are complete. -Whether or not data is fragmented is decided -by the sender of the data during encoding. - -This cannot be used together with @code{MHD_WEBSOCKET_FLAG_WANT_FRAGMENTS}. - -@item MHD_WEBSOCKET_FLAG_WANT_FRAGMENTS -You want fragmented data, if it appears while decoding. -You will receive the content of the fragmented frame, -but if you are decoding text, you will never get an unfinished -UTF-8 sequence (if the sequence appears between two fragments). -Instead the text will end before the unfinished UTF-8 sequence. -With the next fragment, which finishes the UTF-8 sequence, -you will get the complete UTF-8 sequence. - -This cannot be used together with @code{MHD_WEBSOCKET_FLAG_NO_FRAGMENTS}. - -@item MHD_WEBSOCKET_FLAG_GENERATE_CLOSE_FRAMES_ON_ERROR -If the websocket stream becomes invalid during decoding due to -protocol errors, a matching close frame will automatically -be generated. -The close frame will be returned via the parameters -@code{payload} and @code{payload_len} of @code{MHD_websocket_decode} and -the return value is negative (a value of @code{enum MHD_WEBSOCKET_STATUS}). - -The generated close frame must be freed by the caller -with @code{MHD_websocket_free}. - -@end table -@end deftp - - -@deftp {Enumeration} MHD_WEBSOCKET_FRAGMENTATION -@cindex websocket -This enumeration is used to specify the fragmentation behavior -when encoding of data (text/binary) for a websocket stream. -This is used with @code{MHD_websocket_encode_text} or -@code{MHD_websocket_encode_binary}. - -Note that websocket streams are only available if you include the header file -@code{microhttpd_ws.h} and compiled @emph{libmicrohttpd} with websockets. - -@table @code -@item MHD_WEBSOCKET_FRAGMENTATION_NONE -You don't want to use fragmentation. -The encoded frame consists of only one frame. - -@item MHD_WEBSOCKET_FRAGMENTATION_FIRST -You want to use fragmentation. -The encoded frame is the first frame of -a series of data frames of the same type -(text or binary). -You may send control frames (ping, pong or close) -between these data frames. - -@item MHD_WEBSOCKET_FRAGMENTATION_FOLLOWING -You want to use fragmentation. -The encoded frame is not the first frame of -the series of data frames, but also not the last one. -You may send control frames (ping, pong or close) -between these data frames. - -@item MHD_WEBSOCKET_FRAGMENTATION_LAST -You want to use fragmentation. -The encoded frame is the last frame of -the series of data frames, but also not the first one. -After this frame, you may send all types of frames again. - -@end table -@end deftp - - -@deftp {Enumeration} MHD_WEBSOCKET_STATUS -@cindex websocket -This enumeration is used for the return value of almost -every websocket stream function. -Errors are negative and values equal to or above zero mean a success. -Positive values are only used by @code{MHD_websocket_decode}. - -Note that websocket streams are only available if you include the header file -@code{microhttpd_ws.h} and compiled @emph{libmicrohttpd} with websockets. - -@table @code -@item MHD_WEBSOCKET_STATUS_OK -The call succeeded. -Especially for @code{MHD_websocket_decode} this means that no error occurred, -but also no frame has been completed yet. -For other functions this means simply a success. - -@item MHD_WEBSOCKET_STATUS_TEXT_FRAME -@code{MHD_websocket_decode} has decoded a text frame. -The parameters @code{payload} and @code{payload_len} are filled with -the decoded text (if any). -You must free the returned @code{payload} after use with -@code{MHD_websocket_free}. - -@item MHD_WEBSOCKET_STATUS_BINARY_FRAME -@code{MHD_websocket_decode} has decoded a binary frame. -The parameters @code{payload} and @code{payload_len} are filled with -the decoded binary data (if any). -You must free the returned @code{payload} after use with -@code{MHD_websocket_free}. - -@item MHD_WEBSOCKET_STATUS_CLOSE_FRAME -@code{MHD_websocket_decode} has decoded a close frame. -This means you must close the socket using @code{MHD_upgrade_action} -with @code{MHD_UPGRADE_ACTION_CLOSE}. -You may respond with a close frame before closing. -The parameters @code{payload} and @code{payload_len} are filled with -the close reason (if any). -The close reason starts with a two byte sequence of close code -in network byte order (see @code{enum MHD_WEBSOCKET_CLOSEREASON}). -After these two bytes a UTF-8 encoded close reason may follow. -You can call @code{MHD_websocket_split_close_reason} to split that -close reason. -You must free the returned @code{payload} after use with -@code{MHD_websocket_free}. - -@item MHD_WEBSOCKET_STATUS_PING_FRAME -@code{MHD_websocket_decode} has decoded a ping frame. -You should respond to this with a pong frame. -The pong frame must contain the same binary data as -the corresponding ping frame (if it had any). -The parameters @code{payload} and @code{payload_len} are filled with -the binary ping data (if any). -You must free the returned @code{payload} after use with -@code{MHD_websocket_free}. - -@item MHD_WEBSOCKET_STATUS_PONG_FRAME -@code{MHD_websocket_decode} has decoded a pong frame. -You should usually only receive pong frames if you sent -a ping frame before. -The binary data should be equal to your ping frame and can be -used to distinguish the response if you sent multiple ping frames. -The parameters @code{payload} and @code{payload_len} are filled with -the binary pong data (if any). -You must free the returned @code{payload} after use with -@code{MHD_websocket_free}. - -@item MHD_WEBSOCKET_STATUS_TEXT_FIRST_FRAGMENT -@code{MHD_websocket_decode} has decoded a text frame fragment. -The parameters @code{payload} and @code{payload_len} are filled with -the decoded text (if any). -This is like @code{MHD_WEBSOCKET_STATUS_TEXT_FRAME}, but it can only -appear if you specified @code{MHD_WEBSOCKET_FLAG_WANT_FRAGMENTS} during -the call of @code{MHD_websocket_stream_init} or -@code{MHD_websocket_stream_init2}. -You must free the returned @code{payload} after use with -@code{MHD_websocket_free}. - -@item MHD_WEBSOCKET_STATUS_TEXT_FIRST_FRAGMENT -@code{MHD_websocket_decode} has decoded a binary frame fragment. -The parameters @code{payload} and @code{payload_len} are filled with -the decoded binary data (if any). -This is like @code{MHD_WEBSOCKET_STATUS_BINARY_FRAME}, but it can only -appear if you specified @code{MHD_WEBSOCKET_FLAG_WANT_FRAGMENTS} during -the call of @code{MHD_websocket_stream_init} or -@code{MHD_websocket_stream_init2}. -You must free the returned @code{payload} after use with -@code{MHD_websocket_free}. - -@item MHD_WEBSOCKET_STATUS_TEXT_NEXT_FRAGMENT -@code{MHD_websocket_decode} has decoded the next text frame fragment. -The parameters @code{payload} and @code{payload_len} are filled with -the decoded text (if any). -This is like @code{MHD_WEBSOCKET_STATUS_TEXT_FIRST_FRAGMENT}, but it appears -only after the first and before the last fragment of a series of fragments. -It can only appear if you specified @code{MHD_WEBSOCKET_FLAG_WANT_FRAGMENTS} -during the call of @code{MHD_websocket_stream_init} or -@code{MHD_websocket_stream_init2}. -You must free the returned @code{payload} after use with -@code{MHD_websocket_free}. - -@item MHD_WEBSOCKET_STATUS_BINARY_NEXT_FRAGMENT -@code{MHD_websocket_decode} has decoded the next binary frame fragment. -The parameters @code{payload} and @code{payload_len} are filled with -the decoded binary data (if any). -This is like @code{MHD_WEBSOCKET_STATUS_BINARY_FIRST_FRAGMENT}, but it appears -only after the first and before the last fragment of a series of fragments. -It can only appear if you specified @code{MHD_WEBSOCKET_FLAG_WANT_FRAGMENTS} -during the call of @code{MHD_websocket_stream_init} or -@code{MHD_websocket_stream_init2}. -You must free the returned @code{payload} after use with -@code{MHD_websocket_free}. - -@item MHD_WEBSOCKET_STATUS_TEXT_LAST_FRAGMENT -@code{MHD_websocket_decode} has decoded the last text frame fragment. -The parameters @code{payload} and @code{payload_len} are filled with -the decoded text (if any). -This is like @code{MHD_WEBSOCKET_STATUS_TEXT_FIRST_FRAGMENT}, but it appears -only for the last fragment of a series of fragments. -It can only appear if you specified @code{MHD_WEBSOCKET_FLAG_WANT_FRAGMENTS} -during the call of @code{MHD_websocket_stream_init} or -@code{MHD_websocket_stream_init2}. -You must free the returned @code{payload} after use with -@code{MHD_websocket_free}. - -@item MHD_WEBSOCKET_STATUS_BINARY_LAST_FRAGMENT -@code{MHD_websocket_decode} has decoded the last binary frame fragment. -The parameters @code{payload} and @code{payload_len} are filled with -the decoded binary data (if any). -This is like @code{MHD_WEBSOCKET_STATUS_BINARY_FIRST_FRAGMENT}, but it appears -only for the last fragment of a series of fragments. -It can only appear if you specified @code{MHD_WEBSOCKET_FLAG_WANT_FRAGMENTS} -during the call of @code{MHD_websocket_stream_init} or -@code{MHD_websocket_stream_init2}. -You must free the returned @code{payload} after use with -@code{MHD_websocket_free}. - -@item MHD_WEBSOCKET_STATUS_PROTOCOL_ERROR -The call failed and the stream is invalid now for decoding. -You must close the websocket now using @code{MHD_upgrade_action} -with @code{MHD_UPGRADE_ACTION_CLOSE}. -You may send a close frame before closing. -This is only used by @code{MHD_websocket_decode} and happens -if the stream contains errors (i. e. invalid byte data). - -@item MHD_WEBSOCKET_STATUS_STREAM_BROKEN -You tried to decode something, but the stream has already -been marked invalid. -You must close the websocket now using @code{MHD_upgrade_action} -with @code{MHD_UPGRADE_ACTION_CLOSE}. -You may send a close frame before closing. -This is only used by @code{MHD_websocket_decode} and happens -if you call @code{MDM_websocket_decode} again after -has been invalidated. -You can call @code{MHD_websocket_stream_is_valid} at any time -to check whether a stream is invalid or not. - -@item MHD_WEBSOCKET_STATUS_MEMORY_ERROR -A memory allocation failed. The stream remains valid. -If this occurred while decoding, the decoding could be -possible later if enough memory is available. -This could happen while decoding if you received a too big data frame. -You could try to specify max_payload_size during the call of -@code{MHD_websocket_stream_init} or @code{MHD_websocket_stream_init2} to -avoid this and close the websocket instead. - -@item MHD_WEBSOCKET_STATUS_PARAMETER_ERROR -You passed invalid parameters during the function call -(i. e. a NULL pointer for a required parameter). -The stream remains valid. - -@item MHD_WEBSOCKET_STATUS_MAXIMUM_SIZE_EXCEEDED -The maximum payload size has been exceeded. -If you got this return code from @code{MHD_websocket_decode} then -the stream becomes invalid and the websocket must be closed -using @code{MHD_upgrade_action} with @code{MHD_UPGRADE_ACTION_CLOSE}. -You may send a close frame before closing. -The maximum payload size is specified during the call of -@code{MHD_websocket_stream_init} or @code{MHD_websocket_stream_init2}. -This can also appear if you specified 0 as maximum payload size -when the message is greater than the maximum allocatable memory size -(i. e. more than 4 GiB on 32 bit systems). -If you got this return code from @code{MHD_websocket_encode_close}, -@code{MHD_websocket_encode_ping} or @code{MHD_websocket_encode_pong} then -you passed to much payload data. The stream remains valid then. - -@item MHD_WEBSOCKET_STATUS_UTF8_ENCODING_ERROR -An UTF-8 sequence is invalid. -If you got this return code from @code{MHD_websocket_decode} then -the stream becomes invalid and you must close the websocket -using @code{MHD_upgrade_action} with @code{MHD_UPGRADE_ACTION_CLOSE}. -You may send a close frame before closing. -If you got this from @code{MHD_websocket_encode_text} or -@code{MHD_websocket_encode_close} then you passed invalid UTF-8 text. -The stream remains valid then. - -@item MHD_WEBSOCKET_STATUS_NO_WEBSOCKET_HANDSHAKE_HEADER -A check routine for the HTTP headers came to the conclusion that -the header value isn't valid for a websocket handshake request. -This value can only be returned from the following functions: -@code{MHD_websocket_check_http_version}, -@code{MHD_websocket_check_connection_header}, -@code{MHD_websocket_check_upgrade_header}, -@code{MHD_websocket_check_version_header}, -@code{MHD_websocket_create_accept_header} - -@end table -@end deftp - - -@deftp {Enumeration} MHD_WEBSOCKET_CLOSEREASON -@cindex websocket -Enumeration of possible close reasons for websocket close frames. - -The possible values are specified in RFC 6455 7.4.1 -These close reasons here are the default set specified by RFC 6455, -but also other close reasons could be used. - -The definition is for short: -@itemize @bullet -@item 0-999 are never used (if you pass 0 in -@code{MHD_websocket_encode_close} then no close reason is used). -@item 1000-2999 are specified by RFC 6455. -@item 3000-3999 are specified by libraries, etc. but must be registered by IANA. -@item 4000-4999 are reserved for private use. -@end itemize - -Note that websocket streams are only available if you include the header file -@code{microhttpd_ws.h} and compiled @emph{libmicrohttpd} with websockets. - -@table @code -@item MHD_WEBSOCKET_CLOSEREASON_NO_REASON -This value is used as placeholder for @code{MHD_websocket_encode_close} -to tell that you don't want to specify any reason. -If you use this value then no reason text may be used. -This value cannot be a result of decoding, because this value -is not a valid close reason for the websocket protocol. - -@item MHD_WEBSOCKET_CLOSEREASON_REGULAR -You close the websocket because it fulfilled its purpose and shall -now be closed in a normal, planned way. - -@item MHD_WEBSOCKET_CLOSEREASON_GOING_AWAY -You close the websocket because you are shutting down the server or -something similar. - -@item MHD_WEBSOCKET_CLOSEREASON_PROTOCOL_ERROR -You close the websocket because a protocol error occurred -during decoding (i. e. invalid byte data). - -@item MHD_WEBSOCKET_CLOSEREASON_UNSUPPORTED_DATATYPE -You close the websocket because you received data which you don't accept. -For example if you received a binary frame, -but your application only expects text frames. - -@item MHD_WEBSOCKET_CLOSEREASON_MALFORMED_UTF8 -You close the websocket because it contains malformed UTF-8. -The UTF-8 validity is automatically checked by @code{MHD_websocket_decode}, -so you don't need to check it on your own. -UTF-8 is specified in RFC 3629. - -@item MHD_WEBSOCKET_CLOSEREASON_POLICY_VIOLATED -You close the websocket because you received a frame which is too big -to process. -You can specify the maximum allowed payload size during the call of -@code{MHD_websocket_stream_init} or @code{MHD_websocket_stream_init2}. - -@item MHD_WEBSOCKET_CLOSEREASON_MISSING_EXTENSION -This status code can be sent by the client if it -expected a specific extension, but this extension hasn't been negotiated. - -@item MHD_WEBSOCKET_CLOSEREASON_UNEXPECTED_CONDITION -The server closes the websocket because it encountered -an unexpected condition that prevented it from fulfilling the request. - -@end table -@end deftp - - -@deftp {Enumeration} MHD_WEBSOCKET_UTF8STEP -@cindex websocket -Enumeration of possible UTF-8 check steps for websocket functions - -These values are used during the encoding of fragmented text frames -or for error analysis while encoding text frames. -Its values specify the next step of the UTF-8 check. -UTF-8 sequences consist of one to four bytes. -This enumeration just says how long the current UTF-8 sequence is -and what is the next expected byte. - -Note that websocket streams are only available if you include the header file -@code{microhttpd_ws.h} and compiled @emph{libmicrohttpd} with websockets. - -@table @code -@item MHD_WEBSOCKET_UTF8STEP_NORMAL -There is no open UTF-8 sequence. -The next byte must be 0x00-0x7F or 0xC2-0xF4. - -@item MHD_WEBSOCKET_UTF8STEP_UTF2TAIL_1OF1 -The second byte of a two byte UTF-8 sequence. -The first byte was 0xC2-0xDF. -The next byte must be 0x80-0xBF. - -@item MHD_WEBSOCKET_UTF8STEP_UTF3TAIL1_1OF2 -The second byte of a three byte UTF-8 sequence. -The first byte was 0xE0. -The next byte must be 0xA0-0xBF. - -@item MHD_WEBSOCKET_UTF8STEP_UTF3TAIL2_1OF2 -The second byte of a three byte UTF-8 sequence. -The first byte was 0xED. -The next byte must by 0x80-0x9F. - -@item MHD_WEBSOCKET_UTF8STEP_UTF3TAIL_1OF2 -The second byte of a three byte UTF-8 sequence. -The first byte was 0xE1-0xEC or 0xEE-0xEF. -The next byte must be 0x80-0xBF. - -@item MHD_WEBSOCKET_UTF8STEP_UTF3TAIL_2OF2 -The third byte of a three byte UTF-8 sequence. -The next byte must be 0x80-0xBF. - -@item MHD_WEBSOCKET_UTF8STEP_UTF4TAIL1_1OF3 -The second byte of a four byte UTF-8 sequence. -The first byte was 0xF0. -The next byte must be 0x90-0xBF. - -@item MHD_WEBSOCKET_UTF8STEP_UTF4TAIL2_1OF3 -The second byte of a four byte UTF-8 sequence. -The first byte was 0xF4. -The next byte must be 0x80-0x8F. - -@item MHD_WEBSOCKET_UTF8STEP_UTF4TAIL_1OF3 -The second byte of a four byte UTF-8 sequence. -The first byte was 0xF1-0xF3. -The next byte must be 0x80-0xBF. - -@item MHD_WEBSOCKET_UTF8STEP_UTF4TAIL_2OF3 -The third byte of a four byte UTF-8 sequence. -The next byte must be 0x80-0xBF. - -@item MHD_WEBSOCKET_UTF8STEP_UTF4TAIL_3OF3 -The fourth byte of a four byte UTF-8 sequence. -The next byte must be 0x80-0xBF. - -@end table -@end deftp - - -@deftp {Enumeration} MHD_WEBSOCKET_VALIDITY -@cindex websocket -Enumeration of validity values of a websocket stream - -These values are used for @code{MHD_websocket_stream_is_valid} -and specify the validity status. - -Note that websocket streams are only available if you include the header file -@code{microhttpd_ws.h} and compiled @emph{libmicrohttpd} with websockets. - -@table @code -@item MHD_WEBSOCKET_VALIDITY_INVALID -The stream is invalid. -It cannot be used for decoding anymore. - -@item MHD_WEBSOCKET_VALIDITY_VALID -The stream is valid. -Decoding works as expected. - -@item MHD_WEBSOCKET_VALIDITY_ONLY_VALID_FOR_CONTROL_FRAMES -The stream has received a close frame and -is partly invalid. -You can still use the stream for decoding, -but if a data frame is received an error will be reported. -After a close frame has been sent, no data frames -may follow from the sender of the close frame. - -@end table -@end deftp - - -@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -@c ------------------------------------------------------------ -@node microhttpd-struct -@chapter Structures type definition - - -@deftp {C Struct} MHD_Daemon -Handle for the daemon (listening on a socket for HTTP traffic). -@end deftp - - -@deftp {C Struct} MHD_Connection -Handle for a connection / HTTP request. With HTTP/1.1, multiple -requests can be run over the same connection. However, MHD will only -show one request per TCP connection to the client at any given time. -@end deftp - - -@deftp {C Struct} MHD_Response -Handle for a response. -@end deftp - - -@deftp {C Struct} MHD_IoVec -An element of an array of memory buffers. -@end deftp - - -@deftp {C Struct} MHD_PostProcessor -@cindex POST method -Handle for @code{POST} processing. -@end deftp - - -@deftp {C Union} MHD_ConnectionInfo -Information about a connection. -@end deftp - - -@deftp {C Union} MHD_DaemonInfo -Information about an MHD daemon. -@end deftp - - -@deftp {C Struct} MHD_WebSocketStream -@cindex websocket -Information about a MHD websocket stream. -@end deftp - - -@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -@c ------------------------------------------------------------ -@node microhttpd-cb -@chapter Callback functions definition - - -@deftypefn {Function Pointer} enum MHD_Result {*MHD_AcceptPolicyCallback} (void *cls, const struct sockaddr * addr, socklen_t addrlen) -Invoked in the context of a connection to allow or deny a client to -connect. This callback return @code{MHD_YES} if connection is allowed, -@code{MHD_NO} if not. - -@table @var -@item cls -custom value selected at callback registration time; -@item addr -address information from the client; -@item addrlen -length of the address information. -@end table -@end deftypefn - - -@deftypefn {Function Pointer} enum MHD_Result {*MHD_AccessHandlerCallback} (void *cls, struct MHD_Connection * connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **req_cls) -Invoked in the context of a connection to answer a request from the -client. This callback must call MHD functions (example: the -@code{MHD_Response} ones) to provide content to give back to the client -and return an HTTP status code (i.e. @code{200} for OK, @code{404}, -etc.). - -@ref{microhttpd-post}, for details on how to code this callback. - -Must return @code{MHD_YES} if the connection was handled successfully, -@code{MHD_NO} if the socket must be closed due to a serious error while -handling the request - -@table @var -@item cls -custom value selected at callback registration time; - -@item url -the URL requested by the client; - -@item method -the HTTP method used by the client (@code{GET}, @code{PUT}, -@code{DELETE}, @code{POST}, etc.); - -@item version -the HTTP version string (i.e. @code{HTTP/1.1}); - -@item upload_data -the data being uploaded (excluding headers): -@cindex POST method -@cindex PUT method - -@code{POST} data @strong{will} be made available -incrementally in @var{upload_data}; even if @code{POST} -data is available, the first time the callback is -invoked there won't be upload data, as this is done -just after MHD parses the headers. If supported by -the client and the HTTP version, the application can -at this point queue an error response to possibly -avoid the upload entirely. If no response is generated, -MHD will (if required) automatically send a 100 CONTINUE -reply to the client. - -Afterwards, POST data will be passed to the callback -to be processed incrementally by the application. The -application may return @code{MHD_NO} to forcefully -terminate the TCP connection without generating a -proper HTTP response. Once all of the upload data has -been provided to the application, the application -will be called again with 0 bytes of upload data. -At this point, a response should be queued to complete -the handling of the request. - -@item upload_data_size -set initially to the size of the @var{upload_data} provided; this -callback must update this value to the number of bytes @strong{NOT} -processed; unless external select is used, the callback maybe -required to process at least some data. If the callback fails to -process data in multi-threaded or internal-select mode and if the -read-buffer is already at the maximum size that MHD is willing to -use for reading (about half of the maximum amount of memory allowed -for the connection), then MHD will abort handling the connection -and return an internal server error to the client. In order to -avoid this, clients must be able to process upload data incrementally -and reduce the value of @code{upload_data_size}. - -@item req_cls -reference to a pointer, initially set to @code{NULL}, that this callback can -set to some address and that will be preserved by MHD for future -calls for this request; - -since the access handler may be called many times (i.e., for a -@code{PUT}/@code{POST} operation with plenty of upload data) this allows -the application to easily associate some request-specific state; - -if necessary, this state can be cleaned up in the global -@code{MHD_RequestCompletedCallback} (which can be set with the -@code{MHD_OPTION_NOTIFY_COMPLETED}). -@end table -@end deftypefn - - -@deftypefn {Function Pointer} void {*MHD_RequestCompletedCallback} (void *cls, struct MHD_Connectionconnection, void **req_cls, enum MHD_RequestTerminationCode toe) -Signature of the callback used by MHD to notify the application about -completed requests. - -@table @var -@item cls -custom value selected at callback registration time; - -@item connection -connection handle; - -@item req_cls -value as set by the last call to the -@code{MHD_AccessHandlerCallback}; - -@item toe -reason for request termination see @code{MHD_OPTION_NOTIFY_COMPLETED}. -@end table -@end deftypefn - - -@deftypefn {Function Pointer} enum MHD_Result {*MHD_KeyValueIterator} (void *cls, enum MHD_ValueKind kind, const char *key, const char *value, size_t value_size) -Iterator over key-value pairs. This iterator can be used to iterate -over all of the cookies, headers, or @code{POST}-data fields of a -request, and also to iterate over the headers that have been added to a -response. - -@table @var -@item cls -custom value specified when iteration was triggered; - -@item kind -kind of the header we are looking at - -@item key -key for the value, can be an empty string - -@item value -value corresponding value, can be NULL - -@item value_size -number of bytes in @code{value}. This argument was introduced in -@code{MHD_VERSION} 0x00096301 to allow applications to use binary -zeros in values. Applications using this argument must ensure that -they are using a sufficiently recent version of MHD, i.e. by testing -@code{MHD_get_version()} for values above or equal to 0.9.64. -Applications that do not need zeros in values and that want to compile -without warnings against newer versions of MHD should not declare this -argument and cast the function pointer argument to -@code{MHD_KeyValueIterator}. - -@end table - -Return @code{MHD_YES} to continue iterating, @code{MHD_NO} to abort the -iteration. -@end deftypefn - - -@deftypefn {Function Pointer} ssize_t {*MHD_ContentReaderCallback} (void *cls, uint64_t pos, char *buf, size_t max) -Callback used by MHD in order to obtain content. The callback has to -copy at most @var{max} bytes of content into @var{buf}. The total -number of bytes that has been placed into @var{buf} should be returned. - -Note that returning zero will cause MHD to try again. -Thus, returning zero should only be used in conjunction -with @code{MHD_suspend_connection()} to avoid busy waiting. - -While usually the callback simply returns the number of bytes written -into @var{buf}, there are two special return value: - -@code{MHD_CONTENT_READER_END_OF_STREAM} (-1) should be returned -for the regular end of transmission (with chunked encoding, MHD will then -terminate the chunk and send any HTTP footers that might be -present; without chunked encoding and given an unknown -response size, MHD will simply close the connection; note -that while returning @code{MHD_CONTENT_READER_END_OF_STREAM} is not technically -legal if a response size was specified, MHD accepts this -and treats it just as @code{MHD_CONTENT_READER_END_WITH_ERROR}. - -@code{MHD_CONTENT_READER_END_WITH_ERROR} (-2) is used to indicate a server -error generating the response; this will cause MHD to simply -close the connection immediately. If a response size was -given or if chunked encoding is in use, this will indicate -an error to the client. Note, however, that if the client -does not know a response size and chunked encoding is not in -use, then clients will not be able to tell the difference between -@code{MHD_CONTENT_READER_END_WITH_ERROR} and -@code{MHD_CONTENT_READER_END_OF_STREAM}. -This is not a limitation of MHD but rather of the HTTP protocol. - -@table @var -@item cls -custom value selected at callback registration time; - -@item pos -position in the datastream to access; note that if an -@code{MHD_Response} object is re-used, it is possible for the same -content reader to be queried multiple times for the same data; however, -if an @code{MHD_Response} is not re-used, MHD guarantees that -@var{pos} will be the sum of all non-negative return values obtained -from the content reader so far. -@end table - -Return @code{-1} on error (MHD will no longer try to read content and -instead close the connection with the client). -@end deftypefn - - -@deftypefn {Function Pointer} void {*MHD_ContentReaderFreeCallback} (void *cls) -This method is called by MHD if we are done with a content reader. -It should be used to free resources associated with the content reader. -@end deftypefn - - -@deftypefn {Function Pointer} enum MHD_Result {*MHD_PostDataIterator} (void *cls, enum MHD_ValueKind kind, const char *key, const char *filename, const char *content_type, const char *transfer_encoding, const char *data, uint64_t off, size_t size) -Iterator over key-value pairs where the value maybe made available in -increments and/or may not be zero-terminated. Used for processing -@code{POST} data. - -@table @var -@item cls -custom value selected at callback registration time; - -@item kind -type of the value; - -@item key -zero-terminated key for the value; - -@item filename -name of the uploaded file, @code{NULL} if not known; - -@item content_type -mime-type of the data, @code{NULL} if not known; - -@item transfer_encoding -encoding of the data, @code{NULL} if not known; - -@item data -pointer to size bytes of data at the specified offset; - -@item off -offset of data in the overall value; - -@item size -number of bytes in data available. -@end table - -Return @code{MHD_YES} to continue iterating, @code{MHD_NO} to abort the -iteration. -@end deftypefn - - -@deftypefn {Function Pointer} void* {*MHD_WebSocketMallocCallback} (size_t buf_len) -@cindex websocket -This callback function is used internally by many websocket functions -for allocating data. -By default @code{malloc} is used. -You can use your own allocation function with @code{MHD_websocket_stream_init2} -if you wish to. -This can be useful for operating systems like Windows -where @code{malloc}, @code{realloc} and @code{free} are compiler-dependent. -You can call the associated @code{malloc} callback of -a websocket stream with @code{MHD_websocket_malloc}. - -@table @var -@item buf_len -size of the buffer to allocate in bytes. -@end table - -Return the pointer of the allocated buffer or @code{NULL} on failure. -@end deftypefn - - -@deftypefn {Function Pointer} void* {*MHD_WebSocketReallocCallback} (void *buf, size_t new_buf_len) -@cindex websocket -This callback function is used internally by many websocket -functions for reallocating data. -By default @code{realloc} is used. -You can use your own reallocation function with -@code{MHD_websocket_stream_init2} if you wish to. -This can be useful for operating systems like Windows -where @code{malloc}, @code{realloc} and @code{free} are compiler-dependent. -You can call the associated @code{realloc} callback of -a websocket stream with @code{MHD_websocket_realloc}. - -@table @var -@item buf -current buffer, may be @code{NULL}; - -@item new_buf_len -new size of the buffer in bytes. -@end table - -Return the pointer of the reallocated buffer or @code{NULL} on failure. -On failure the old pointer must remain valid. -@end deftypefn - - -@deftypefn {Function Pointer} void {*MHD_WebSocketFreeCallback} (void *buf) -@cindex websocket -This callback function is used internally by many websocket -functions for freeing data. -By default @code{free} is used. -You can use your own free function with -@code{MHD_websocket_stream_init2} if you wish to. -This can be useful for operating systems like Windows -where @code{malloc}, @code{realloc} and @code{free} are compiler-dependent. -You can call the associated @code{free} callback of -a websocket stream with @code{MHD_websocket_free}. - -@table @var -@item cls -current buffer to free, this may be @code{NULL} then nothing happens. -@end table -@end deftypefn - - -@deftypefn {Function Pointer} size_t {*MHD_WebSocketRandomNumberGenerator} (void *cls, void* buf, size_t buf_len) -@cindex websocket -This callback function is used for generating random numbers -for masking payload data in client mode. -If you use websockets in server mode with @emph{libmicrohttpd} then -you don't need a random number generator, because -the server doesn't mask its outgoing messages. -However if you wish to use a websocket stream in client mode, -you must pass this callback function to @code{MHD_websocket_stream_init2}. - -@table @var -@item cls -closure specified in @code{MHD_websocket_stream_init2}; -@item buf -buffer to fill with random values; -@item buf_len -size of buffer in bytes. -@end table - -Return the number of generated random bytes. -The return value should usually equal to buf_len. -@end deftypefn - - -@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -@c ------------------------------------------------------------ -@node microhttpd-init -@chapter Starting and stopping the server - -@deftypefun {void} MHD_set_panic_func (MHD_PanicCallback cb, void *cls) -Set a handler for fatal errors. - -@table @var -@item cb -function to call if MHD encounters a fatal internal error. If no handler was set explicitly, MHD will call @code{abort}. - -@item cls -closure argument for cb; the other arguments are the name of the source file, line number and a string describing the nature of the fatal error (which can be @code{NULL}) -@end table -@end deftypefun - -@deftypefun {struct MHD_Daemon *} MHD_start_daemon (unsigned int flags, unsigned short port, MHD_AcceptPolicyCallback apc, void *apc_cls, MHD_AccessHandlerCallback dh, void *dh_cls, ...) -Start a webserver on the given port. - -@table @var -@item flags -OR-ed combination of @code{MHD_FLAG} values; - -@item port -port to bind to; - -@item apc -callback to call to check which clients will be allowed to connect; you -can pass @code{NULL} in which case connections from any @acronym{IP} will be -accepted; - -@item apc_cls -extra argument to @var{apc}; - -@item dh -default handler for all URIs; - -@item dh_cls -extra argument to @var{dh}. -@end table - -Additional arguments are a list of options (type-value pairs, -terminated with @code{MHD_OPTION_END}). It is mandatory to use -@code{MHD_OPTION_END} as last argument, even when there are no -additional arguments. - -Return @code{NULL} on error, handle to daemon on success. -@end deftypefun - - -@deftypefun MHD_socket MHD_quiesce_daemon (struct MHD_Daemon *daemon) -@cindex quiesce -Stop accepting connections from the listening socket. Allows clients -to continue processing, but stops accepting new connections. Note -that the caller is responsible for closing the returned socket; -however, if MHD is run using threads (anything but external select -mode), it must not be closed until AFTER @code{MHD_stop_daemon} has -been called (as it is theoretically possible that an existing thread -is still using it). - -This function is useful in the special case that a listen socket -is to be migrated to another process (i.e. a newer version of the -HTTP server) while existing connections should continue to be -processed until they are finished. - -Return @code{-1} on error (daemon not listening), the handle to the -listen socket otherwise. - -@end deftypefun - - -@deftypefun void MHD_stop_daemon (struct MHD_Daemon *daemon) -Shutdown an HTTP daemon. -@end deftypefun - - -@deftypefun enum MHD_Result MHD_run (struct MHD_Daemon *daemon) -Run webserver operations (without blocking unless in client callbacks). -This method should be called by clients in combination with -@code{MHD_get_fdset()} if the client-controlled @code{select}-method is used. -@cindex select -@cindex poll - -This function will work for external @code{poll} and @code{select} mode. -However, if using external @code{select} mode, you may want to -instead use @code{MHD_run_from_select}, as it is more efficient. - -@table @var -@item daemon -daemon to process connections of -@end table - -Return @code{MHD_YES} on success, @code{MHD_NO} if this daemon was not -started with the right options for this call. -@end deftypefun - - -@deftypefun enum MHD_Result MHD_run_from_select (struct MHD_Daemon *daemon, const fd_set *read_fd_set, const fd_set *write_fd_set, const fd_set *except_fd_set) -Run webserver operations given sets of ready socket handles. -@cindex select - -This method should be called by clients in combination with -@code{MHD_get_fdset} if the client-controlled (external) -select method is used. - -You can use this function instead of @code{MHD_run} if you called -@code{select} on the result from @code{MHD_get_fdset}. File descriptors in -the sets that are not controlled by MHD will be ignored. Calling -this function instead of @code{MHD_run} is more efficient as MHD will -not have to call @code{select} again to determine which operations are -ready. - -@table @var -@item daemon -daemon to process connections of -@item read_fd_set -set of descriptors that must be ready for reading without blocking -@item write_fd_set -set of descriptors that must be ready for writing without blocking -@item except_fd_set -ignored, can be NULL -@end table - -Return @code{MHD_YES} on success, @code{MHD_NO} on serious internal -errors. - -@end deftypefun - - - -@deftypefun void MHD_add_connection (struct MHD_Daemon *daemon, int client_socket, const struct sockaddr *addr, socklen_t addrlen) -Add another client connection to the set of connections -managed by MHD. This API is usually not needed (since -MHD will accept inbound connections on the server socket). -Use this API in special cases, for example if your HTTP -server is behind NAT and needs to connect out to the -HTTP client, or if you are building a proxy. - -If you use this API in conjunction with a internal select or a thread -pool, you must set the option @code{MHD_USE_ITC} to -ensure that the freshly added connection is immediately processed by -MHD. - -The given client socket will be managed (and closed!) by MHD after -this call and must no longer be used directly by the application -afterwards. - -@table @var -@item daemon -daemon that manages the connection -@item client_socket -socket to manage (MHD will expect to receive an HTTP request from this socket next). -@item addr -IP address of the client -@item addrlen -number of bytes in addr -@end table - -This function will return @code{MHD_YES} on success, -@code{MHD_NO} if this daemon could -not handle the connection (i.e. malloc failed, etc). -The socket will be closed in any case; 'errno' is set -to indicate further details about the error. -@end deftypefun - - -@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -@c ----------------------------------------------------------- -@node microhttpd-inspect -@chapter Implementing external @code{select} - - -@deftypefun enum MHD_Result MHD_get_fdset (struct MHD_Daemon *daemon, fd_set * read_fd_set, fd_set * write_fd_set, fd_set * except_fd_set, int *max_fd) -Obtain the @code{select()} sets for this daemon. The daemon's socket -is added to @var{read_fd_set}. The list of currently existent -connections is scanned and their file descriptors added to the correct -set. - -When calling this function, FD_SETSIZE is assumed to be platform's -default. If you changed FD_SETSIZE for your application, -you should use @code{MHD_get_fdset2()} instead. - -This function should only be called in when MHD is configured to use -external select with @code{select()} or with @code{epoll()}. In -the latter case, it will only add the single @code{epoll()} file -descriptor used by MHD to the sets. - -After the call completed successfully: the variable referenced by -@var{max_fd} references the file descriptor with highest integer -identifier. The variable must be set to zero before invoking this -function. - -Return @code{MHD_YES} on success, @code{MHD_NO} if: the arguments are -invalid (example: @code{NULL} pointers); this daemon was not started with -the right options for this call. -@end deftypefun - - -@deftypefun enum MHD_Result MHD_get_fdset2 (struct MHD_Daemon *daemon, fd_set * read_fd_set, fd_set * write_fd_set, fd_set * except_fd_set, int *max_fd, unsigned int fd_setsize) -Like @code{MHD_get_fdset()}, except that you can manually specify the value of FD_SETSIZE used by your application. -@end deftypefun - - -@deftypefun enum MHD_Result MHD_get_timeout (struct MHD_Daemon *daemon, unsigned long long *timeout) -@cindex timeout -Obtain timeout value for select for this daemon (only needed if -connection timeout is used). The returned value is how many -milliseconds @code{select} should at most block, not the timeout value -set for connections. This function must not be called if the -@code{MHD_USE_THREAD_PER_CONNECTION} mode is in use (since then it is -not meaningful to ask for a timeout, after all, there is concurrenct -activity). The function must also not be called by user-code if -@code{MHD_USE_INTERNAL_POLLING_THREAD} is in use. In the latter case, the -behavior is undefined. - -@table @var -@item daemon -which daemon to obtain the timeout from. -@item timeout -will be set to the timeout (in milliseconds). -@end table - -Return @code{MHD_YES} on success, @code{MHD_NO} if timeouts are not used -(or no connections exist that would necessitate the use of a timeout -right now). -@end deftypefun - - -@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -@c ----------------------------------------------------------- -@node microhttpd-requests -@chapter Handling requests - - -@deftypefun int MHD_get_connection_values (struct MHD_Connection *connection, enum MHD_ValueKind kind, MHD_KeyValueIterator iterator, void *iterator_cls) -Get all the headers matching @var{kind} from the request. The @var{kind} -argument can be a bitmask, ORing the various header kinds that are -requested. - -The @var{iterator} callback is invoked once for each header, with -@var{iterator_cls} as first argument. After version 0.9.19, the -headers are iterated in the same order as they were received from -the network; previous versions iterated over the headers in reverse -order. - -@code{MHD_get_connection_values} returns the number of entries -iterated over; this can be less than the number of headers if, while -iterating, @var{iterator} returns @code{MHD_NO}. - -@var{iterator} can be @code{NULL}: in this case this function just counts -and returns the number of headers. - -In the case of @code{MHD_GET_ARGUMENT_KIND}, the @var{value} argument -will be @code{NULL} if the URL contained a key without an equals operator. -For example, for a HTTP request to the URL ``http://foo/bar?key'', the -@var{value} argument is @code{NULL}; in contrast, a HTTP request to the URL -``http://foo/bar?key='', the @var{value} argument is the empty string. -The normal case is that the URL contains ``http://foo/bar?key=value'' -in which case @var{value} would be the string ``value'' and @var{key} -would contain the string ``key''. -@end deftypefun - - -@deftypefun enum MHD_Result MHD_set_connection_value (struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key, const char *value) -This function can be used to append an entry to -the list of HTTP headers of a connection (so that the -@code{MHD_get_connection_values function} will return -them -- and the MHD PostProcessor will also -see them). This maybe required in certain -situations (see Mantis #1399) where (broken) -HTTP implementations fail to supply values needed -by the post processor (or other parts of the -application). - -This function MUST only be called from within -the MHD_AccessHandlerCallback (otherwise, access -maybe improperly synchronized). Furthermore, -the client must guarantee that the key and -value arguments are 0-terminated strings that -are NOT freed until the connection is closed. -(The easiest way to do this is by passing only -arguments to permanently allocated strings.). - -@var{connection} is the connection for which -the entry for @var{key} of the given @var{kind} -should be set to the given @var{value}. - -The function returns @code{MHD_NO} if the operation -could not be performed due to insufficient memory -and @code{MHD_YES} on success. -@end deftypefun - - -@deftypefun {const char *} MHD_lookup_connection_value (struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key) -Get a particular header value. If multiple values match the -@var{kind}, return one of them (the ``first'', whatever that means). -@var{key} must reference a zero-terminated ASCII-coded string -representing the header to look for: it is compared against the -headers using (basically) @code{strcasecmp()}, so case is ignored. -@end deftypefun - -@deftypefun {const char *} MHD_lookup_connection_value_n (struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key, size_t key_size, const char **value_ptr, size_t *value_size_ptr) -Get a particular header value. If multiple values match the -@var{kind}, return one of them (the ``first'', whatever that means). -@var{key} must reference an ASCII-coded string -representing the header to look for: it is compared against the -headers using (basically) @code{strncasecmp()}, so case is ignored. -The @var{value_ptr} is set to the address of the value found, -and @var{value_size_ptr} is set to the number of bytes in the -value. -@end deftypefun - - -@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -@c ------------------------------------------------------------ -@node microhttpd-responses -@chapter Building responses to requests - - -@noindent -Response objects handling by MHD is asynchronous with respect to the -application execution flow. Instances of the @code{MHD_Response} -structure are not associated to a daemon and neither to a client -connection: they are managed with reference counting. - -In the simplest case: we allocate a new @code{MHD_Response} structure -for each response, we use it once and finally we destroy it. - -MHD allows more efficient resources usages. - -Example: we allocate a new @code{MHD_Response} structure for each -response @strong{kind}, we use it every time we have to give that -response and we finally destroy it only when the daemon shuts down. - -@menu -* microhttpd-response enqueue:: Enqueuing a response. -* microhttpd-response create:: Creating a response object. -* microhttpd-response headers:: Adding headers to a response. -* microhttpd-response options:: Setting response options. -* microhttpd-response inspect:: Inspecting a response object. -* microhttpd-response upgrade:: Creating a response for protocol upgrades. -@end menu - -@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -@c ------------------------------------------------------------ -@node microhttpd-response enqueue -@section Enqueuing a response - - -@deftypefun enum MHD_Result MHD_queue_response (struct MHD_Connection *connection, unsigned int status_code, struct MHD_Response *response) -Queue a response to be transmitted to the client as soon as possible -but only after MHD_AccessHandlerCallback returns. This function -checks that it is legal to queue a response at this time for the -given connection. It also increments the internal reference -counter for the response object (the counter will be decremented -automatically once the response has been transmitted). - -@table @var -@item connection -the connection identifying the client; - -@item status_code -HTTP status code (i.e. @code{200} for OK); - -@item response -response to transmit. -@end table - -Return @code{MHD_YES} on success or if message has been queued. Return -@code{MHD_NO}: if arguments are invalid (example: @code{NULL} pointer); on -error (i.e. reply already sent). -@end deftypefun - - -@deftypefun void MHD_destroy_response (struct MHD_Response *response) -Destroy a response object and associated resources (decrement the -reference counter). Note that MHD may keep some of the resources -around if the response is still in the queue for some clients, so the -memory may not necessarily be freed immediately. -@end deftypefun - - -An explanation of reference counting@footnote{Note to readers acquainted -to the Tcl API: reference counting on @code{MHD_Connection} -structures is handled in the same way as Tcl handles @code{Tcl_Obj} -structures through @code{Tcl_IncrRefCount()} and -@code{Tcl_DecrRefCount()}.}: - -@enumerate -@item -a @code{MHD_Response} object is allocated: - -@example -struct MHD_Response * response = MHD_create_response_from_buffer(...); -/* here: reference counter = 1 */ -@end example - -@item -the @code{MHD_Response} object is enqueued in a @code{MHD_Connection}: - -@example -MHD_queue_response(connection, , response); -/* here: reference counter = 2 */ -@end example - -@item -the creator of the response object discharges responsibility for it: - -@example -MHD_destroy_response(response); -/* here: reference counter = 1 */ -@end example - -@item -the daemon handles the connection sending the response's data to the -client then decrements the reference counter by calling -@code{MHD_destroy_response()}: the counter's value drops to zero and -the @code{MHD_Response} object is released. -@end enumerate - - -@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -@c ------------------------------------------------------------ -@node microhttpd-response create -@section Creating a response object - - -@deftypefun {struct MHD_Response *} MHD_create_response_from_callback (uint64_t size, size_t block_size, MHD_ContentReaderCallback crc, void *crc_cls, MHD_ContentReaderFreeCallback crfc) -Create a response object. The response object can be extended with -header information and then it can be used any number of times. - -@table @var -@item size -size of the data portion of the response, @code{-1} for unknown; - -@item block_size -preferred block size for querying @var{crc} (advisory only, MHD may -still call @var{crc} using smaller chunks); this is essentially the -buffer size used for @acronym{IO}, clients should pick a value that is -appropriate for @acronym{IO} and memory performance requirements; - -@item crc -callback to use to obtain response data; - -@item crc_cls -extra argument to @var{crc}; - -@item crfc -callback to call to free @var{crc_cls} resources. -@end table - -Return @code{NULL} on error (i.e. invalid arguments, out of memory). -@end deftypefun - - - -@deftypefun {struct MHD_Response *} MHD_create_response_from_fd (uint64_t size, int fd) -Create a response object. The response object can be extended with -header information and then it can be used any number of times. - -@table @var -@item size -size of the data portion of the response (should be smaller or equal to the -size of the file) - -@item fd -file descriptor referring to a file on disk with the data; will be -closed when response is destroyed; note that 'fd' must be an actual -file descriptor (not a pipe or socket) since MHD might use 'sendfile' -or 'seek' on it. The descriptor should be in blocking-IO mode. -@end table - -Return @code{NULL} on error (i.e. invalid arguments, out of memory). -@end deftypefun - - -@deftypefun {struct MHD_Response *} MHD_create_response_from_pipe (int fd) -Create a response object. The response object can be extended with -header information and then it can be used ONLY ONCE. - -@table @var -@item fd -file descriptor of the read-end of the pipe; will be -closed when response is destroyed. -The descriptor should be in blocking-IO mode. -@end table - -Return @code{NULL} on error (i.e. out of memory). -@end deftypefun - - -@deftypefun {struct MHD_Response *} MHD_create_response_from_fd_at_offset (size_t size, int fd, off_t offset) -Create a response object. The response object can be extended with -header information and then it can be used any number of times. -Note that you need to be a bit careful about @code{off_t} when -writing this code. Depending on your platform, MHD is likely -to have been compiled with support for 64-bit files. When you -compile your own application, you must make sure that @code{off_t} -is also a 64-bit value. If not, your compiler may pass a 32-bit -value as @code{off_t}, which will result in 32-bits of garbage. - -If you use the autotools, use the @code{AC_SYS_LARGEFILE} autoconf -macro and make sure to include the generated @file{config.h} file -before @file{microhttpd.h} to avoid problems. If you do not have a -build system and only want to run on a GNU/Linux system, you could -also use -@verbatim -#define _FILE_OFFSET_BITS 64 -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <microhttpd.h> -@end verbatim -to ensure 64-bit @code{off_t}. Note that if your operating system -does not support 64-bit files, MHD will be compiled with a 32-bit -@code{off_t} (in which case the above would be wrong). - -@table @var -@item size -size of the data portion of the response (number of bytes to transmit from the -file starting at offset). - -@item fd -file descriptor referring to a file on disk with the data; will be -closed when response is destroyed; note that 'fd' must be an actual -file descriptor (not a pipe or socket) since MHD might use 'sendfile' -or 'seek' on it. The descriptor should be in blocking-IO mode. - -@item offset -offset to start reading from in the file -@end table - -Return @code{NULL} on error (i.e. invalid arguments, out of memory). -@end deftypefun - - -@deftypefun {struct MHD_Response *} MHD_create_response_from_buffer (size_t size, void *data, enum MHD_ResponseMemoryMode mode) -Create a response object. The response object can be extended with -header information and then it can be used any number of times. - -@table @var -@item size -size of the data portion of the response; - -@item buffer -the data itself; - -@item mode -memory management options for buffer; use -MHD_RESPMEM_PERSISTENT if the buffer is static/global memory, -use MHD_RESPMEM_MUST_FREE if the buffer is heap-allocated and -should be freed by MHD and MHD_RESPMEM_MUST_COPY if the -buffer is in transient memory (i.e. on the stack) and must -be copied by MHD; -@end table - -Return @code{NULL} on error (i.e. invalid arguments, out of memory). -@end deftypefun - - -@deftypefun {struct MHD_Response *} MHD_create_response_from_buffer_with_free_callback (size_t size, void *data, MHD_ContentReaderFreeCallback crfc) -Create a response object. The buffer at the end must be free'd -by calling the @var{crfc} function. - -@table @var -@item size -size of the data portion of the response; - -@item buffer -the data itself; - -@item crfc -function to call at the end to free memory allocated at @var{buffer}. -@end table - -Return @code{NULL} on error (i.e. invalid arguments, out of memory). -@end deftypefun - -@deftypefun {struct MHD_Response *} MHD_create_response_from_data (size_t size, void *data, int must_free, int must_copy) -Create a response object. The response object can be extended with -header information and then it can be used any number of times. -This function is deprecated, use @code{MHD_create_response_from_buffer} instead. - -@table @var -@item size -size of the data portion of the response; - -@item data -the data itself; - -@item must_free -if true: MHD should free data when done; - -@item must_copy -if true: MHD allocates a block of memory and use it to make a copy of -@var{data} embedded in the returned @code{MHD_Response} structure; -handling of the embedded memory is responsibility of MHD; @var{data} -can be released anytime after this call returns. -@end table - -Return @code{NULL} on error (i.e. invalid arguments, out of memory). -@end deftypefun - - -Example: create a response from a statically allocated string: - -@example -const char * data = "<html><body><p>Error!</p></body></html>"; - -struct MHD_Connection * connection = ...; -struct MHD_Response * response; - -response = MHD_create_response_from_buffer (strlen(data), data, - MHD_RESPMEM_PERSISTENT); -MHD_queue_response(connection, 404, response); -MHD_destroy_response(response); -@end example - - -@deftypefun {struct MHD_Response *} MHD_create_response_from_iovec (const struct MHD_IoVec *iov, int iovcnt, MHD_ContentReaderFreeCallback crfc, void *cls) -Create a response object from an array of memory buffers. -The response object can be extended with header information and then be used -any number of times. -@table @var -@item iov -the array for response data buffers, an internal copy of this will be made; however, note that the data pointed to by the @var{iov} is not copied and must be preserved unchanged at the given locations until the response is no longer in use and the @var{crfc} is called; - -@item iovcnt -the number of elements in @var{iov}; - -@item crfc -the callback to call to free resources associated with @var{iov}; - -@item cls -the argument to @var{crfc}; -@end table - -Return @code{NULL} on error (i.e. invalid arguments, out of memory). -@end deftypefun - - - -@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -@c ------------------------------------------------------------ -@node microhttpd-response headers -@section Adding headers to a response - - -@deftypefun enum MHD_Result MHD_add_response_header (struct MHD_Response *response, const char *header, const char *content) -Add a header line to the response. The strings referenced by -@var{header} and @var{content} must be zero-terminated and they are -duplicated into memory blocks embedded in @var{response}. - -Notice that the strings must not hold newlines, carriage returns or tab -chars. - -MHD_add_response_header() prevents applications from setting a -``Transfer-Encoding'' header to values other than ``identity'' or -``chunked'' as other transfer encodings are not supported by MHD. Note -that usually MHD will pick the transfer encoding correctly -automatically, but applications can use the header to force a -particular behavior. - -MHD_add_response_header() also prevents applications from setting a -``Content-Length'' header. MHD will automatically set a correct -``Content-Length'' header if it is possible and allowed. - -Return @code{MHD_NO} on error (i.e. invalid header or content format or -memory allocation error). -@end deftypefun - - -@deftypefun enum MHD_Result MHD_add_response_footer (struct MHD_Response *response, const char *footer, const char *content) -Add a footer line to the response. The strings referenced by -@var{footer} and @var{content} must be zero-terminated and they are -duplicated into memory blocks embedded in @var{response}. - -Notice that the strings must not hold newlines, carriage returns or tab -chars. You can add response footers at any time before signalling the -end of the response to MHD (not just before calling 'MHD_queue_response'). -Footers are useful for adding cryptographic checksums to the reply or to -signal errors encountered during data generation. This call was introduced -in MHD 0.9.3. - -Return @code{MHD_NO} on error (i.e. invalid header or content format or -memory allocation error). -@end deftypefun - - - -@deftypefun enum MHD_Result MHD_del_response_header (struct MHD_Response *response, const char *header, const char *content) -Delete a header (or footer) line from the response. Return @code{MHD_NO} on error -(arguments are invalid or no such header known). -@end deftypefun - - -@c ------------------------------------------------------------ -@node microhttpd-response options -@section Setting response options - - -@deftypefun enum MHD_Result MHD_set_response_options (struct MHD_Response *response, enum MHD_ResponseFlags flags, ...) -Set special flags and options for a response. - -Calling this functions sets the given flags and options for the response. - -@table @var -@item response -which response should be modified; - -@item flags -flags to set for the response; - -@end table - -Additional arguments are a list of options (type-value pairs, -terminated with @code{MHD_RO_END}). It is mandatory to use -@code{MHD_RO_END} as last argument, even when there are no -additional arguments. - -Return @code{MHD_NO} on error, @code{MHD_YES} on success. -@end deftypefun - - -@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -@c ------------------------------------------------------------ -@node microhttpd-response inspect -@section Inspecting a response object - - -@deftypefun int MHD_get_response_headers (struct MHD_Response *response, MHD_KeyValueIterator iterator, void *iterator_cls) -Get all of the headers added to a response. - -Invoke the @var{iterator} callback for each header in the response, -using @var{iterator_cls} as first argument. Return number of entries -iterated over. @var{iterator} can be @code{NULL}: in this case the function -just counts headers. - -@var{iterator} should not modify the its key and value arguments, unless -we know what we are doing. -@end deftypefun - - -@deftypefun {const char *} MHD_get_response_header (struct MHD_Response *response, const char *key) -Find and return a pointer to the value of a particular header from the -response. @var{key} must reference a zero-terminated string -representing the header to look for. The search is case sensitive. -Return @code{NULL} if header does not exist or @var{key} is @code{NULL}. - -We should not modify the value, unless we know what we are doing. -@end deftypefun - - -@c ------------------------------------------------------------ -@node microhttpd-response upgrade -@section Creating a response for protocol upgrades -@cindex WebSockets -@cindex Upgrade -@cindex HTTP2 -@cindex RFC2817 - -With RFC 2817 a mechanism to switch protocols within HTTP was -introduced. Here, a client sends a request with a ``Connection: -Upgrade'' header. The server responds with a ``101 Switching -Protocols'' response header, after which the two parties begin to -speak a different (non-HTTP) protocol over the TCP connection. - -This mechanism is used for upgrading HTTP 1.1 connections to HTTP2 or -HTTPS, as well as for implementing WebSockets. Which protocol -upgrade is performed is negotiated between server and client in -additional headers, in particular the ``Upgrade'' header. - -MHD supports switching protocols using this mechanism only if the -@code{MHD_ALLOW_SUSPEND_RESUME} flag has been set when starting -the daemon. If this flag has been set, applications can upgrade -a connection by queueing a response (using the -@code{MHD_HTTP_SWITCHING_PROTOCOLS} status code) which must -have been created with the following function: - - -@deftypefun enum MHD_Result MHD_create_response_for_upgrade (MHD_UpgradeHandler upgrade_handler, void *upgrade_handler_cls) -Create a response suitable for switching protocols. Returns @code{MHD_YES} on success. @code{upgrade_handler} must not be @code{NULL}. - -When creating this type of response, the ``Connection: Upgrade'' -header will be set automatically for you. MHD requires that you -additionally set an ``Upgrade:'' header. The ``Upgrade'' header -must simply exist, the specific value is completely up to the -application. - -@end deftypefun - -The @code{upgrade_handler} argument to the above has the following type: - - -@deftypefn {Function Pointer} void {*MHD_UpgradeHandler} (void *cls, struct MHD_Connection *connection, const char *extra_in, size_t extra_in_size, MHD_socket sock, struct MHD_UpgradeResponseHandle *urh) -This function will be called once MHD has transmitted the header of the response to the connection that is being upgraded. At this point, the application is expected to take over the socket @code{sock} and speak the non-HTTP protocol to which the connection was upgraded. MHD will no longer use the socket; this includes handling timeouts. The application must call @code{MHD_upgrade_action} with an upgrade action of @code{MHD_UPGRADE_ACTION_CLOSE} when it is done processing the connection to close the socket. The application must not call @code{MHD_stop_daemon} on the respective daemon as long as it is still handling the connection. The arguments given to the @code{upgrade_handler} have the following meaning: - -@table @var -@item cls -matches the @code{upgrade_handler_cls} that was given to @code{MHD_create_response_for_upgrade} -@item connection -identifies the connection that is being upgraded; - -@item req_cls -last value left in `*req_cls` in the `MHD_AccessHandlerCallback` - -@item extra_in -buffer of bytes MHD read ``by accident'' from the socket already. This can happen if the client eagerly transmits more than just the HTTP request. The application should treat these as if it had read them from the socket. - -@item extra_in_size -number of bytes in @code{extra_in} - -@item sock -the socket which the application can now use directly for some bi-directional communication with the client. The application can henceforth use @code{recv()} and @code{send()} or @code{read()} and @code{write()} system calls on the socket. However, @code{ioctl()} and @code{setsockopt()} functions will not work as expected when using HTTPS. Such operations may be supported in the future via @code{MHD_upgrade_action}. Most importantly, the application must never call @code{close()} on this socket. Closing the socket must be done using @code{MHD_upgrade_action}. However, while close is forbidden, the application may call @code{shutdown()} on the socket. - -@item urh -argument for calls to @code{MHD_upgrade_action}. Applications must eventually use this function to perform the @code{close()} action on the socket. -@end table - -@end deftypefn - -@deftypefun enum MHD_Result MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh, enum MHD_UpgradeAction action, ...) -Perform special operations related to upgraded connections. - -@table @var -@item urh -identifies the upgraded connection to perform an action on - -@item action -specifies the action to perform; further arguments to the function depend on the specifics of the action. -@end table - -@end deftypefun - - -@deftp {Enumeration} MHD_UpgradeAction -Set of actions to be performed on upgraded connections. Passed as an argument to -@code{MHD_upgrade_action()}. - -@table @code -@item MHD_UPGRADE_ACTION_CLOSE -Closes the connection. Must be called once the application is done with the client. Takes no additional arguments. -@item MHD_UPGRADE_ACTION_CORK_ON -Enable corking on the underlying socket. -@item MHD_UPGRADE_ACTION_CORK_OFF -Disable corking on the underlying socket. - -@end table -@end deftp - - -@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -@c ------------------------------------------------------------ -@node microhttpd-flow -@chapter Flow control. - -@noindent -Sometimes it may be possible that clients upload data faster -than an application can process it, or that an application -needs an extended period of time to generate a response. -If @code{MHD_USE_THREAD_PER_CONNECTION} is used, applications -can simply deal with this by performing their logic within the -thread and thus effectively blocking connection processing -by MHD. In all other modes, blocking logic must not be -placed within the callbacks invoked by MHD as this would also -block processing of other requests, as a single thread may be -responsible for tens of thousands of connections. - -Instead, applications using thread modes other than -@code{MHD_USE_THREAD_PER_CONNECTION} should use the -following functions to perform flow control. - -@deftypefun enum MHD_Result MHD_suspend_connection (struct MHD_Connection *connection) -Suspend handling of network data for a given connection. This can -be used to dequeue a connection from MHD's event loop (external -select, internal select or thread pool; not applicable to -thread-per-connection!) for a while. - -If you use this API in conjunction with a internal select or a -thread pool, you must set the option @code{MHD_ALLOW_SUSPEND_RESUME} to -ensure that a resumed connection is immediately processed by MHD. - -Suspended connections continue to count against the total number of -connections allowed (per daemon, as well as per IP, if such limits -are set). Suspended connections will NOT time out; timeouts will -restart when the connection handling is resumed. While a -connection is suspended, MHD will not detect disconnects by the -client. - -The only safe time to suspend a connection is from the -@code{MHD_AccessHandlerCallback} or from the respective -@code{MHD_ContentReaderCallback} (but in this case the -response object must not be shared among multiple -connections). - -When suspending from the @code{MHD_AccessHandlerCallback} -you MUST afterwards return @code{MHD_YES} from the access handler -callback (as MHD_NO would imply to both close and suspend -the connection, which is not allowed). - -Finally, it is an API violation to call @code{MHD_stop_daemon} while -having suspended connections (this will at least create memory and -socket leaks or lead to undefined behavior). You must explicitly -resume all connections before stopping the daemon. - -@table @var -@item connection -the connection to suspend -@end table -@end deftypefun - -@deftypefun enum MHD_Result MHD_resume_connection (struct MHD_Connection *connection) -Resume handling of network data for suspended connection. It is safe -to resume a suspended connection at any time. Calling this function -on a connection that was not previously suspended will result in -undefined behavior. - -If you are using this function in ``external'' select mode, you must -make sure to run @code{MHD_run} afterwards (before again calling -@code{MHD_get_fdset}), as otherwise the change may not be reflected in -the set returned by @code{MHD_get_fdset} and you may end up with a -connection that is stuck until the next network activity. - -You can check whether a connection is currently suspended using -@code{MHD_get_connection_info} by querying for -@code{MHD_CONNECTION_INFO_CONNECTION_SUSPENDED}. - -@table @var -@item connection -the connection to resume -@end table -@end deftypefun - - -@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -@c ------------------------------------------------------------ -@node microhttpd-dauth -@chapter Utilizing Authentication - -@noindent -MHD support three types of client authentication. - -Basic authentication uses a simple authentication method based -on BASE64 algorithm. Username and password are exchanged in clear -between the client and the server, so this method must only be used -for non-sensitive content or when the session is protected with https. -When using basic authentication MHD will have access to the clear -password, possibly allowing to create a chained authentication -toward an external authentication server. - -Digest authentication uses a one-way authentication method based -on MD5 hash algorithm. Only the hash will transit over the network, -hence protecting the user password. The nonce will prevent replay -attacks. This method is appropriate for general use, especially -when https is not used to encrypt the session. - -Client certificate authentication uses a X.509 certificate from -the client. This is the strongest authentication mechanism but it -requires the use of HTTPS. Client certificate authentication can -be used simultaneously with Basic or Digest Authentication in order -to provide a two levels authentication (like for instance separate -machine and user authentication). A code example for using -client certificates is presented in the MHD tutorial. - -@menu -* microhttpd-dauth basic:: Using Basic Authentication. -* microhttpd-dauth digest:: Using Digest Authentication. -@end menu - -@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -@c ------------------------------------------------------------ -@node microhttpd-dauth basic -@section Using Basic Authentication - -@deftypefun {void} MHD_free (void *ptr) -Free the memory given at @code{ptr}. Used to free data structures allocated by MHD. Calls @code{free(ptr)}. -@end deftypefun - -@deftypefun {char *} MHD_basic_auth_get_username_password3 (struct MHD_Connection *connection) -Get the username and password from the basic authorization header sent by the client. -Return @code{NULL} if no Basic Authorization header set by the client or if Base64 -encoding is invalid; a pointer to the structure with username and password -if found values set by the client. -If returned value is not @code{NULL}, the value must be @code{MHD_free()}'ed. -@end deftypefun - -@deftypefun {enum MHD_Result} MHD_queue_basic_auth_fail_response3 (struct MHD_Connection *connection, const char *realm, int prefer_utf8, struct MHD_Response *response) -Queues a response to request basic authentication from the client. -Return @code{MHD_YES} if successful, otherwise @code{MHD_NO}. - -@var{realm} must reference to a zero-terminated string representing the realm. - -@var{prefer_utf8} if set to @code{MHD_YES} then parameter @code{charset} with value -@code{UTF-8} will be added to the response authentication header which indicates -that UTF-8 encoding is preferred for username and password. - -@var{response} a response structure to specify what shall be presented to the -client with a 401 HTTP status. -@end deftypefun - -@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -@c ------------------------------------------------------------ -@node microhttpd-dauth digest -@section Using Digest Authentication - -MHD supports MD5 (deprecated by IETF) and SHA-256 hash algorithms -for digest authentication. The @code{MHD_DigestAuthAlgorithm} enumeration -is used to specify which algorithm should be used. - -@deftp {Enumeration} MHD_DigestAuthAlgorithm -Which digest algorithm should be used. Must be used consistently. - -@table @code -@item MHD_DIGEST_ALG_AUTO -Have MHD pick an algorithm currently considered secure. For now defaults to SHA-256. - -@item MHD_DIGEST_ALG_MD5 -Force use of (deprecated, ancient, insecure) MD5. - -@item MHD_DIGEST_ALG_SHA256 -Force use of SHA-256. - -@end table -@end deftp - -@deftp {Enumeration} MHD_DigestAuthResult -The result of digest authentication of the client. - -@table @code -@item MHD_DAUTH_OK -Authentication OK. - -@item MHD_DAUTH_ERROR -General error, like ``out of memory''. - -@item MHD_DAUTH_WRONG_HEADER -No ``Authorization'' header or wrong format of the header. - -@item MHD_DAUTH_WRONG_USERNAME -Wrong ``username''. - -@item MHD_DAUTH_WRONG_REALM -Wrong ``realm''. - -@item MHD_DAUTH_WRONG_URI -Wrong ``URI'' (or URI parameters). - -@item MHD_DAUTH_NONCE_STALE -The ``nonce'' is too old. Suggest the client to retry with the same username and -password to get the fresh ``nonce''. -The validity of the ``nonce'' may not be checked. - -@item MHD_DAUTH_NONCE_WRONG -The ``nonce'' is wrong. May indicate an attack attempt. - -@item MHD_DAUTH_RESPONSE_WRONG -The ``response'' is wrong. May indicate an attack attempt. - -@end table -@end deftp - - -@deftypefun {char *} MHD_digest_auth_get_username (struct MHD_Connection *connection) -Find and return a pointer to the username value from the request header. -Return @code{NULL} if the value is not found or header does not exist. -If returned value is not @code{NULL}, the value must be @code{MHD_free()}'ed. -@end deftypefun - -@deftypefun enum MHD_DigestAuthResult MHD_digest_auth_check3 (struct MHD_Connection *connection, const char *realm, const char *username, const char *password, unsigned int nonce_timeout, enum MHD_DigestAuthAlgorithm algo) -Checks if the provided values in the WWW-Authenticate header are valid -and sound according to RFC7616. If valid return @code{MHD_DAUTH_OK}, otherwise return the error code. - -@var{realm} must reference to a zero-terminated string representing the realm. - -@var{username} must reference to a zero-terminated string representing the username, -it is usually the returned value from MHD_digest_auth_get_username. - -@var{password} must reference to a zero-terminated string representing the password, -most probably it will be the result of a lookup of the username against a local database. - -@var{nonce_timeout} the nonce validity duration in seconds. -Most of the time it is sound to specify 300 seconds as its values. - -@var{algo} which digest algorithm should we use. -@end deftypefun - -@deftypefun int MHD_digest_auth_check2 (struct MHD_Connection *connection, const char *realm, const char *username, const char *password, unsigned int nonce_timeout, enum MHD_DigestAuthAlgorithm algo) -Checks if the provided values in the WWW-Authenticate header are valid -and sound according to RFC2716. If valid return @code{MHD_YES}, otherwise return @code{MHD_NO}. - -@var{realm} must reference to a zero-terminated string representing the realm. - -@var{username} must reference to a zero-terminated string representing the username, -it is usually the returned value from MHD_digest_auth_get_username. - -@var{password} must reference to a zero-terminated string representing the password, -most probably it will be the result of a lookup of the username against a local database. - -@var{nonce_timeout} is the amount of time in seconds for a nonce to be invalid. -Most of the time it is sound to specify 300 seconds as its values. - -@var{algo} which digest algorithm should we use. -@end deftypefun - - -@deftypefun int MHD_digest_auth_check (struct MHD_Connection *connection, const char *realm, const char *username, const char *password, unsigned int nonce_timeout) -Checks if the provided values in the WWW-Authenticate header are valid -and sound according to RFC2716. If valid return @code{MHD_YES}, otherwise return @code{MHD_NO}. -Deprecated, use @code{MHD_digest_auth_check2} instead. - - -@var{realm} must reference to a zero-terminated string representing the realm. - -@var{username} must reference to a zero-terminated string representing the username, -it is usually the returned value from MHD_digest_auth_get_username. - -@var{password} must reference to a zero-terminated string representing the password, -most probably it will be the result of a lookup of the username against a local database. - -@var{nonce_timeout} is the amount of time in seconds for a nonce to be invalid. -Most of the time it is sound to specify 300 seconds as its values. -@end deftypefun - - - -@deftypefun enum MHD_DigestAuthResult MHD_digest_auth_check_digest3 (struct MHD_Connection *connection, const char *realm, const char *username, const uint8_t *digest, unsigned int nonce_timeout, enum MHD_DigestAuthAlgorithm algo) -Checks if the provided values in the WWW-Authenticate header are valid -and sound according to RFC7616. If valid return @code{MHD_DAUTH_OK}, otherwise return the error code. - -@var{realm} must reference to a zero-terminated string representing the realm. - -@var{username} must reference to a zero-terminated string representing the username, -it is usually the returned value from MHD_digest_auth_get_username. - -@var{digest} the pointer to the binary digest for the precalculated hash value ``username:realm:password'' with specified @var{algo}. - -@var{digest_size} the number of bytes in @var{digest} (the size must match @var{algo}!) - -@var{nonce_timeout} the nonce validity duration in seconds. -Most of the time it is sound to specify 300 seconds as its values. - -@var{algo} digest authentication algorithm to use. -@end deftypefun - -@deftypefun int MHD_digest_auth_check_digest2 (struct MHD_Connection *connection, const char *realm, const char *username, const uint8_t *digest, unsigned int nonce_timeout, enum MHD_DigestAuthAlgorithm algo) -Checks if the provided values in the WWW-Authenticate header are valid -and sound according to RFC2716. If valid return @code{MHD_YES}, otherwise return @code{MHD_NO}. - -@var{realm} must reference to a zero-terminated string representing the realm. - -@var{username} must reference to a zero-terminated string representing the username, -it is usually the returned value from MHD_digest_auth_get_username. - -@var{digest} pointer to the binary MD5 sum for the precalculated hash value ``userame:realm:password''. The size must match the selected @var{algo}! - -@var{nonce_timeout} is the amount of time in seconds for a nonce to be invalid. -Most of the time it is sound to specify 300 seconds as its values. - -@var{algo} digest authentication algorithm to use. -@end deftypefun - -@deftypefun int MHD_digest_auth_check_digest (struct MHD_Connection *connection, const char *realm, const char *username, const unsigned char digest[MHD_MD5_DIGEST_SIZE], unsigned int nonce_timeout) -Checks if the provided values in the WWW-Authenticate header are valid -and sound according to RFC2716. If valid return @code{MHD_YES}, otherwise return @code{MHD_NO}. -Deprecated, use @code{MHD_digest_auth_check_digest2} instead. - -@var{realm} must reference to a zero-terminated string representing the realm. - -@var{username} must reference to a zero-terminated string representing the username, -it is usually the returned value from MHD_digest_auth_get_username. - -@var{digest} pointer to the binary MD5 sum for the precalculated hash value ``userame:realm:password'' of @code{MHD_MD5_DIGEST_SIZE} bytes. - -@var{nonce_timeout} is the amount of time in seconds for a nonce to be invalid. -Most of the time it is sound to specify 300 seconds as its values. -@end deftypefun - - -@deftypefun enum MHD_Result MHD_queue_auth_fail_response2 (struct MHD_Connection *connection, const char *realm, const char *opaque, struct MHD_Response *response, int signal_stale, enum MHD_DigestAuthAlgorithm algo) -Queues a response to request authentication from the client, -return @code{MHD_YES} if successful, otherwise @code{MHD_NO}. - -@var{realm} must reference to a zero-terminated string representing the realm. - -@var{opaque} must reference to a zero-terminated string representing a value -that gets passed to the client and expected to be passed again to the server -as-is. This value can be a hexadecimal or base64 string. - -@var{response} a response structure to specify what shall be presented to the -client with a 401 HTTP status. - -@var{signal_stale} a value that signals "stale=true" in the response header to -indicate the invalidity of the nonce and no need to ask for authentication -parameters and only a new nonce gets generated. @code{MHD_YES} to generate a new -nonce, @code{MHD_NO} to ask for authentication parameters. - -@var{algo} which digest algorithm should we use. The same algorithm -must then be selected when checking digests received from clients! - -@end deftypefun - - -@deftypefun enum MHD_Result MHD_queue_auth_fail_response (struct MHD_Connection *connection, const char *realm, const char *opaque, struct MHD_Response *response, int signal_stale) -Queues a response to request authentication from the client, -return @code{MHD_YES} if successful, otherwise @code{MHD_NO}. - -@var{realm} must reference to a zero-terminated string representing the realm. - -@var{opaque} must reference to a zero-terminated string representing a value -that gets passed to the client and expected to be passed again to the server -as-is. This value can be a hexadecimal or base64 string. - -@var{response} a response structure to specify what shall be presented to the -client with a 401 HTTP status. - -@var{signal_stale} a value that signals "stale=true" in the response header to -indicate the invalidity of the nonce and no need to ask for authentication -parameters and only a new nonce gets generated. @code{MHD_YES} to generate a new -nonce, @code{MHD_NO} to ask for authentication parameters. -@end deftypefun - -Example: handling digest authentication requests and responses. - -@example -#define PAGE "<html><head><title>libmicrohttpd demo</title></head><body>Access granted</body></html>" -#define DENIED "<html><head><title>libmicrohttpd demo</title></head><body>Access denied</body></html>" -#define OPAQUE "11733b200778ce33060f31c9af70a870ba96ddd4" - -static int -ahc_echo (void *cls, - struct MHD_Connection *connection, - const char *url, - const char *method, - const char *version, - const char *upload_data, size_t *upload_data_size, void **ptr) -@{ - struct MHD_Response *response; - char *username; - const char *password = "testpass"; - const char *realm = "test@@example.com"; - int ret; - static int already_called_marker; - - if (&already_called_marker != *req_cls) - @{ /* Called for the first time, request not fully read yet */ - *req_cls = &already_called_marker; - /* Wait for complete request */ - return MHD_YES; - @} - - username = MHD_digest_auth_get_username (connection); - if (username == NULL) - @{ - response = MHD_create_response_from_buffer(strlen (DENIED), - DENIED, - MHD_RESPMEM_PERSISTENT); - ret = MHD_queue_auth_fail_response2 (connection, - realm, - OPAQUE, - response, - MHD_NO, - MHD_DIGEST_ALG_SHA256); - MHD_destroy_response(response); - return ret; - @} - ret = MHD_digest_auth_check2 (connection, - realm, - username, - password, - 300, - MHD_DIGEST_ALG_SHA256); - MHD_free(username); - if ( (ret == MHD_INVALID_NONCE) || - (ret == MHD_NO) ) - @{ - response = MHD_create_response_from_buffer(strlen (DENIED), - DENIED, - MHD_RESPMEM_PERSISTENT); - if (NULL == response) - return MHD_NO; - ret = MHD_queue_auth_fail_response2 (connection, - realm, - OPAQUE, - response, - (ret == MHD_INVALID_NONCE) ? MHD_YES : MHD_NO, - MHD_DIGEST_ALG_SHA256); - MHD_destroy_response(response); - return ret; - @} - response = MHD_create_response_from_buffer (strlen(PAGE), - PAGE, - MHD_RESPMEM_PERSISTENT); - ret = MHD_queue_response (connection, - MHD_HTTP_OK, - response); - MHD_destroy_response(response); - return ret; -@} -@end example - -@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -@c ------------------------------------------------------------ -@node microhttpd-post -@chapter Adding a @code{POST} processor -@cindex POST method - -@menu -* microhttpd-post api:: Programming interface for the - @code{POST} processor. -@end menu - - -@noindent -MHD provides the post processor API to make it easier for applications to -parse the data of a client's @code{POST} request: the -@code{MHD_AccessHandlerCallback} will be invoked multiple times to -process data as it arrives; at each invocation a new chunk of data must -be processed. The arguments @var{upload_data} and @var{upload_data_size} -are used to reference the chunk of data. - -When @code{MHD_AccessHandlerCallback} is invoked for a new request: -its @code{*@var{req_cls}} argument is set to @code{NULL}. When @code{POST} -data comes in the upload buffer it is @strong{mandatory} to use the -@var{req_cls} to store a reference to per-request data. The fact -that the pointer was initially @code{NULL} can be used to detect that -this is a new request. - -One method to detect that a new request was started is -to set @code{*req_cls} to an unused integer: - -@example -int -access_handler (void *cls, - struct MHD_Connection * connection, - const char *url, - const char *method, const char *version, - const char *upload_data, size_t *upload_data_size, - void **req_cls) -@{ - static int old_connection_marker; - int new_connection = (NULL == *req_cls); - - if (new_connection) - @{ - /* new connection with POST */ - *req_cls = &old_connection_marker; - @} - - ... -@} -@end example - -@noindent -In contrast to the previous example, for @code{POST} requests in particular, -it is more common to use the value of @code{*req_cls} to keep track of -actual state used during processing, such as the post processor (or a -struct containing a post processor): - -@example -int -access_handler (void *cls, - struct MHD_Connection * connection, - const char *url, - const char *method, const char *version, - const char *upload_data, size_t *upload_data_size, - void **req_cls) -@{ - struct MHD_PostProcessor * pp = *req_cls; - - if (pp == NULL) - @{ - pp = MHD_create_post_processor(connection, ...); - *req_cls = pp; - return MHD_YES; - @} - if (*upload_data_size) - @{ - MHD_post_process(pp, upload_data, *upload_data_size); - *upload_data_size = 0; - return MHD_YES; - @} - else - @{ - MHD_destroy_post_processor(pp); - return MHD_queue_response(...); - @} -@} -@end example - -Note that the callback from @code{MHD_OPTION_NOTIFY_COMPLETED} -should be used to destroy the post processor. This cannot be -done inside of the access handler since the connection may not -always terminate normally. - - -@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -@c ------------------------------------------------------------ -@node microhttpd-post api -@section Programming interface for the @code{POST} processor -@cindex POST method - -@deftypefun {struct MHD_PostProcessor *} MHD_create_post_processor (struct MHD_Connection *connection, size_t buffer_size, MHD_PostDataIterator iterator, void *iterator_cls) -Create a PostProcessor. A PostProcessor can be used to (incrementally) -parse the data portion of a @code{POST} request. - -@table @var -@item connection -the connection on which the @code{POST} is happening (used to determine -the @code{POST} format); - -@item buffer_size -maximum number of bytes to use for internal buffering (used only for the -parsing, specifically the parsing of the keys). A tiny value (256-1024) -should be sufficient; do @strong{NOT} use a value smaller than 256; -for good performance, use 32k or 64k (i.e. 65536). - -@item iterator -iterator to be called with the parsed data; must @strong{NOT} be -@code{NULL}; - -@item iterator_cls -custom value to be used as first argument to @var{iterator}. -@end table - -Return @code{NULL} on error (out of memory, unsupported encoding), otherwise -a PP handle. -@end deftypefun - - -@deftypefun enum MHD_Result MHD_post_process (struct MHD_PostProcessor *pp, const char *post_data, size_t post_data_len) -Parse and process @code{POST} data. Call this function when @code{POST} -data is available (usually during an @code{MHD_AccessHandlerCallback}) -with the @var{upload_data} and @var{upload_data_size}. Whenever -possible, this will then cause calls to the -@code{MHD_IncrementalKeyValueIterator}. - -@table @var -@item pp -the post processor; - -@item post_data -@var{post_data_len} bytes of @code{POST} data; - -@item post_data_len -length of @var{post_data}. -@end table - -Return @code{MHD_YES} on success, @code{MHD_NO} on error -(out-of-memory, iterator aborted, parse error). -@end deftypefun - - -@deftypefun enum MHD_Result MHD_destroy_post_processor (struct MHD_PostProcessor *pp) -Release PostProcessor resources. After this function is being called, -the PostProcessor is guaranteed to no longer call its iterator. There -is no special call to the iterator to indicate the end of the post processing -stream. After destroying the PostProcessor, the programmer should -perform any necessary work to complete the processing of the iterator. - -Return @code{MHD_YES} if processing completed nicely, @code{MHD_NO} -if there were spurious characters or formatting problems with -the post request. It is common to ignore the return value -of this function. - - -@end deftypefun - - - -@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -@c ------------------------------------------------------------ -@node microhttpd-info -@chapter Obtaining and modifying status information. - - -@menu -* microhttpd-info daemon:: State information about an MHD daemon -* microhttpd-info conn:: State information about a connection -* microhttpd-option conn:: Modify per-connection options -@end menu - - -@c ------------------------------------------------------------ -@node microhttpd-info daemon -@section Obtaining state information about an MHD daemon - -@deftypefun {const union MHD_DaemonInfo *} MHD_get_daemon_info (struct MHD_Daemon *daemon, enum MHD_DaemonInfoType infoType, ...) -Obtain information about the given daemon. This function -is currently not fully implemented. - -@table @var -@item daemon -the daemon about which information is desired; - -@item infoType -type of information that is desired - -@item ... -additional arguments about the desired information (depending on -infoType) -@end table - -Returns a union with the respective member (depending on -infoType) set to the desired information), or @code{NULL} -in case the desired information is not available or -applicable. -@end deftypefun - - -@deftp {Enumeration} MHD_DaemonInfoType -Values of this enum are used to specify what -information about a daemon is desired. -@table @code -@item MHD_DAEMON_INFO_KEY_SIZE -Request information about the key size for a particular cipher -algorithm. The cipher algorithm should be passed as an extra argument -(of type 'enum MHD_GNUTLS_CipherAlgorithm'). No longer supported, -using this value will cause @code{MHD_get_daemon_info} to return NULL. - -@item MHD_DAEMON_INFO_MAC_KEY_SIZE -Request information about the key size for a particular cipher -algorithm. The cipher algorithm should be passed as an extra argument -(of type 'enum MHD_GNUTLS_HashAlgorithm'). No longer supported, -using this value will cause @code{MHD_get_daemon_info} to return NULL. - -@item MHD_DAEMON_INFO_LISTEN_FD -@cindex listen -Request the file-descriptor number that MHD is using to listen to the -server socket. This can be useful if no port -was specified and a client needs to learn what port -is actually being used by MHD. -No extra arguments should be passed. - -@item MHD_DAEMON_INFO_EPOLL_FD -@cindex epoll -Request the file-descriptor number that MHD is using for epoll. If -the build is not supporting epoll, NULL is returned; if we are using a -thread pool or this daemon was not started with -@code{MHD_USE_EPOLL}, (a pointer to) -1 is returned. If we are -using @code{MHD_USE_INTERNAL_POLLING_THREAD} or are in 'external' select mode, the -internal epoll FD is returned. This function must be used in external -select mode with epoll to obtain the FD to call epoll on. No extra -arguments should be passed. - -@item MHD_DAEMON_INFO_CURRENT_CONNECTIONS -@cindex connection, limiting number of connections -Request the number of current connections handled by the daemon. No -extra arguments should be passed and a pointer to a @code{union -MHD_DaemonInfo} value is returned, with the @code{num_connections} -member of type @code{unsigned int} set to the number of active -connections. - -Note that in multi-threaded or internal-select mode, the real number of current -connections may already be different when @code{MHD_get_daemon_info} returns. -The number of current connections can be used (even in multi-threaded and -internal-select mode) after @code{MHD_quiesce_daemon} to detect whether all -connections have been handled. - -@end table -@end deftp - - - -@c ------------------------------------------------------------ -@node microhttpd-info conn -@section Obtaining state information about a connection - - -@deftypefun {const union MHD_ConnectionInfo *} MHD_get_connection_info (struct MHD_Connection *connection, enum MHD_ConnectionInfoType infoType, ...) -Obtain information about the given connection. - -@table @var -@item connection -the connection about which information is desired; - -@item infoType -type of information that is desired - -@item ... -additional arguments about the desired information (depending on -infoType) -@end table - -Returns a union with the respective member (depending on -infoType) set to the desired information), or @code{NULL} -in case the desired information is not available or -applicable. -@end deftypefun - -@deftp {Enumeration} MHD_ConnectionInfoType -Values of this enum are used to specify what information about a -connection is desired. - -@table @code - -@item MHD_CONNECTION_INFO_CIPHER_ALGO -What cipher algorithm is being used (HTTPS connections only). -@code{NULL} is returned for non-HTTPS connections. - -Takes no extra arguments. - -@item MHD_CONNECTION_INFO_PROTOCOL, -Allows finding out the TLS/SSL protocol used -(HTTPS connections only). -@code{NULL} is returned for non-HTTPS connections. - -Takes no extra arguments. - -@item MHD_CONNECTION_INFO_CLIENT_ADDRESS -Returns information about the address of the client. Returns -essentially a @code{struct sockaddr **} (since the API returns -a @code{union MHD_ConnectionInfo *} and that union contains -a @code{struct sockaddr *}). - -Takes no extra arguments. - -@item MHD_CONNECTION_INFO_GNUTLS_SESSION, -Takes no extra arguments. Allows access to the underlying GNUtls session, -including access to the underlying GNUtls client certificate -(HTTPS connections only). Takes no extra arguments. -@code{NULL} is returned for non-HTTPS connections. - -Takes no extra arguments. - -@item MHD_CONNECTION_INFO_GNUTLS_CLIENT_CERT, -Dysfunctional (never implemented, deprecated). Use -MHD_CONNECTION_INFO_GNUTLS_SESSION to get the @code{gnutls_session_t} -and then call @code{gnutls_certificate_get_peers()}. - -@item MHD_CONNECTION_INFO_DAEMON -Returns information about @code{struct MHD_Daemon} which manages -this connection. - -Takes no extra arguments. - -@item MHD_CONNECTION_INFO_CONNECTION_FD -Returns the file descriptor (usually a TCP socket) associated with -this connection (in the ``connect-fd'' member of the returned struct). -Note that manipulating the descriptor directly can have problematic -consequences (as in, break HTTP). Applications might use this access -to manipulate TCP options, for example to set the ``TCP-NODELAY'' -option for COMET-like applications. Note that MHD will set TCP-CORK -after sending the HTTP header and clear it after finishing the footers -automatically (if the platform supports it). As the connection -callbacks are invoked in between, those might be used to set different -values for TCP-CORK and TCP-NODELAY in the meantime. - -Takes no extra arguments. - -@item MHD_CONNECTION_INFO_CONNECTION_SUSPENDED -Returns pointer to an integer that is @code{MHD_YES} if the connection -is currently suspended (and thus can be safely resumed) and -@code{MHD_NO} otherwise. - -Takes no extra arguments. - -@item MHD_CONNECTION_INFO_SOCKET_CONTEXT -Returns the client-specific pointer to a @code{void *} that was -(possibly) set during a @code{MHD_NotifyConnectionCallback} when the -socket was first accepted. Note that this is NOT the same as the -@code{req_cls} argument of the @code{MHD_AccessHandlerCallback}. The -@code{req_cls} is fresh for each HTTP request, while the -@code{socket_context} is fresh for each socket. - -Takes no extra arguments. - -@item MHD_CONNECTION_INFO_CONNECTION_TIMEOUT -Returns pointer to an @code{unsigned int} that is the current timeout -used for the connection (in seconds, 0 for no timeout). Note that -while suspended connections will not timeout, the timeout value -returned for suspended connections will be the timeout that the -connection will use after it is resumed, and thus might not be zero. - -Takes no extra arguments. - -@item MHD_CONNECTION_INFO_REQUEST_HEADER_SIZE -@cindex performance -Returns pointer to an @code{size_t} that represents the size of the -HTTP header received from the client. Only valid after the first callback -to the access handler. - -Takes no extra arguments. - -@item MHD_CONNECTION_INFO_HTTP_STATUS -Returns the HTTP status code of the response that was -queued. Returns NULL if no response was queued yet. - -Takes no extra arguments. - -@end table -@end deftp - - - -@c ------------------------------------------------------------ -@node microhttpd-option conn -@section Setting custom options for an individual connection -@cindex timeout - - - -@deftypefun {int} MHD_set_connection_option (struct MHD_Connection *daemon, enum MHD_CONNECTION_OPTION option, ...) -Set a custom option for the given connection. - -@table @var -@item connection -the connection for which an option should be set or modified; - -@item option -option to set - -@item ... -additional arguments for the option (depending on option) -@end table - -Returns @code{MHD_YES} on success, @code{MHD_NO} for errors -(i.e. option argument invalid or option unknown). -@end deftypefun - - -@deftp {Enumeration} MHD_CONNECTION_OPTION -Values of this enum are used to specify which option for a -connection should be changed. - -@table @code - -@item MHD_CONNECTION_OPTION_TIMEOUT -Set a custom timeout for the given connection. Specified -as the number of seconds, given as an @code{unsigned int}. Use -zero for no timeout. - -@end table -@end deftp - - - -@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -@c ------------------------------------------------------------ -@node microhttpd-util -@chapter Utility functions. - - -@menu -* microhttpd-util feature:: Test supported MHD features -* microhttpd-util unescape:: Unescape strings -@end menu - - -@c ------------------------------------------------------------ -@node microhttpd-util feature -@section Testing for supported MHD features - - -@deftp {Enumeration} MHD_FEATURE -Values of this enum are used to specify what -information about a daemon is desired. -@table @code -@item MHD_FEATURE_MESSAGES -Get whether messages are supported. If supported then in debug -mode messages can be printed to stderr or to external logger. - -@item MHD_FEATURE_SSL -Get whether HTTPS is supported. If supported then flag -MHD_USE_SSL and options MHD_OPTION_HTTPS_MEM_KEY, -MHD_OPTION_HTTPS_MEM_CERT, MHD_OPTION_HTTPS_MEM_TRUST, -MHD_OPTION_HTTPS_MEM_DHPARAMS, MHD_OPTION_HTTPS_CRED_TYPE, -MHD_OPTION_HTTPS_PRIORITIES can be used. - -@item MHD_FEATURE_HTTPS_CERT_CALLBACK -Get whether option #MHD_OPTION_HTTPS_CERT_CALLBACK is -supported. - -@item MHD_FEATURE_IPv6 -Get whether IPv6 is supported. If supported then flag -MHD_USE_IPv6 can be used. - -@item MHD_FEATURE_IPv6_ONLY -Get whether IPv6 without IPv4 is supported. If not supported -then IPv4 is always enabled in IPv6 sockets and -flag MHD_USE_DUAL_STACK if always used when MHD_USE_IPv6 is -specified. - -@item MHD_FEATURE_POLL -Get whether @code{poll()} is supported. If supported then flag -MHD_USE_POLL can be used. - -@item MHD_FEATURE_EPOLL -Get whether @code{epoll()} is supported. If supported then Flags -MHD_USE_EPOLL and -MHD_USE_EPOLL_INTERNAL_THREAD can be used. - -@item MHD_FEATURE_SHUTDOWN_LISTEN_SOCKET -Get whether shutdown on listen socket to signal other -threads is supported. If not supported flag -MHD_USE_ITC is automatically forced. - -@item MHD_FEATURE_SOCKETPAIR -Get whether a @code{socketpair()} is used internally instead of -a @code{pipe()} to signal other threads. - -@item MHD_FEATURE_TCP_FASTOPEN -Get whether TCP Fast Open is supported. If supported then -flag MHD_USE_TCP_FASTOPEN and option -MHD_OPTION_TCP_FASTOPEN_QUEUE_SIZE can be used. - -@item MHD_FEATURE_BASIC_AUTH -Get whether HTTP Basic authorization is supported. If supported -then functions @code{MHD_basic_auth_get_username_password()} and -@code{MHD_queue_basic_auth_fail_response()} can be used. - -@item MHD_FEATURE_DIGEST_AUTH -Get whether HTTP Digest authorization is supported. If -supported then options MHD_OPTION_DIGEST_AUTH_RANDOM, -MHD_OPTION_NONCE_NC_SIZE and functions @code{MHD_digest_auth_check()}, -can be used. - -@item MHD_FEATURE_POSTPROCESSOR -Get whether postprocessor is supported. If supported then -functions @code{MHD_create_post_processor()}, -@code{MHD_post_process()}, @code{MHD_destroy_post_processor()} -can be used. - -@item MHD_FEATURE_SENDFILE -Get whether @code{sendfile()} is supported. - -@end table -@end deftp - - - -@deftypefun {int} MHD_is_feature_supported (enum MHD_FEATURE feature) -Get information about supported MHD features. Indicate that MHD was -compiled with or without support for particular feature. Some features -require additional support by the kernel. However, kernel support is not -checked by this function. - -@table @var -@item feature -type of requested information -@end table - -Returns @code{MHD_YES} if the feature is supported, -and @code{MHD_NO} if not. -@end deftypefun - - -@c ------------------------------------------------------------ -@node microhttpd-util unescape -@section Unescape strings - -@deftypefun {size_t} MHD_http_unescape (char *val) -Process escape sequences ('%HH') Updates val in place; the result -should be UTF-8 encoded and cannot be larger than the input. The -result must also still be 0-terminated. - -@table @var -@item val -value to unescape (modified in the process), must be -a 0-terminated UTF-8 string. -@end table - -Returns length of the resulting val (@code{strlen(val)} may be -shorter afterwards due to elimination of escape sequences). - -@end deftypefun - - - - - -@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -@c ------------------------------------------------------------ -@node microhttpd-websocket -@chapter Websocket functions. - -@noindent -Websocket functions provide what you need to use an upgraded connection -as a websocket. -These functions are only available if you include the header file -@code{microhttpd_ws.h} and compiled @emph{libmicrohttpd} with websockets. - -@menu -* microhttpd-websocket handshake:: Websocket handshake functions -* microhttpd-websocket stream:: Websocket stream functions -* microhttpd-websocket decode:: Websocket decode functions -* microhttpd-websocket encode:: Websocket encode functions -* microhttpd-websocket memory:: Websocket memory functions -@end menu - -@c ------------------------------------------------------------ -@node microhttpd-websocket handshake -@section Websocket handshake functions - - -@deftypefun {enum MHD_WEBSOCKET_STATUS} MHD_websocket_check_http_version (const char* http_version) -@cindex websocket -Checks the HTTP version of the incoming request. -Websocket requests are only allowed for HTTP/1.1 or above. - -@table @var -@item http_version -The value of the @code{version} parameter of your -@code{access_handler} callback. -If you pass @code{NULL} then this is handled like a not -matching HTTP version. -@end table - -Returns 0 when the HTTP version is -valid for a websocket request and -a value less than zero when the HTTP version isn't -valid for a websocket request. -Can be compared with @code{enum MHD_WEBSOCKET_STATUS}. -@end deftypefun - - -@deftypefun {enum MHD_WEBSOCKET_STATUS} MHD_websocket_check_connection_header (const char* connection_header) -@cindex websocket -Checks the value of the @code{Connection} HTTP request header. -Websocket requests require the token @code{Upgrade} in -the @code{Connection} HTTP request header. - -@table @var -@item connection_header -Value of the @code{Connection} request header. -You can get this request header value by passing -@code{MHD_HTTP_HEADER_CONNECTION} to -@code{MHD_lookup_connection_value()}. -If you pass @code{NULL} then this is handled like a not -matching @code{Connection} header value. -@end table - -Returns 0 when the @code{Connection} header is -valid for a websocket request and -a value less than zero when the @code{Connection} header isn't -valid for a websocket request. -Can be compared with @code{enum MHD_WEBSOCKET_STATUS}. -@end deftypefun - - -@deftypefun {enum MHD_WEBSOCKET_STATUS} MHD_websocket_check_upgrade_header (const char* upgrade_header) -@cindex websocket -Checks the value of the @code{Upgrade} HTTP request header. -Websocket requests require the value @code{websocket} in -the @code{Upgrade} HTTP request header. - -@table @var -@item upgrade_header -Value of the @code{Upgrade} request header. -You can get this request header value by passing -@code{MHD_HTTP_HEADER_UPGRADE} to -@code{MHD_lookup_connection_value()}. -If you pass @code{NULL} then this is handled like a not -matching @code{Upgrade} header value. -@end table - -Returns 0 when the @code{Upgrade} header is -valid for a websocket request and -a value less than zero when the @code{Upgrade} header isn't -valid for a websocket request. -Can be compared with @code{enum MHD_WEBSOCKET_STATUS}. -@end deftypefun - - -@deftypefun {enum MHD_WEBSOCKET_STATUS} MHD_websocket_check_version_header (const char* version_header) -@cindex websocket -Checks the value of the @code{Sec-WebSocket-Version} HTTP request header. -Websocket requests require the value @code{13} in -the @code{Sec-WebSocket-Version} HTTP request header. - -@table @var -@item version_header -Value of the @code{Sec-WebSocket-Version} request header. -You can get this request header value by passing -@code{MHD_HTTP_HEADER_SEC_WEBSOCKET_VERSION} to -@code{MHD_lookup_connection_value()}. -If you pass @code{NULL} then this is handled like a not -matching @code{Sec-WebSocket-Version} header value. -@end table - -Returns 0 when the @code{Sec-WebSocket-Version} header is -valid for a websocket request and -a value less than zero when the @code{Sec-WebSocket-Version} header isn't -valid for a websocket request. -Can be compared with @code{enum MHD_WEBSOCKET_STATUS}. -@end deftypefun - - -@deftypefun {enum MHD_WEBSOCKET_STATUS} MHD_websocket_create_accept_header (const char* sec_websocket_key, char* sec_websocket_accept) -@cindex websocket -Checks the value of the @code{Sec-WebSocket-Key} -HTTP request header and generates the value for -the @code{Sec-WebSocket-Accept} HTTP response header. -The generated value must be sent to the client. - -@table @var -@item sec_websocket_key -Value of the @code{Sec-WebSocket-Key} request header. -You can get this request header value by passing -@code{MHD_HTTP_HEADER_SEC_WEBSOCKET_KEY} to -@code{MHD_lookup_connection_value()}. -If you pass @code{NULL} then this is handled like a not -matching @code{Sec-WebSocket-Key} header value. - -@item sec_websocket_accept -Response buffer, which will receive -the generated value for the @code{Sec-WebSocket-Accept} -HTTP response header. -This buffer must be at least 29 bytes long and -will contain the response value plus a terminating @code{NUL} -character on success. -Must not be @code{NULL}. -You can add this HTTP header to your response by passing -@code{MHD_HTTP_HEADER_SEC_WEBSOCKET_ACCEPT} to -@code{MHD_add_response_header()}. -@end table - -Returns 0 when the @code{Sec-WebSocket-Key} header was -not empty and a result value for the @code{Sec-WebSocket-Accept} -was calculated. -A value less than zero is returned when the @code{Sec-WebSocket-Key} -header isn't valid for a websocket request or when any -error occurred. -Can be compared with @code{enum MHD_WEBSOCKET_STATUS}. -@end deftypefun - - -@c ------------------------------------------------------------ -@node microhttpd-websocket stream -@section Websocket stream functions - -@deftypefun {enum MHD_WEBSOCKET_STATUS} MHD_websocket_stream_init (struct MHD_WebSocketStream **ws, int flags, size_t max_payload_size) -@cindex websocket -Creates a new websocket stream, used for decoding/encoding. - -@table @var -@item ws -pointer a variable to fill with the newly created -@code{struct MHD_WebSocketStream}, -receives @code{NULL} on error. May not be @code{NULL}. - -If not required anymore, free the created websocket stream with -@code{MHD_websocket_stream_free()}. - -@item flags -combination of @code{enum MHD_WEBSOCKET_FLAG} values to -modify the behavior of the websocket stream. - -@item max_payload_size -maximum size for incoming payload data in bytes. Use 0 to allow each size. -@end table - -Returns 0 on success, negative values on error. -Can be compared with @code{enum MHD_WEBSOCKET_STATUS}. -@end deftypefun - - -@deftypefun {enum MHD_WEBSOCKET_STATUS} MHD_websocket_stream_init2 (struct MHD_WebSocketStream **ws, int flags, size_t max_payload_size, MHD_WebSocketMallocCallback callback_malloc, MHD_WebSocketReallocCallback callback_realloc, MHD_WebSocketFreeCallback callback_free, void* cls_rng, MHD_WebSocketRandomNumberGenerator callback_rng) -@cindex websocket -Creates a new websocket stream, used for decoding/encoding, -but with custom memory functions for malloc, realloc and free. -Also a random number generator can be specified for client mode. - -@table @var -@item ws -pointer a variable to fill with the newly created -@code{struct MHD_WebSocketStream}, -receives @code{NULL} on error. Must not be @code{NULL}. - -If not required anymore, free the created websocket stream with -@code{MHD_websocket_stream_free}. - -@item flags -combination of @code{enum MHD_WEBSOCKET_FLAG} values to -modify the behavior of the websocket stream. - -@item max_payload_size -maximum size for incoming payload data in bytes. Use 0 to allow each size. - -@item callback_malloc -callback function for allocating memory. Must not be @code{NULL}. -The shorter @code{MHD_websocket_stream_init()} passes a reference to @code{malloc} here. - -@item callback_realloc -callback function for reallocating memory. Must not be @code{NULL}. -The shorter @code{MHD_websocket_stream_init()} passes a reference to @code{realloc} here. - -@item callback_free -callback function for freeing memory. Must not be @code{NULL}. -The shorter @code{MHD_websocket_stream_init()} passes a reference to @code{free} here. - -@item cls_rng -closure for the random number generator. -This is only required when -@code{MHD_WEBSOCKET_FLAG_CLIENT} is passed in @code{flags}. -The given value is passed to the random number generator callback. -May be @code{NULL} if not needed. -Should be @code{NULL} when you are not using @code{MHD_WEBSOCKET_FLAG_CLIENT}. -The shorter @code{MHD_websocket_stream_init} passes @code{NULL} here. - -@item callback_rng -callback function for a secure random number generator. -This is only required when @code{MHD_WEBSOCKET_FLAG_CLIENT} is -passed in @code{flags} and must not be @code{NULL} then. -Should be @code{NULL} otherwise. -The shorter @code{MHD_websocket_stream_init()} passes @code{NULL} here. -@end table - -Returns 0 on success, negative values on error. -Can be compared with @code{enum MHD_WEBSOCKET_STATUS}. -@end deftypefun - - -@deftypefun {enum MHD_WEBSOCKET_STATUS} MHD_websocket_stream_free (struct MHD_WebSocketStream *ws) -@cindex websocket -Frees a previously allocated websocket stream - -@table @var -@item ws -websocket stream to free, this value may be @code{NULL}. -@end table - -Returns 0 on success, negative values on error. -Can be compared with @code{enum MHD_WEBSOCKET_STATUS}. -@end deftypefun - - -@deftypefun {enum MHD_WEBSOCKET_STATUS} MHD_websocket_stream_invalidate (struct MHD_WebSocketStream *ws) -@cindex websocket -Invalidates a websocket stream. -After invalidation a websocket stream cannot be used for decoding anymore. -Encoding is still possible. - -@table @var -@item ws -websocket stream to invalidate. -@end table - -Returns 0 on success, negative values on error. -Can be compared with @code{enum MHD_WEBSOCKET_STATUS}. -@end deftypefun - - -@deftypefun {enum MHD_WEBSOCKET_VALIDITY} MHD_websocket_stream_is_valid (struct MHD_WebSocketStream *ws) -@cindex websocket -Queries whether a websocket stream is valid. -Invalidated websocket streams cannot be used for decoding anymore. -Encoding is still possible. - -@table @var -@item ws -websocket stream to invalidate. -@end table - -Returns 0 if invalid, 1 if valid for all types or -2 if valid only for control frames. -Can be compared with @code{enum MHD_WEBSOCKET_VALIDITY}. -@end deftypefun - - -@c ------------------------------------------------------------ -@node microhttpd-websocket decode -@section Websocket decode functions - - -@deftypefun {enum MHD_WEBSOCKET_STATUS} MHD_websocket_decode (struct MHD_WebSocketStream* ws, const char* streambuf, size_t streambuf_len, size_t* streambuf_read_len, char** payload, size_t* payload_len) -@cindex websocket -Decodes a byte sequence for a websocket stream. -Decoding is done until either a frame is complete or -the end of the byte sequence is reached. - -@table @var -@item ws -websocket stream for decoding. - -@item streambuf -byte sequence for decoding. -This is what you typically received via @code{recv()}. - -@item streambuf_len -length of the byte sequence in parameter @code{streambuf}. - -@item streambuf_read_len -pointer to a variable, which receives the number of bytes, -that has been processed by this call. -This value may be less than the value of @code{streambuf_len} when -a frame is decoded before the end of the buffer is reached. -The remaining bytes of @code{buf} must be passed to -the next call of this function. - -@item payload -pointer to a variable, which receives the allocated buffer with the payload -data of the decoded frame. Must not be @code{NULL}. -If no decoded data is available or an error occurred @code{NULL} is returned. -When the returned value is not @code{NULL} then the buffer contains always -@code{payload_len} bytes plus one terminating @code{NUL} character -(regardless of the frame type). - -The caller must free this buffer using @code{MHD_websocket_free()}. - -If you passed the flag @code{MHD_WEBSOCKET_FLAG_GENERATE_CLOSE_FRAMES_ON_ERROR} -upon creation of the websocket stream and a decoding error occurred -(function return value less than 0), then this buffer contains -a generated close frame, which must be sent via the socket to the recipient. - -If you passed the flag @code{MHD_WEBSOCKET_FLAG_WANT_FRAGMENTS} -upon creation of the websocket stream then -this payload may only be a part of the complete message. -Only complete UTF-8 sequences are returned for fragmented text frames. -If necessary the UTF-8 sequence will be completed with the next text fragment. - -@item payload_len -pointer to a variable, which receives length of the result -@code{payload} buffer in bytes. -Must not be @code{NULL}. -This receives 0 when no data is available, when the decoded payload -has a length of zero or when an error occurred. -@end table - -Returns a value greater than zero when a frame is complete. -Compare with @code{enum MHD_WEBSOCKET_STATUS} to distinguish the frame type. -Returns 0 when the call succeeded, but no frame is available. -Returns a value less than zero on errors. -@end deftypefun - - -@deftypefun {enum MHD_WEBSOCKET_STATUS} MHD_websocket_split_close_reason (const char* payload, size_t payload_len, unsigned short* reason_code, const char** reason_utf8, size_t* reason_utf8_len) -@cindex websocket -Splits the payload of a decoded close frame. - -@table @var -@item payload -payload of the close frame. -This parameter may only be @code{NULL} if @code{payload_len} is 0. - -@item payload_len -length of @code{payload}. - -@item reason_code -pointer to a variable, which receives the numeric close reason. -If there was no close reason, this is 0. -This value can be compared with @code{enum MHD_WEBSOCKET_CLOSEREASON}. -May be @code{NULL}. - -@item reason_utf8 -pointer to a variable, which receives the literal close reason. -If there was no literal close reason, this will be @code{NULL}. -May be @code{NULL}. - -Please note that no memory is allocated in this function. -If not @code{NULL} the returned value of this parameter -points to a position in the specified @code{payload}. - -@item reason_utf8_len -pointer to a variable, which receives the length of the literal close reason. -If there was no literal close reason, this is 0. -May be @code{NULL}. -@end table - -Returns 0 on success or a value less than zero on errors. -Can be compared with @code{enum MHD_WEBSOCKET_STATUS}. -@end deftypefun - - -@c ------------------------------------------------------------ -@node microhttpd-websocket encode -@section Websocket encode functions - - -@deftypefun {enum MHD_WEBSOCKET_STATUS} MHD_websocket_encode_text (struct MHD_WebSocketStream* ws, const char* payload_utf8, size_t payload_utf8_len, int fragmentation, char** frame, size_t* frame_len, int* utf8_step) -@cindex websocket -Encodes an UTF-8 encoded text into websocket text frame - -@table @var -@item ws -websocket stream; - -@item payload_utf8 -text to send. This must be UTF-8 encoded. -If you don't want UTF-8 then send a binary frame -with @code{MHD_websocket_encode_binary()} instead. -May be be @code{NULL} if @code{payload_utf8_len} is 0, -must not be @code{NULL} otherwise. - -@item payload_utf8_len -length of @code{payload_utf8} in bytes. - -@item fragmentation -A value of @code{enum MHD_WEBSOCKET_FRAGMENTATION} -to specify the fragmentation behavior. -Specify @code{MHD_WEBSOCKET_FRAGMENTATION_NONE} or just 0 -if you don't want to use fragmentation (default). - -@item frame -pointer to a variable, which receives a buffer with the encoded text frame. -Must not be @code{NULL}. -The buffer contains what you typically send via @code{send()} to the recipient. -If no encoded data is available the variable receives @code{NULL}. - -If the variable is not @code{NULL} then the buffer contains always -@code{frame_len} bytes plus one terminating @code{NUL} character. -The caller must free this buffer using @code{MHD_websocket_free()}. - -@item frame_len -pointer to a variable, which receives the length of the encoded frame in bytes. -Must not be @code{NULL}. - -@item utf8_step -If fragmentation is used (the parameter @code{fragmentation} is not 0) -then is parameter is required and must not be @code{NULL}. -If no fragmentation is used, this parameter is optional and -should be @code{NULL}. - -This parameter is a pointer to a variable which contains the last check status -of the UTF-8 sequence. It is required to continue a previous -UTF-8 sequence check when fragmentation is used, because a UTF-8 sequence -could be split upon fragments. - -@code{enum MHD_WEBSOCKET_UTF8STEP} is used for this value. -If you start a new fragment using -@code{MHD_WEBSOCKET_FRAGMENTATION_NONE} or -@code{MHD_WEBSOCKET_FRAGMENTATION_FIRST} the old value of this variable -will be discarded and the value of this variable will be initialized -to @code{MHD_WEBSOCKET_UTF8STEP_NORMAL}. -On all other fragmentation modes the previous value of the pointed variable -will be used to continue the UTF-8 sequence check. -@end table - -Returns 0 on success or a value less than zero on errors. -Can be compared with @code{enum MHD_WEBSOCKET_STATUS}. -@end deftypefun - - -@deftypefun {enum MHD_WEBSOCKET_STATUS} MHD_websocket_encode_binary (struct MHD_WebSocketStream* ws, const char* payload, size_t payload_len, int fragmentation, char** frame, size_t* frame_len) -@cindex websocket -Encodes binary data into websocket binary frame - -@table @var -@item ws -websocket stream; - -@item payload -binary data to send. -May be be @code{NULL} if @code{payload_len} is 0, -must not be @code{NULL} otherwise. - -@item payload_len -length of @code{payload} in bytes. - -@item fragmentation -A value of @code{enum MHD_WEBSOCKET_FRAGMENTATION} -to specify the fragmentation behavior. -Specify @code{MHD_WEBSOCKET_FRAGMENTATION_NONE} or just 0 -if you don't want to use fragmentation (default). - -@item frame -pointer to a variable, which receives a buffer with the encoded binary frame. -Must not be @code{NULL}. -The buffer contains what you typically send via @code{send()} to the recipient. -If no encoded data is available the variable receives @code{NULL}. - -If the variable is not @code{NULL} then the buffer contains always -@code{frame_len} bytes plus one terminating @code{NUL} character. -The caller must free this buffer using @code{MHD_websocket_free()}. - -@item frame_len -pointer to a variable, which receives the length of the encoded frame in bytes. -Must not be @code{NULL}. -@end table - -Returns 0 on success or a value less than zero on errors. -Can be compared with @code{enum MHD_WEBSOCKET_STATUS}. -@end deftypefun - - -@deftypefun {enum MHD_WEBSOCKET_STATUS} MHD_websocket_encode_ping (struct MHD_WebSocketStream* ws, const char* payload, size_t payload_len, char** frame, size_t* frame_len) -@cindex websocket -Encodes a websocket ping frame. -Ping frames are used to check whether a recipient is still available -and what latency the websocket connection has. - -@table @var -@item ws -websocket stream; - -@item payload -binary ping data to send. -May be @code{NULL} if @code{payload_len} is 0. - -@item payload_len -length of @code{payload} in bytes. -This may not exceed 125 bytes. - -@item frame -pointer to a variable, which receives a buffer with the encoded ping frame. -Must not be @code{NULL}. -The buffer contains what you typically send via @code{send()} to the recipient. -If no encoded data is available the variable receives @code{NULL}. - -If the variable is not @code{NULL} then the buffer contains always -@code{frame_len} bytes plus one terminating @code{NUL} character. -The caller must free this buffer using @code{MHD_websocket_free()}. - -@item frame_len -pointer to a variable, which receives the length of the encoded frame in bytes. -Must not be @code{NULL}. -@end table - -Returns 0 on success or a value less than zero on errors. -Can be compared with @code{enum MHD_WEBSOCKET_STATUS}. -@end deftypefun - - -@deftypefun {enum MHD_WEBSOCKET_STATUS} MHD_websocket_encode_pong (struct MHD_WebSocketStream* ws, const char* payload, size_t payload_len, char** frame, size_t* frame_len) -@cindex websocket -Encodes a websocket pong frame. -Pong frames are used to answer a previously received websocket ping frame. - -@table @var -@item ws -websocket stream; - -@item payload -binary pong data to send, which should be -the decoded payload from the received ping frame. -May be @code{NULL} if @code{payload_len} is 0. - -@item payload_len -length of @code{payload} in bytes. -This may not exceed 125 bytes. - -@item frame -pointer to a variable, which receives a buffer with the encoded pong frame. -Must not be @code{NULL}. -The buffer contains what you typically send via @code{send()} to the recipient. -If no encoded data is available the variable receives @code{NULL}. - -If the variable is not @code{NULL} then the buffer contains always -@code{frame_len} bytes plus one terminating @code{NUL} character. -The caller must free this buffer using @code{MHD_websocket_free()}. - -@item frame_len -pointer to a variable, which receives the length of the encoded frame in bytes. -Must not be @code{NULL}. -@end table - -Returns 0 on success or a value less than zero on errors. -Can be compared with @code{enum MHD_WEBSOCKET_STATUS}. -@end deftypefun - - -@deftypefun {enum MHD_WEBSOCKET_STATUS} MHD_websocket_encode_close (struct MHD_WebSocketStream* ws, unsigned short reason_code, const char* reason_utf8, size_t reason_utf8_len, char** frame, size_t* frame_len) -@cindex websocket -Encodes a websocket close frame. -Close frames are used to close a websocket connection in a formal way. - -@table @var -@item ws -websocket stream; - -@item reason_code -reason for close. -You can use @code{enum MHD_WEBSOCKET_CLOSEREASON} for typical reasons, -but you are not limited to these values. -The allowed values are specified in RFC 6455 7.4. -If you don't want to enter a reason, you can specify -@code{MHD_WEBSOCKET_CLOSEREASON_NO_REASON} (or just 0) then -no reason is encoded. - -@item reason_utf8 -An UTF-8 encoded text reason why the connection is closed. -This may be @code{NULL} if @code{reason_utf8_len} is 0. -This must be @code{NULL} if @code{reason_code} equals to zero -(@code{MHD_WEBSOCKET_CLOSEREASON_NO_REASON}). - -@item reason_utf8_len -length of the UTF-8 encoded text reason in bytes. -This may not exceed 123 bytes. - -@item frame -pointer to a variable, which receives a buffer with the encoded close frame. -Must not be @code{NULL}. -The buffer contains what you typically send via @code{send()} to the recipient. -If no encoded data is available the variable receives @code{NULL}. - -If the variable is not @code{NULL} then the buffer contains always -@code{frame_len} bytes plus one terminating @code{NUL} character. -The caller must free this buffer using @code{MHD_websocket_free()}. - -@item frame_len -pointer to a variable, which receives the length of the encoded frame in bytes. -Must not be @code{NULL}. -@end table - -Returns 0 on success or a value less than zero on errors. -Can be compared with @code{enum MHD_WEBSOCKET_STATUS}. -@end deftypefun - - -@c ------------------------------------------------------------ -@node microhttpd-websocket memory -@section Websocket memory functions - - -@deftypefun {void*} MHD_websocket_malloc (struct MHD_WebSocketStream* ws, size_t buf_len) -@cindex websocket -Allocates memory with the associated @code{malloc()} function -of the websocket stream. -The memory allocation function could be different for a websocket stream if -@code{MHD_websocket_stream_init2()} has been used for initialization. - -@table @var -@item ws -websocket stream; - -@item buf_len -size of the buffer to allocate in bytes. -@end table - -Returns the pointer of the allocated buffer or @code{NULL} on failure. -@end deftypefun - - -@deftypefun {void*} MHD_websocket_realloc (struct MHD_WebSocketStream* ws, void* buf, size_t new_buf_len) -@cindex websocket -Reallocates memory with the associated @code{realloc()} function -of the websocket stream. -The memory reallocation function could be different for a websocket stream if -@code{MHD_websocket_stream_init2()} has been used for initialization. - -@table @var -@item ws -websocket stream; - -@item buf -current buffer, may be @code{NULL}; - -@item new_buf_len -new size of the buffer in bytes. -@end table - -Return the pointer of the reallocated buffer or @code{NULL} on failure. -On failure the old pointer remains valid. -@end deftypefun - - -@deftypefun {void} MHD_websocket_free (struct MHD_WebSocketStream* ws, void* buf) -@cindex websocket -Frees memory with the associated @code{free()} function -of the websocket stream. -The memory free function could be different for a websocket stream if -@code{MHD_websocket_stream_init2()} has been used for initialization. - -@table @var -@item ws -websocket stream; - -@item buf -buffer to free, this may be @code{NULL} then nothing happens. -@end table - -@end deftypefun - - - - - -@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - - -@c ********************************************************** -@c ******************* Appendices ************************* -@c ********************************************************** - -@node GNU-LGPL -@unnumbered GNU-LGPL -@cindex license -@include lgpl.texi - -@node eCos License -@unnumbered eCos License -@cindex license -@include ecos.texi - -@node GNU-GPL -@unnumbered GNU General Public License -@cindex license -@include gpl-2.0.texi - -@node GNU-FDL -@unnumbered GNU-FDL -@cindex license -@include fdl-1.3.texi - -@node Concept Index -@unnumbered Concept Index - -@printindex cp - -@node Function and Data Index -@unnumbered Function and Data Index - -@printindex fn - -@node Type Index -@unnumbered Type Index - -@printindex tp - -@bye diff --git a/doc/libmicrohttpd2-tutorial.texi b/doc/libmicrohttpd2-tutorial.texi @@ -0,0 +1,193 @@ +\input texinfo @c -*-texinfo-*- +@finalout +@setfilename libmicrohttpd-tutorial.info +@set UPDATED 2 April 2016 +@set UPDATED-MONTH April 2016 +@set EDITION 0.9.48 +@set VERSION 0.9.48 +@settitle A tutorial for GNU libmicrohttpd +@c Unify all the indices into concept index. +@syncodeindex fn cp +@syncodeindex vr cp +@syncodeindex ky cp +@syncodeindex pg cp +@syncodeindex tp cp + +@dircategory Software libraries +@direntry +* libmicrohttpdtutorial: (libmicrohttpd-tutorial). A tutorial for GNU libmicrohttpd. +@end direntry + +@copying +This tutorial documents GNU libmicrohttpd version @value{VERSION}, last +updated @value{UPDATED}. + +Copyright (c) 2008 Sebastian Gerhardt. + +Copyright (c) 2010, 2011, 2012, 2013, 2016, 2021 Christian Grothoff. +@quotation +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 +or any later version published by the Free Software Foundation; +with no Invariant Sections, no Front-Cover Texts, and no Back-Cover +Texts. A copy of the license is included in the section entitled "GNU +Free Documentation License". +@end quotation +@end copying + +@titlepage +@title A Tutorial for GNU libmicrohttpd +@subtitle Version @value{VERSION} +@subtitle @value{UPDATED} +@author Sebastian Gerhardt (@email{sebgerhardt@@gmx.net}) +@author Christian Grothoff (@email{christian@@grothoff.org}) +@author Matthieu Speder (@email{mspeder@@users.sourceforge.net}) + +@page +@vskip 0pt plus 1filll +@insertcopying +@end titlepage + + + +@contents + +@ifnottex +@node Top +@top A Tutorial for GNU libmicrohttpd +@insertcopying +@end ifnottex + +@menu +* Introduction:: +* Hello browser example:: +* Exploring requests:: +* Response headers:: +* Supporting basic authentication:: +* Processing POST data:: +* Improved processing of POST data:: +* Session management:: +* Adding a layer of security:: +* Websockets:: +* Bibliography:: +* License text:: +* Example programs:: +@end menu + +@node Introduction +@chapter Introduction +@include tutorial/introduction.inc + +@node Hello browser example +@chapter Hello browser example +@include tutorial/hellobrowser.inc + +@node Exploring requests +@chapter Exploring requests +@include tutorial/exploringrequests.inc + +@node Response headers +@chapter Response headers +@include tutorial/responseheaders.inc + +@node Supporting basic authentication +@chapter Supporting basic authentication +@include tutorial/basicauthentication.inc + +@node Processing POST data +@chapter Processing POST data +@include tutorial/processingpost.inc + +@node Improved processing of POST data +@chapter Improved processing of POST data +@include tutorial/largerpost.inc + +@node Session management +@chapter Session management +@include tutorial/sessions.inc + +@node Adding a layer of security +@chapter Adding a layer of security +@include tutorial/tlsauthentication.inc + +@node Websockets +@chapter Websockets +@include tutorial/websocket.inc + +@node Bibliography +@appendix Bibliography +@include tutorial/bibliography.inc + +@node License text +@appendix GNU Free Documentation License +@include fdl-1.3.texi + +@node Example programs +@appendix Example programs +@menu +* hellobrowser.c:: +* logging.c:: +* responseheaders.c:: +* basicauthentication.c:: +* simplepost.c:: +* largepost.c:: +* sessions.c:: +* tlsauthentication.c:: +* websocket.c:: +@end menu + +@node hellobrowser.c +@section hellobrowser.c +@smalldisplay +@verbatiminclude examples/hellobrowser.c +@end smalldisplay + +@node logging.c +@section logging.c +@smalldisplay +@verbatiminclude examples/logging.c +@end smalldisplay + +@node responseheaders.c +@section responseheaders.c +@smalldisplay +@verbatiminclude examples/responseheaders.c +@end smalldisplay + +@node basicauthentication.c +@section basicauthentication.c +@smalldisplay +@verbatiminclude examples/basicauthentication.c +@end smalldisplay + +@node simplepost.c +@section simplepost.c +@smalldisplay +@verbatiminclude examples/simplepost.c +@end smalldisplay + +@node largepost.c +@section largepost.c +@smalldisplay +@verbatiminclude examples/largepost.c +@end smalldisplay + +@node sessions.c +@section sessions.c +@smalldisplay +@verbatiminclude examples/sessions.c +@end smalldisplay + +@node tlsauthentication.c +@section tlsauthentication.c +@smalldisplay +@verbatiminclude examples/tlsauthentication.c +@end smalldisplay + +@node websocket.c +@section websocket.c +@smalldisplay +@verbatiminclude examples/websocket.c +@end smalldisplay + +@bye diff --git a/doc/libmicrohttpd2.texi b/doc/libmicrohttpd2.texi @@ -0,0 +1,180 @@ +\input texinfo +@setfilename libmicrohttpd2.info +@documentencoding UTF-8 +@include version.texi +@settitle The GNU libmicrohttpd2 Reference Manual +@c Unify all the indices into concept index. +@syncodeindex vr cp +@syncodeindex ky cp +@syncodeindex pg cp +@copying +This manual is for GNU libmicrohttpd +(version @value{VERSION}, @value{UPDATED}), a library for embedding +an HTTP(S) server into C applications. + +Copyright @copyright{} 2025 Christian Grothoff + +@quotation +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 +or any later version published by the Free Software Foundation; +with no Invariant Sections, no Front-Cover Texts, and no Back-Cover +Texts. A copy of the license is included in the section entitled "GNU +Free Documentation License". +@end quotation + +We are grateful for financial support from the SovereignTechFund +(2024--2025) of the German government. +@end copying + +@dircategory Software libraries +@direntry +* libmicrohttpd2: (libmicrohttpd2). Embedded HTTP server library. +@end direntry + +@c +@c Titlepage +@c +@titlepage +@title The GNU libmicrohttpd2 Reference Manual +@subtitle Version @value{VERSION} +@subtitle @value{UPDATED} +@author Christian Grothoff (@email{christian@@grothoff.org}) +@page +@vskip 0pt plus 1filll +@insertcopying +@end titlepage + +@summarycontents +@contents + +@c ------------------------------------------------------------ +@ifnottex +@node Top +@top The GNU libmicrohttpd2 Library +@insertcopying +@end ifnottex + + +@menu +* libmicrohttpd2-introduction:: Introduction. +* libmicrohttpd2-init:: Starting and stopping the HTTP daemon. +* libmicrohttpd2-doptions:: Configuring your HTTP daemon. +* libmicrohttpd2-external:: Using external event loops. +* libmicrohttpd2-requests:: Accessing client request data. +* libmicrohttpd2-actions:: Acting on HTTP requests. +* libmicrohttpd2-responses:: Generating HTTP responses. +* libmicrohttpd2-post:: Parsing POST data. +* libmicrohttpd2-auth:: Using HTTP authentication. +* libmicrohttpd2-introspection:: Introspecting MHD objects. +* libmicrohttpd2-migration:: Migration from GNU libmicrohttpd 1.0. + +Appendices + +* GNU-LGPL:: The GNU Lesser General Public License says how you + can copy and share almost all of `libmicrohttpd2'. +* eCos License:: The eCos License says how you can copy and share some parts of `libmicrohttpd2'. +* GNU-GPL:: The GNU General Public License (with eCos extension) says how you can copy and share some parts of `libmicrohttpd2'. +* GNU-FDL:: The GNU Free Documentation License says how you + can copy and share the documentation of `libmicrohttpd2'. + +Indices + +* Concept Index:: Index of concepts and programs. +* Function and Data Index:: Index of functions, variables and data types. +* Type Index:: Index of data types. +@end menu + + +@node libmicrohttpd2-introduction +@chapter Introduction +@include manual/introduction.inc + +@node libmicrohttpd2-init +@chapter Starting and stopping the HTTP daemon +@include manual/init.inc + +@node libmicrohttpd2-doptions +@chapter Configuring your HTTP daemon +@include manual/doptions.inc + +@node libmicrohttpd2-external +@chapter Using external event loops +@include manual/external.inc + +@node libmicrohttpd2-requests +@chapter Accessing client request data +@include manual/requests.inc + +@node libmicrohttpd2-actions +@chapter Reacting to HTTP requests with actions +@include manual/actions.inc + +@node libmicrohttpd2-responses +@chapter Responses to HTTP requests +@include manual/responses.inc + +@node libmicrohttpd2-postprocessor +@chapter Parsing HTML form data with the POST processor +@include manual/postprocessor.inc + +@node libmicrohttpd2-authentication +@chapter Using HTTP authentication +@include manual/authentication.inc + +@node libmicrohttpd2-introspection +@chapter Introspecting MHD objects. +@include manual/introspection.inc + +@node libmicrohttpd2-migration +@chapter Migrating code to MHD2 +@include manual/migration.inc + + +@c NEXT: +@c - chapter on migration! [Sa+Su] + +@c FIXME: document other options (connection, request, session) + +@c FIXME: document utility functions +@c @node libmicrohttpd2-util +@c @chapter Utility functions. +@c @include manual/utility.inc + + +@node GNU-LGPL +@unnumbered GNU-LGPL +@cindex license +@include lgpl.texi + +@node eCos License +@unnumbered eCos License +@cindex license +@include ecos.texi + +@node GNU-GPL +@unnumbered GNU General Public License +@cindex license +@include gpl-2.0.texi + +@node GNU-FDL +@unnumbered GNU-FDL +@cindex license +@include fdl-1.3.texi + +@node Concept Index +@unnumbered Concept Index + +@printindex cp + +@node Function and Data Index +@unnumbered Function and Data Index + +@printindex fn + +@node Type Index +@unnumbered Type Index + +@printindex tp + +@bye diff --git a/doc/libmicrohttpd_performance_data.eps b/doc/libmicrohttpd_performance_data.eps @@ -1,8468 +0,0 @@ -%!PS-Adobe-3.0 EPSF-3.0 -%%Creator: (ImageMagick) -%%Title: (libmicrohttpd_performance_data.eps) -%%CreationDate: (2014-02-19T07:16:22+01:00) -%%BoundingBox: -0 -0 640 480 -%%HiResBoundingBox: 0 0 640 480 -%%DocumentData: Clean7Bit -%%LanguageLevel: 1 -%%Pages: 1 -%%EndComments - -%%BeginDefaults -%%EndDefaults - -%%BeginProlog -% -% Display a color image. The image is displayed in color on -% Postscript viewers or printers that support color, otherwise -% it is displayed as grayscale. -% -/DirectClassPacket -{ - % - % Get a DirectClass packet. - % - % Parameters: - % red. - % green. - % blue. - % length: number of pixels minus one of this color (optional). - % - currentfile color_packet readhexstring pop pop - compression 0 eq - { - /number_pixels 3 def - } - { - currentfile byte readhexstring pop 0 get - /number_pixels exch 1 add 3 mul def - } ifelse - 0 3 number_pixels 1 sub - { - pixels exch color_packet putinterval - } for - pixels 0 number_pixels getinterval -} bind def - -/DirectClassImage -{ - % - % Display a DirectClass image. - % - systemdict /colorimage known - { - columns rows 8 - [ - columns 0 0 - rows neg 0 rows - ] - { DirectClassPacket } false 3 colorimage - } - { - % - % No colorimage operator; convert to grayscale. - % - columns rows 8 - [ - columns 0 0 - rows neg 0 rows - ] - { GrayDirectClassPacket } image - } ifelse -} bind def - -/GrayDirectClassPacket -{ - % - % Get a DirectClass packet; convert to grayscale. - % - % Parameters: - % red - % green - % blue - % length: number of pixels minus one of this color (optional). - % - currentfile color_packet readhexstring pop pop - color_packet 0 get 0.299 mul - color_packet 1 get 0.587 mul add - color_packet 2 get 0.114 mul add - cvi - /gray_packet exch def - compression 0 eq - { - /number_pixels 1 def - } - { - currentfile byte readhexstring pop 0 get - /number_pixels exch 1 add def - } ifelse - 0 1 number_pixels 1 sub - { - pixels exch gray_packet put - } for - pixels 0 number_pixels getinterval -} bind def - -/GrayPseudoClassPacket -{ - % - % Get a PseudoClass packet; convert to grayscale. - % - % Parameters: - % index: index into the colormap. - % length: number of pixels minus one of this color (optional). - % - currentfile byte readhexstring pop 0 get - /offset exch 3 mul def - /color_packet colormap offset 3 getinterval def - color_packet 0 get 0.299 mul - color_packet 1 get 0.587 mul add - color_packet 2 get 0.114 mul add - cvi - /gray_packet exch def - compression 0 eq - { - /number_pixels 1 def - } - { - currentfile byte readhexstring pop 0 get - /number_pixels exch 1 add def - } ifelse - 0 1 number_pixels 1 sub - { - pixels exch gray_packet put - } for - pixels 0 number_pixels getinterval -} bind def - -/PseudoClassPacket -{ - % - % Get a PseudoClass packet. - % - % Parameters: - % index: index into the colormap. - % length: number of pixels minus one of this color (optional). - % - currentfile byte readhexstring pop 0 get - /offset exch 3 mul def - /color_packet colormap offset 3 getinterval def - compression 0 eq - { - /number_pixels 3 def - } - { - currentfile byte readhexstring pop 0 get - /number_pixels exch 1 add 3 mul def - } ifelse - 0 3 number_pixels 1 sub - { - pixels exch color_packet putinterval - } for - pixels 0 number_pixels getinterval -} bind def - -/PseudoClassImage -{ - % - % Display a PseudoClass image. - % - % Parameters: - % class: 0-PseudoClass or 1-Grayscale. - % - currentfile buffer readline pop - token pop /class exch def pop - class 0 gt - { - currentfile buffer readline pop - token pop /depth exch def pop - /grays columns 8 add depth sub depth mul 8 idiv string def - columns rows depth - [ - columns 0 0 - rows neg 0 rows - ] - { currentfile grays readhexstring pop } image - } - { - % - % Parameters: - % colors: number of colors in the colormap. - % colormap: red, green, blue color packets. - % - currentfile buffer readline pop - token pop /colors exch def pop - /colors colors 3 mul def - /colormap colors string def - currentfile colormap readhexstring pop pop - systemdict /colorimage known - { - columns rows 8 - [ - columns 0 0 - rows neg 0 rows - ] - { PseudoClassPacket } false 3 colorimage - } - { - % - % No colorimage operator; convert to grayscale. - % - columns rows 8 - [ - columns 0 0 - rows neg 0 rows - ] - { GrayPseudoClassPacket } image - } ifelse - } ifelse -} bind def - -/DisplayImage -{ - % - % Display a DirectClass or PseudoClass image. - % - % Parameters: - % x & y translation. - % x & y scale. - % label pointsize. - % image label. - % image columns & rows. - % class: 0-DirectClass or 1-PseudoClass. - % compression: 0-none or 1-RunlengthEncoded. - % hex color packets. - % - gsave - /buffer 512 string def - /byte 1 string def - /color_packet 3 string def - /pixels 768 string def - - currentfile buffer readline pop - token pop /x exch def - token pop /y exch def pop - x y translate - currentfile buffer readline pop - token pop /x exch def - token pop /y exch def pop - currentfile buffer readline pop - token pop /pointsize exch def pop - /Times-Roman findfont pointsize scalefont setfont - x y scale - currentfile buffer readline pop - token pop /columns exch def - token pop /rows exch def pop - currentfile buffer readline pop - token pop /class exch def pop - currentfile buffer readline pop - token pop /compression exch def pop - class 0 gt { PseudoClassImage } { DirectClassImage } ifelse - grestore -} bind def -%%EndProlog -%%Page: 1 1 -%%PageBoundingBox: 0 0 640 480 -userdict begin -DisplayImage -0 0 -640 480 -12 -640 480 -1 -0 -0 -102 -FFFFFF -000000 -A0A0A0 -FF0000 -00C000 -0080FF -C000FF -00EEEE -C04000 -C8C800 -4169E1 -FFC020 -008040 -C080FF -306080 -8B0000 -408000 -FF80FF -7FFFD4 -A52A2A -FFFF00 -40E0D0 -000000 -1A1A1A -333333 -4D4D4D -666666 -7F7F7F -999999 -B3B3B3 -C0C0C0 -CCCCCC -E5E5E5 -FFFFFF -F03232 -90EE90 -ADD8E6 -F055F0 -E0FFFF -EEDD82 -FFB6C1 -AFEEEE -FFD700 -00FF00 -006400 -00FF7F -228B22 -2E8B57 -0000FF -00008B -191970 -000080 -0000CD -87CEEB -00FFFF -FF00FF -00CED1 -FF1493 -FF7F50 -F08080 -FF4500 -FA8072 -E9967A -F0E68C -BDB76B -B8860B -F5F5DC -A08020 -FFA500 -EE82EE -9400D3 -DDA0DD -905040 -556B2F -801400 -801414 -804014 -804080 -8060C0 -8060FF -808000 -FF8040 -FFA040 -FFA060 -FFA070 -FFC0C0 -FFFF80 -FFFFC0 -CDB79E -F0FFF0 -A0B6CD -C1FFC1 -CDC0B0 -7CFF40 -A0FF20 -BEBEBE -BFBFBF -5F5F5F -1F1F1F -DFDFDF -9F9F9F -3F3F3F -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001010101010101010100010000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000000000000000000000100000000000000000000000000000000000000000000 -0000000000000000606101010000000000006361010161630000000000636101016163000000 -0063610101616300000000000000000000000000000000000000000000000000606101010000 -0000000000636101016163000000006361010161630000000063610101616300000000636101 -0161630000000063610101616300000000006361010161630000000100000000000000000000 -0000000000000000000000000000000000000000000000000000000161000000000000006101 -0000010000000000000000010000000101010162651B63000000000100000000000000000000 -0000000000000001000000000100000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000010000000000000000010000000000000000000000 -0000000000000000000000000000000000000000000000010000000001010101010101010000 -0000000000000060650162616300000000010101010101000000006361010161630000000000 -00631B6562016261600000000000606162016265640000000000006361620101626160000001 -0000000000000000010000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000010000000000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0000000000000000000100000000000000000000000000000000000000000000000000000000 -0000621B6301000000000000621B63631B620000000000621B63631B6200000000621B63631B -6200000000000000000000000000000000000000000000000000621B63010000000000000062 -1B63631B6200000000621B63631B6200000000621B63631B6200000000621B63631B62000000 -00621B63631B620000000000621B63631B620000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000162630000000000636501000001000000 -0000000000010000000100000063601B62640000000100000000000000000000000000000000 -0001000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010000000000000000010000000000000000000000000000000000 -000000000000000000000000000000000001000000000000000000001B610000000000000000 -606264636364650000000001000000000000000000621B63631B620000000000606261606300 -631B621B00000000656463006360651B00000000646264630063646501000001000000000000 -0000010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000010000000000010000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000100000000000000000000 -0000000100000000000000000000000000000000000000000000000000000000000000000001 -00000000001B610000000061640000001B6100000000616400001B6100000000616400000000 -0000000000000000000000000000000000000000000000010000000000001B61000000006164 -00001B6100000000616400001B6100000000616400001B6100000000616400001B6100000000 -61640000001B6100000000616400000100000000000000000000000000000000000000000000 -000000000000000000000000000000011B610000000000616401000001000000000000000001 -0000000100000000000060626300000100000000000000000000000000000000000100000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000010000000000000000010000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000062600000000000000000656400000000 -64640000000100000000000000001B6100000000616400000064626000000000000000656100 -000000000000000063010000006362630000000000001B000001000000000000000001000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000001000000000001001B620162640000000001006162010000606501 -626400000000006065016264000000000000000000010000000000636101621B000000010061 -6201656300000000000000000000000000000000636162016264000000000001000000000065 -6000000000606500000065600000000060650000656000000000606500000000000000000000 -00000001001B6201626400000000000000010000000000006560000000006065000065600000 -0000606500006560000000006065000065600000000060650000656000000000606500000065 -60000000006065000001000000000000006362000000000000006260001B6201016560000000 -0000000000000000000163626300000063620001000001000000000000000001000000010000 -00000000001B6100000100000000001B62010165600000000000000100000000010061620165 -630000000060650162640000000001001B6201626400000000636162016264000001001B6201 -626400000001006162621B00006162016100000000636101621B000000000100616201000001 -0000000060626400010000000000000000000060650101656000000001001B62016264000000 -0000000000010000000000000000006065000000000000000000016300000000636500000001 -0000000000000000656000000000606500006362600060650101656001006260000000000000 -0000636200000061640000000000000000000001000000000000000001000001010101010101 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000001000000000001611B630060626400000001616400000063626400606260000000 -63626400606260000000000000000000000000000062640063611B0000016164636364626300 -0000000000000000000000000063621B63006061000000000001000000000062630000000063 -620000006263000000006362000062630000000063620000000000000000000000000001611B -6300606264000000000000010000000000006263000000006362000062630000000063620000 -6263000000006362000062630000000063620000626300000000636200000062630000000063 -62000000000000000000000061640000000000646500611B6300636065000000000000000000 -0000000100611B0000001B1B0001000001000000000000000001000000010000000000000063 -6200000000000000611B63006360650000000000000000000000016164636364626300006362 -640060626000000001611B6300606264000063621B63006061000001611B6300606264000001 -61646363651B61646363656400000062640063611B0000000161640000000001000000606260 -0000000000000000000000006062646363646260000001611B63006062640000000000000001 -0000000000000000006564000000000000000000016300000000636200000001620162616300 -0000626300000000636200001B610060626463636401010064610000000000000060651B0000 -0062630000000000000000000001000000000000000001000000000000001B62000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -0000000000011B000000006065000000011B00000000611B0000006065000000611B00000060 -6500000000000000000000000000000000000063620000011B000000001B6100000000000000 -00000000000000611B0000000000000000000001000000000001000000000000010000000100 -0000000000010000010000000000000100000000000000000000000000011B00000000606500 -0000000000010000000000000100000000000001000001000000000000010000010000000000 -0001000001000000000000010000010000000000000100000001000000000000010000000000 -0000000000006062000000000062600001000000000000000000000000000000000000010063 -6200000062630001000001010101010101010101000000010000000000000000010000000000 -0000010000000000000000000000000000000000011B000000001B610000611B000000606500 -0000011B0000000060650000611B00000000000000011B000000006065000001640000006001 -640000006065000000000000006362000000011B000000000001000064656300000000000000 -00000000000061640000000064610000011B0000000060650000000000000001000000000000 -00006362000000000000000000006564000000006401000000656000631B6260000001000000 -0000000100006260006564000000006401006362000000000101010165000000000100000000 -0000000000000001010101010101010101000000000000646263000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000001000000000001 -6300000000636200000001630000000062630000006362000000626300000063620000000000 -0000000000000000001B62010101010000016300000000636200000000000000000000000000 -0062630000000000000000000001000000000001000000000000010000000100000000000001 -0000010000000000000100000000000000000000000000016300000000636200000000000001 -0000000000000100000000000001000001000000000000010000010000000000000100000100 -0000000000010000010000000000000100000001000000000000010000000000000000000000 -0065640000001B65000065616300000000000000000000000000000000010000656400646100 -0001000001000000000000000001000000010000000000000000010000000000000065616300 -0000000000000000000000000000016300000000636200006263000000636200000001630000 -0000636200006263000000000000000163000000006362000001630000000001630000000001 -0000001B62010101010000000163000000000001001B61000000000000000000000000000000 -62630000000063620000016300000000636200000000000000010000000000000000611B0000 -0000000000000000606264636364620100000000000000006465000001000000000000010000 -01000001630000000063010000010000000000006364621B0000000100000000000101010100 -0001000000000000000001000000000060626300000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001000000000001000000000000 -0100000001000000000001010101010101000000010101010101010000000000000000000000 -0000616560000000010000010000000000000100000000000000000101010100000100000000 -0000000000000001000000000062630000000063620000006263000000006362000062630000 -0000636200000000000000010101010000010000000000000100000000000001000000000000 -6263000000006362000062630000000063620000626300000000636200006263000000006362 -0000626300000000636200000062630000000063620000000000000000000000006062000000 -6264000063610162616000000000000000000000000000010000606200626000000100000100 -0000000000000001000000010000000000000063620000000000000063610162616000000000 -0000000000000000010000000000000100000101010101010100000001000000000000010000 -0100000000000000000100000000000001000001000000000001000000000001000061656000 -0000010000000100000000000001006263000000000000000000000000000000010000000000 -0001000001000000000000010000000000000001000000000000006362630000000001010101 -0000006065010165646200000000000000006301000062630000000063620000010000016300 -0000006301006362000000000000000060620000006263000000000000000100000100000000 -0000000001000000006062600000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000001000000000001000000000000010000000100 -0000000062630000000000000000626300000000000000000000000000000000000062630000 -0063010000016300000000636200000000000000000000000000006263000000000000000000 -0001000000000065600000000060650000006560000000006065000065600000000060650000 -0000000000000000000000010000000000000100000000000001000000000000656000000000 -6065000065600000000060650000656000000000606500006560000000006065000065600000 -00006065000000656000000000606500000000000000000000000000651B001B620000000000 -006364656100000000000000000000000001000000621B620000000100000100000000000000 -000100000001000000000000001B610000000000000000000063646561000000000000000000 -0000016300000000636200006263000000000000000001000000000000010000626300000000 -0000000100000000000001000001000000000001000000000001000062630000006301000000 -0100000000000001006462630000000000000000000000000000626300000000636200000100 -0000000000010000000000000001000000000000001B61000000000000000000000000000000 -0000606100000000000000006301000065600000000060650000626000656400000000640100 -646100000000000000000001000000611B000000000000000100000100000000000000000100 -0000636260000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000001000000000000010000000100000000006164 -0000000000000000616400000000000000000000000000000000000062630000001B01000001 -1B000000001B610000000000000000000000000000611B000000000000000000000100000000 -001B610000000061640000001B6100000000616400001B610000000061640000000000000000 -00000000000100000000000001000000000000010000000000001B6100000000616400001B61 -00000000616400001B6100000000616400001B6100000000616400001B610000000061640000 -001B610000000061640000000000000000000000000064016301640000000000000000630100 -0000000000000000000000010000006401640000000100000100000000000000000100000001 -00000000000063626300000000000000000000000063010000000000000000000000011B0000 -00001B6100006164000000000000000001000000000000010000611B00000000000000010000 -0000000001000001000000000001000000000001000062630000001B01000000010000000000 -0001000060626000000000000000000000000000616400000000646100000100000000000001 -0000000000000001000000000000006263000000000000000000000000000000000065600000 -000000000000646500001B6100000000616400001B6100606264636364620160626300000000 -0000000060620000006362630000000000000100000100000000000000000100006362640000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000001000000000000010000000100000000006362646300606500 -00006362646300606500000000000000000000000000616163631B6101000001616463636462 -63000000000000000000000000000063621B63006061000000000001000000000000621B6363 -1B620000000000621B63631B6200000000621B63631B62000000000000000000000000000001 -000000000000010000000000000100000000000000621B63631B6200000000621B63631B6200 -000000621B63631B6200000000621B63631B6200000000621B63631B620000000000621B6363 -1B620000000000000000000000000000006262620000000065646300631B6500000100000000 -000000000001000000000000000000010000010000000000000000010000000100000063601B -6264000000000000000065646300631B65000000000000000000000001616463636462630000 -636264630060650000000100000000000001000063621B630060610000010000000000000100 -00010000000000010000000000010000616163631B6101000000010000000000000100000060 -6264000000000000000000000000606264636364626000000100000000000001000000000000 -000100000000000064650000000000000000000000000065600063616100000065646300631B -6260000000621B63631B62000000636260006065010165600165630000006560630063646260 -0000000064621B630000631B010000010000000000000000010000621B000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000001000000000000010000000100000000000060650101656000000000606501 -0165600000000000000000000000000063616201610001000001006162016563000000000000 -0000000000000000000063616201656400000101010101010100000063610101616300000000 -0063610101616300000000636101016163000000000000000000000000000001000000000000 -0100000001010101010101000000006361010161630000000063610101616300000000636101 -0161630000000063610101616300000000636101016163000000000063610101616300000000 -00000000000000000000006401640000000060616201621B0000000100000000000000000001 -000000000000000000010000010000000000000000010000000101010162651B630000000000 -0000000060616201621B00000000000000000000000001006162016563000000006065010165 -6000000001000000000000010000006361620165640000010000000000000100000100000000 -000100000000000100006361620161000100000001000000000000010000000063621B000000 -0000000000000000006465010165600000000100000000000001000000000000000100000000 -0000656000000000000000000000000000646201626400000000606162016261630000000063 -6101016163000000006462600000000000000000000000006061620162616000000000000060 -6162010162616300000100000000000000000100000101010101010100000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000060626160630063606165000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -1B65620101651B63000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000606101010000000000000000000000 -0000000000000000000000000000000000006361010161630000000000646201626400000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000621B63010000000000000000000000000000000000 -000000000000000000000000621B63631B620000000061616300606500000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000000000000000000000000000000000000000000000 -00000000001B6100000000616400006065000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000010000000000006065016264000000000000000000010000000000000065 -6000000000606500006160000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000636264006062600000000000000000010000000000000062630000000063 -6200006264650101656000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -0000611B00000060650000000000000000010000000000000001000000000000010000016264 -6363646260000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000062630000 -0063620000000000000000010000000000000001000000000000010000016400000000646500 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000001010101010101000000 -0001010101010101010100000062630000000063620000626300000000630100000000000000 -0000000000000000000101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010100 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000062630000000000000000000000000001 -0000000000000065600000000060650000656300000000630100000000000000000000000000 -0000000100000000000000000000000000000000000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0000000000000000000000000000010000000000000000000100000000000000000000000000 -0000000000000000000000000000000100000000000000000000000000000000000000000000 -0000000000000000000000000000000100000000000000000000000000000000000000010000 -0000000000000100000000000000000000000000000000000000000000000000000000010000 -0000000000000000000000000000000000000000000000000000000000000000000000000100 -0000000000000000000000000000000000010000000000000000000100000000000000000000 -0000000000000000000000000000000000000100000000000000000000000000000000000000 -0000000000000000000000000000000000000100000000000000000000000000000000000000 -0100000000000000000100000000000000000000000000000000000000000000000000000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000000000000000000000000000000000100000000000000000100000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000061640000000000000000000000000001000000000000 -001B610000000061640000646400000000646500000000000000000000000000000000010000 -0000000000000000000000000000000000000000000000000000010000000000000000000000 -0000000000000000000000000000000000000000000000000000000100000000000000000000 -0000000000000000010000000000000000000100000000000000000000000000000000000000 -0000000000000000000100000000000000000000000000000000000000000000000000000000 -0000000000000000000100000000000000000000000000000000000000010000000000000000 -0100000000000000000000000000000000000000000000000000000000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000100000000000000 -0000000000000000000000010000000000000000000100000000000000000000000000000000 -0000000000000000000000000100000000000000000000000000000000000000000000000000 -0000000000000000000000000100000000000000000000000000000000000000010000000000 -0000000100000000000000000000000000000000000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0000000000000000000000000000000100000000000000000100000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000010000000000636264630060650000000000000000010000000000000000621B6363 -1B62000000006564636364626000000000000000000000000000000000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000100000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000100000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000100000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000101010101 -0101000000606501016560000000000000000001000000000000000063610101616300000000 -6361620165600000000000000000000000000000000000010000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000010000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000100000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000010000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010101000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000016263000000000000010000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000010000000001000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000101 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000010000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -6465000000000000010000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000010000000001000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000001006564000000 -0000010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010000000001000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000010000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000001000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001006362630000000001000060 -6501016560000000000000000000606501626400000000010061620165630000000000606501 -0165600000010000000001000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000010000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000100001B610000000001006062646363646260 -0000000000000063626400606260000000016164636364626300000060626463636462600001 -0000000001000000000000000000000000000000000000000000000000000000000000000000 -0000000000000300000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000001000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000656000000001006164000000006461000000000000 -00611B0000006065000000011B000000001B6100000061640000000064610001000000000100 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0300000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000010000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000636200000001006263000000006362000000000000006263000000 -6362000000016300000000636200000062630000000063620001000000000100000000000000 -0000000000000000000000000000000000000000000000000000000000000000030000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000001B1B000001000100000000000001000000000000000101010101010100000001 -0000000000000100000001000000000000010001000000000100000000000000000000000000 -0000000000000000000000000000000000000000000000030303030303030000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0065630001006263000000006362000000000000006263000000000000000001630000000063 -6200000062630000000063620001000000000100000000000000000000000000000000000000 -0000000000000000000000000000000000000000030000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000100000000006065000100 -61640000000064610000000000000061640000000000000000011B000000001B610000006164 -0000000064610001000000000100000000000000000000000000000000000000000000000000 -0000000000000000000000000000030000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000100000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000010000000000001B640100606264636364 -6260000000000000006362646300606500000001616463636462630000006062646363646260 -0001000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000000030000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000100000000000000650100006465010165600000000000 -0000000060650101656000000001006162016563000000000064650101656000000100000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000101010000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010101000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000100 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000100000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000100000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000100000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000004000000000004000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000100000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000010000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000040000000400000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000100000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000010000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000400040000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0004000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000006200000000006301630000 -0000006201000000000000000000000100000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000100000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000010000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000040004000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000006164000000006401640000000064650100 -0000010000000000000100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000004000000040000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000606100000000611B610000000061640000000001000000 -0000000100000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000100000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000010000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000001000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000400000400000400000400000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000006200000000626362000000636200010000010101010100000001001B -6201626400000000000000000060650162640000000001006162016563000000006065010165 -6000000001000000000100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000010000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000004000000040004000000000004000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -000000001B64000063650065630000646100010000000100000000000001611B630060626400 -0000000000006362640060626000000001616463636462630000606264636364626000000100 -0000000100000000000000000000000000000000000000000000000000000000000000000000 -0000000400000000000400000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000001000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000040004000000040000000400000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000006065 -00006461001B6400006560000100000001000000000000011B00000000606500000000000000 -611B0000006065000000011B000000001B610000616400000000646100000100000000010000 -0000000000000000000000000000000000000000000000000000000000000000000000000400 -0000040000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000010000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0400000000000400040000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000062630061640060 -6100636200000100000001000000000000016300000000636200000000000000626300000063 -6200000001630000000063620000626300000000636200000100000000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000004000400000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000004000400000000 -0004000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000001B1B006263006362001B1B0000 -0100000001000000000000010000000000000100000000000000010101010101010000000100 -0000000000010000010000000000000100000100000000010000000000000000000000000000 -0000000000000000000000000000000000000000000000000000040000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000400000004000000040004000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000063656362000000626362630000010000000100 -0000000000010000000000000100000000000000626300000000000000000163000000006362 -0000626300000000636200000100000000010000000000000000000000000000000000000000 -0000000000000000000000000000000000000004000400000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000040000000000040004000000040000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000651B61000000611B65000000010000000100000000000001 -000000000000010000000000000061640000000000000000011B000000001B61000061640000 -0000646100000100000000010000000000000000000000000000000000000000000000000000 -0000000000000000000000000400000004000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000100000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000400000000000400000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000064016400000064011B000000010000006264000000000001000000000000 -0100000000000000636264630060650000000161646363646263000060626463636462600000 -0100000000010000000000000000000000000000000000000000000000000000000000000000 -0000000000040000000000040000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000630163000000630163000000010000006062010100000001000000000000010000000000 -0000006065010165600000000100616201656300000000646501016560000000010000000001 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000100000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000001000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000100 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000100000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000100000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000100000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000040000000000040000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000100000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000010101000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000400000004000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001010100000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000010000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000040000 -0000000400000000000000000004000400000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000400000004000000 -0000000000000000040000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000010000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000004000400000000000000000000 -0004000400000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000040000000000000000000000040000000400 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000010000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000001000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000004000400000000000000000004000000000004000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000010000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000400000004000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000001000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000004 -0000000000040000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000010000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000040000000000040000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000400000004000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000606101 -0100000000000063610101616300000000636101016163000000006361010161630000000000 -6361010161630000000063610101616300000000000000000000000000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000004000400000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000621B63010000000000 -00621B63631B6200000000621B63631B6200000000621B63631B620000000000621B63631B62 -00000000621B63631B6200000000000000000000000000000000000100000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000040000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000100000000001B6100000000 -616400001B6100000000616400001B610000000061640000001B6100000000616400001B6100 -0000006164000000000000000000000000000000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000400 -0400000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000010000000000656000000000606500006560 -0000000060650000656000000000606500000065600000000060650000656000000000606500 -0000000000000000000000000000000100000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000040000000400000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000001000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000000000626300000000636200006263000000006362 -0000626300000000636200000062630000000063620000626300000000636200000000000000 -0000000000000000000100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000004000000000004000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000100 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000010000000000010000000000000100000100000000000001000001000000 -0000000100000001000000000000010000010000000000000100000000000000000000000000 -0000000100000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000400000000000400000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000100000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000010000000000000100000100000000000001000001000000000000010000 -0001000000000000010000010000000000000100000000000000000000000000000000010000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000004000000040000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000100000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -0000626300000000636200006263000000006362000062630000000063620000006263000000 -0063620000626300000000636200000000000000000000000000000000010101010100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000040004000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010101010100000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000065600000 -0000606500006560000000006065000065600000000060650000006560000000006065000065 -6000000000606500000000000000000000000000000000010000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000004000000000004 -0000000000000000000000000000000000000000000000000000000000000000000004040000 -0000040000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000100000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000100000000001B610000000061640000 -1B6100000000616400001B610000000061640000001B6100000000616400001B610000000061 -6400000000000000000000000000000000010000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000040000000400000000000000 -0000000000000000000000000000000000000000000000000000000004040400000400000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000000621B63631B6200000000621B63631B -6200000000621B63631B620000000000621B63631B6200000000621B63631B62000000000000 -0000000000000000000000010000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000400040000000000000000000000000000 -0000000000000000000000000000000000000400000400000404040000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001010101010101000000636101016163000000006361010161630000000063 -6101016163000000000063610101616300000000636101016163000000000000000000000000 -0000000000010000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000004000000000000000000000000000000000000000000 -0000000000000000000000000004040000040004040000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000400040000000000000000000000000000000000000000000004000000 -0000040000000000040004000400040000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000010000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000001010100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000040000000400000000000000000000000000000000000000000000040000000400000000 -0000000400040000000400000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000101010000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000621B6300000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000004000000000404000000 -0004000000000000000000000000000000000000000000000400040000000000000004000400 -0000000004000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000063610161600000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000001000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000040000000400000000000000000000 -0000000000000000000000000000000000000004000000000000000400000004000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000010000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000631B626564000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000400040000000000000000000000000000000000 -0000000000000000000000000400040000000000040000000000040000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000006465621B63000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000004000000000000000000000000000000000000000000000000 -0000000000040000000400000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000001B0101610000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000400040000000000000000000000000000000000000000000000000000000400 -0000000004000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000063 -1B626560001B6100000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000004 -0000000400000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000636162616300000063 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000100000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000400000000000400 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000006065621B63000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000004000000000004000004000000 -0000040000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000006564000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000100000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000040000000400000000040000000400000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000001000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000400040000000000000400040000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000100 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000006461000000000061640000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000100000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000004000000000000000004000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000100000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000626000 -0000000060650000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010101 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000400040000000000000400040000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001010100000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000010000000000000001 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000004000000 -0400000000040000000400000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000100000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000626300000000006362000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000010000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000400000000000400000400 -0000000004000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000100000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000611B00000000001B61000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000010000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -000000000000000000000063621B6300631B6263000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000006361620162616300000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000010000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000400 -0000000004000000000000000000000000000000000004000000000004000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000010000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000001000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000004000000040000 -0000000000000000000000000000000000040000000400040000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000010000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000646562010101010100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000040004000000000000000000 -0000000000000000000000000400040004000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000064626063000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000001000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000400000000000400000000000000000000 -0000000000000004000400000004000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000010000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000062600000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000040004000000040000000000000000000000000004000000 -0400040000000400000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000004000000040004000000000000000000000000000000040004000400040004 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0062630000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0400000000000400000000000000000000000000000000000400040000000400000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000001B1B000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000004 -0004000000000000000004000000000004000004000000040004000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000611B6300000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000100000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000400000004000000 -0000000000040000000400000400040004000000040000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000101010101010101010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000040000000000040000000000000000 -0400040000040000000400000000000400000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000100000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000400000400 -0000000004000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000001000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000040004000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000100 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000100000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000004000000040000000000000400000000000400 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000100000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000006065 -6201000065600000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000400000000000400000000000004000000040000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000100000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000646260630100006065 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000040000000000040000040004000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000100000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000626000000100000001000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000010000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000400000004000000000400000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000100000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000010000000100006301000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000010000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0004000400000000040004000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000656400000100006465000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000004000000 -0004000000040004000000000004000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -000000000060621B630163646263000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000010000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000400000000000400040000040000000000 -0400040000000400000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -6361620162616300000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -0101000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000400000000 -0004000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000004000000040000000400000000000000040000040004 -0400000400000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000101010000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000001000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000004000000040000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000040004000000000004000000000000000400000404000004000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000010000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000040004000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000040400000000040000000000000000000004040404000400000400000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000001000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000400000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000004 -0404000004000000000000000000000004040004040000040000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000030003030000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000010000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000040004000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000400000404040000 -0000000400000004000404000404040404000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000303030303030303000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000000000100000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000004000000040000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000040000000004040000000000000400 -0000040400000404000404000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000030303 -0303030303030303030000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000000646200000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000040000 -0000000400000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000400040000000000000004000404040004 -0004040004040004000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000003030303030303030303 -0303030300000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000000000000 -0000000000000000000000000000000000000000000000000000000000000001010101010101 -0101626000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000040000000400000000000000040000000400000404000004 -0400000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000303030303030303030303030303030300 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000100000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000100000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000004000000000004000000000004040400040004040000040004040000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000030303030303030303030303030303030303000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000400000404000004040000000400000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000003030303030303030303030303030303030303030000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000001B620101010101010000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000100000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000040004000404040404000400040004000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0303030303030303030303030303030303030303030300000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000001000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000001B61630100631B61000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000060610101000000000000636101016163 -0000000063610101616300000000636101016163000000000063610101616300000000000000 -0000000000000000000100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000040000040400000004000000040000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000030303030303 -0303030000000000030303030303030300000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000100 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000006263000100000064610000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000621B6301000000000000621B63631B6200000000621B -63631B6200000000621B63631B620000000000621B63631B6200000000000000000000000000 -0000000100000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000040404 -0400000400000000000400000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000003030303030303030000000000 -0000000003030303030303000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000100000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010000 -0100000000620000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000100000000001B6100000000616400001B6100000000616400 -001B610000000061640000001B61000000006164000000000000000000000000000000010000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000040400000400000400 -0000040404000000040404000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000303030303030300000000000000000000000303 -0303030303030000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000100000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000616400626000006362 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000065600000000060650000656000000000606500006560000000 -0060650000006560000000006065000000000000000000000000000000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000004040004000004000004000400040404 -0004040404000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000303030303030300000000000000000000000003030303030303 -0300000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000100000000000000000000000000000000000000 -00000000000000000000000000000000000000000000006362001B6563636161000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000062630000000063620000626300000000636200006263000000006362000000 -6263000000006362000000000000000000000000000000010000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000004000000040000000004040004000404040404040000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000030303030303030000000000000000000000000000030303030303030300000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000100000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000006162626163000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0001000000000000010000010000000000000100000100000000000001000000010000000000 -0001000000000000000000000000000000010000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000400000000000400000000040400040404040404000004000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000303 -0303030303000000000000000000000000000000000303030303030300000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000100000000000100000000 -0000010000010000000000000100000100000000000001000000010000000000000100000000 -0000000000000000000000010000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000040404040404040404000400000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000303030303030300 -0000000000000000000000000000000303030303030303000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000100000000006263000000006362000062 -6300000000636200006263000000006362000000626300000000636200000000000000000000 -0000000000010101010100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000004000004040404040404040000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000030303030303030000000000000000 -0000000000000000000003030303030303030000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001010101010000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000100000000006560000000006065000065600000000060 -6500006560000000006065000000656000000000606500000000000000000000000000000001 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0400000404040404040004040400040000000000000000000000000000000000000000000000 -0000000000000000000000000000000003030303030303000000000000000000000000000000 -0000000000030303030303030000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000010000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000100000000001B6100000000616400001B6100000000616400001B6100 -00000061640000001B6100000000616400000000000000000000000000000001000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000004040000 -0404000400040404000000000000000000000000000000000000000000000000000000000000 -0000000000000000000003030303030303000000000000000000000000000000000000000003 -0303030303030300000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000010000000000000000000000000000000000 -0000000000000000000000000000000000000000000001010101010101010101010100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -00000001000000000000621B63631B6200000000621B63631B6200000000621B63631B620000 -000000621B63631B620000000000000000000000000000000001000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000404000000000404000400 -0400000000000000000000000000000000000000000000000000000000000000000000000000 -0000000303030303030300000000000000000000000000000000000000000000030303030303 -0300000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010101010101 -0100000063610101616300000000636101016163000000006361010161630000000000636101 -0161630000000000000000000000000000000001000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000400040004000400040000 -0004000000000000000000000000000000000000000000000000000000000000000003030303 -0303030300000000000000000000000000000000000000000000030303030303030300000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000010000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000400040004000400040004000000 -0000000000000000000000000000000000000000000000000000000000000303030300000000 -0000000000000000000000000000000000000000000303030303030300000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001010100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000040004040404040004040404000000000000000000 -0000000000000000000000000000000000000000000003030303030303000000000000000000 -0000000000000000000000000000000303030303030303000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010101000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000004000000040404040404040400000000000000000000000000000000 -0000000000000000000000000000000303030303030303000000000000000000000000000000 -0000000000000000000003030303030303000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000004000404040404040000040000000000000000000000000000000000000000 -0000000000000000000303030303030300000000000000000000000000000000000000000000 -0000000003030303030303030000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000100000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0400040004040404040004000000000000000000000000000000000000000000000000000000 -0000030303030303030000000000000000000000000000000000000000000000000000000003 -0303030303030000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000004000400040404 -0404040400000000000000000000000000000000000000000000000000000000000003030303 -0303030000000000000000000000000000000000000000000000000000000000030303030303 -0300000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000064656201010101010000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000100000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000040004040404040404040400 -0400000000000000000000000000000000000000000000000000000303030303030303000000 -0000000000000000000000000000000000000000000000000000030303030303030000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000001000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000006462606300000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000404000400000404040404000000040000 -0000000000000000000000000000000000000000000303030303030300000000000000000000 -0000000000000000000000000000000000000000000303030303030300000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000100 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000006260000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000100000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000040004000400040004000400000000000000 -0000000000000000000000000000000303030303030300000000000000000000000000000000 -0000000000000000000000000000000303030303030300000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000100000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000004000404040404000404040400000000000000000000000000 -0000000000000000000003030303000000000000000000000000000000000000000000000000 -0000000000000000000303030303030303000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000100000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000626300000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000004040404040404040000000000000000000000000000000000000000 -0000030303030303030000000000000000000000000000000000000000000000000000000000 -0000000003030303030303030000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000100000000000000000000000000000000000000 -00000000000000000000000000000000000000000000001B1B00000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000010000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000400040404040404000004000000000000000000000000000000000000000003030303 -0303030000000000000000000000000000000000000000000000000000000000000000000303 -0303030303030000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000100000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000611B630000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000010000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000004000400 -0404040404000400000000000000000000000000000000000000000303030303030300000000 -0000000000000000000000000000000000000000000000000000000000000003030303030303 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010101010101010101000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010101000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000040004040404040404 -0000040000000000000000000000000000000000000303030303030300000000000000000000 -0000000000000000000000000000000000000000000000000003030303030303030000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000101 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000010000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000004000404040404040404040404000004 -0000000000000000000000000000030303030303030000000000000000000000000000000000 -0000000000000000000000000000000000000000030303030303030000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000040400040000040404040400040404040000000000 -0000000000000000030303030303030000000000000000000000000000000000000000000000 -0000000000000000000000000000030303030303030000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000010000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000001000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000004040404040404040404000000000000000000000000 -0003030303030303000000000000000000000000000000000000000000000000000000000000 -0000000000000000030303030303030300000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000010000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000606562010000656000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000400000404040404040400000000000000000000000000000000030303 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000303030303030300000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000064626063010000606500000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000001000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000040404040404040000040000000000000000000000030303030303030000000000 -0000000000000000000000000000000000000000000000000000000000000000000000030303 -0303030300000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000010000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000062600000010000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000404 -0004040404040404000400000000000000000000000003030300000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000303030303030300 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000010000630100000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000400040404040404 -0404040000000000000000000000030303030303030000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000303030303030300000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0065640000010000646500000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000004040404040404040404040004 -0000000000000003030303030303000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000003030303030303000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000060621B6301 -6364626300000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000004000000000404040004000404040000000000 -0003030303030303000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000003030303030303000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000063616201626163000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000100000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000040004040400040404000000000000030303030303 -0300000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000003030303030303000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000004000400040404040400000400000000000003030300000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0003030303030303030000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000006000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000100000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000040004000404040000040400000000030303030303030000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000003030303 -0303030000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000001000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000006265600000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0400040404040404040004000000000303030000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000003030303030303030000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000100 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000064626564000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000100000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000004000404040004 -0404000400040403030303030303000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000030303030303030000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000100000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -1B62626400000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000040404000004040404000404 -0404030303030303000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000030303030303030000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000100000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000001B016264 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000404040404040404040403030300 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000030303030303030300000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000100000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000636201000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000010000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000040400040404040404040403030303030000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000303030303030300000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000100000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000001B016264000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000010000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000040004000404040404040304030303000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0303030303030300000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000646265640000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000400040404040404030403040403030000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000030303030303 -0303000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000006462656000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000010000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0004040404040404040304040404000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000030303030303030300000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000062 -6160000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000404040404 -0004040404040404000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000303030303030300000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000010000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000063000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000001000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000040400040304040404 -0400000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000303030303030303000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000010000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000040004030404040404030004000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000003030303030303000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000000000000000000000000000000000000000000000 -0000000000000000000000000000000001010001010101010101010100000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000001010100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000400040404040404000404000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000003030303030303000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000101010000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000004040404040404040400040400000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000303 -0303030303030000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000003040404030404040404040400000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000303030303030303 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0303030403030404040404040004000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000003030303030303000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000101010101 -0101010162640000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000003030304 -0400040404000400000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000303030000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000611B6300631B61636062 -6400000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000100000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000003030303030404030404040404 -0000040000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000003030303030303030000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000006164000000000064610064650000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000003030400040404040404000404040400 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000030303030303030000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000006263000000000063620063010000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000100000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000003030303030304040400040404040404040400000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000030303030303030000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000001000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000163000000000063010000010000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000003030303030303040004000404040404040000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000003030303 -0303030000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000100 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000006564000000000064650060650000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000100000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000303000000000400000404040404000004000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000003030303030303030000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000100000000000000 -000000000000000000000000000000000000000000000000000000000000000000000060621B -6300631B62630065640000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000030303030303 -0300000000040404040404000404000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000030303030303030000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000100000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000006361620162616300 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000606101010000000000006361010161630000000063610101 -6163000000006361010161630000000000000000000000000000000000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000030303030303030000000404 -0404040404040400040000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000030303030303030000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000100000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000621B6301000000000000621B63631B6200000000621B63631B6200000000 -621B63631B620000000000000000000000000000000000010000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000303030000000000000404040404040404 -0404040400000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000303030303030300000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000100000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000100000000001B6100000000616400001B6100000000616400001B610000000061 -6400000000000000000000000000000000010000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000003030303030303000000000004040000040404040404000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000303030303030300000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -0000000000656000000000606500006560000000006065000065600000000060650000000000 -0000000000000000000000010000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000303030303030300000000000000000004040404040400040004000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0303030303030300000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000001000000000062 -6300000000636200006263000000006362000062630000000063620000000000000000000000 -0000000000010000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000030303000000000000000000000404000404040404000404000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000030303030303 -0303000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001000000000001000000000000 -0100000100000000000001000001000000000000010000000000000000000000000000000001 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000030303030303 -0300000000000000040400040404040400040404040000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000303030303030300000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000010000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000001000000000001000000000000010000010000 -0000000001000001000000000000010000000000000000000000000000000001000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000003030303030303000000000000 -0000000004040400040404040404040000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000303030303030300000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000010000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000062630000000063620000626300000000636200 -0062630000000063620000000000000000000000000000000001010101010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000303030000000000000000000000000404 -0004000404040404000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000303030303030303000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001010101010000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000062000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000065600000000060650000656000000000606500006560000000 -0060650000000000000000000000000000000001000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000303030303030303000000000000000000000000040004040404 -0400000404000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000003030303030303030000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000010000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000061640000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -000100000000001B6100000000616400001B6100000000616400001B61000000006164000000 -0000000000000000000000000001000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000303030303030300000000000000000000000004000404040404040404040404 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000003030303030303030000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000611B63000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0000621B63631B6200000000621B63631B6200000000621B63631B6200000000000000000000 -0000000000000001000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000030303000000000000000000000000000000040404040404040404040400000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000303 -0303030303030000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001010101010101010100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000101010101010100000063610101 -6163000000006361010161630000000063610101616300000000000000000000000000000000 -0001000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000003030303030303 -0000000000000000000000000000000404040404040404040404000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000003030303030303 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000303030000000000000000 -0000000000000000000004000004040404040404040400000000000000000000000000000000 -0000000000000000000000000000000000000000000000000003030303030303030000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000101010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000030303000000000000000000000000000000 -0000000000000404040404040404040400000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000030303030303030000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010101000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000060616201626160000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000303030303030303000000000000000000000000000000000004 -0404040404040404040400000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000030303030303030300000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000006062646300636462600000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000100000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000003030303000000000000000000000000000000000000000000040404040404 -0404040004040000000000000000000000000000000000000000000000000000000000000000 -0000000000000000030303030303030300000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000001000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000006564000000000064650000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000003 -0303030303030000000000000000000000000000000000000000000404040404040400040404 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000030303030303030300000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000100 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000163000000000063010000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000100000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000003030303030303 -0000000000000000000000000000000000000000040404040404040404040400000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000003 -0303000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000100000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000016300 -0000000063010000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000303030303030300000000000000 -0000000000000000000000000000000404040404040404040004040400000000000000000000 -0000000000000000000000000000000000000000000000000000000000030303030303030300 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000100000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000656400000000006465 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000030303000000000000000000000000000000 -0000000000000000000004040400040404040404040000000000000000000000000000000000 -0000000000000000000000000000000000000000000000030303030303030300000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000100000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000646264630063646260000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000010000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000303030303030300000000000000000000000000000000000000 -0000000004040004040404040404040404000000000000000000000000000000000000000000 -0000000000000000000000000000000000030303030303030300000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000100000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000006061620162616000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000010000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000030303030303030000000000000000000000000000000000000000000000000000 -0404040404040404040400000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000030303030000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0300030300000000000000000000000000000000000000000000000000000004040400040404 -0404040004000000000000000000000000000000000000000000000000000000000000000000 -0000000000000303030303030303030000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000010000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000030003030000 -0000000000000000000000000000000000000000000000000000040004040404040404040404 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0303030303030303030000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000001 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000003030303000000000000000000 -0000000000000000000000000000000000000000000404040404040404040404000000000000 -0000000000000000000000000000000000000000000000000000000000000000030303030303 -0303030000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000010000000000000000000000 -0000000000000000000000000000000000000000000000000000000062600001000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000001010100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000030303030303030000000000000000000000000000 -0000000000000000000000000000000000040404040404040400040000000000000000000000 -0000000000000000000000000000000000000000000000000000000303030303030303000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000101010000000000000000000000000000000000 -0000000000000000000000000000000000000000000064620101010101010101010100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000030303030303030000000000000000000000000000000000000000 -0000000000000000000004040404040404040404040400000000000000000000000000000000 -0000000000000000000000000000000000000000000003030303030303000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000001000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000001000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000003030303030303030300000000000000000000000000000000000000000000000000 -0000000000000004040404040404040404000000000000000000000000000000000000000000 -0000000000000000000000000000000003030303030303030000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000010000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000003 -0003030300000000000000000000000000000000000000000000000000000000000000000000 -0404040404040404040404040400000000000000000000000000000000000000000000000000 -0000000000000000000003030303030303030000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000003030303030000 -0000000000000000000000000000000000000000000000000000000000000000040404000404 -0404040404040400000000000000000000000000000000000000000000000000000000000000 -0000000000030303030303030000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000303030303030300000000000000 -0000000000000000000000000000000000000000000000000000000400040404040404040404 -0400000000000000000000000000000000000000000000000000000000000000000000000003 -0303030303030300000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000003030303030303000000000000000000000000000000 -0000000000000000000000000000000000000000000004040404040404040404040000000000 -0000000000000000000000000000000000000000000000000000000000000003030303030303 -0300000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000100000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000030303030303030000000000000000000000000000000000000000 -0000000000000000000000000000000404040404040404040404000000000000000000000000 -0000000000000000000000000000000000000000000000000000030303030303030000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000030303030300000000000000000000000000000000000000000000000000000000 -0000000000000000000000040404040404040404040004000000000000000000000000000000 -0000000000000000000000000000000000000000030303030303030300000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000100000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000030303 -0303030300000000000000000000000000000000000000000000000000000000000000000000 -0000000000040404040404040404040400040404000000000000000000000000000000000000 -0000000000000000000000000000030303030303030300000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000001000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000006065000000610165000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000003030303030303030300 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0400040404040404040404040400000000000000000000000000000000000000000000000000 -0000000000000000030303030303030300000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000100 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -000000656000006465631B1B0000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000100000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000303030300000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000404040404 -0404040404040404000000000000000000000000000000000000000000000000000000000000 -0000000303030303030303000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000100000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000016300 -0061640063620000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000303030300000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000004000404040404040404 -0404040000000000000000000000000000000000000000000000000000000000000000030303 -0303030303000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000100000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000010000006263000001 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000303030303030300000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000040404040404040404040404000000 -0000000000000000000000000000000000000000000000000000000000030303030303030303 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000100000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000626300630100006362000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000010000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000003030303030303000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000004000404040404040404040404040000000000000000 -0000000000000000000000000000000000000000000000000303030303030303000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000100000000000000000000000000000000000000000000000000 -00000000000000000000000000000000001B1B00616100006461000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000010000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000030303 -0303000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000040404040404040404040404040004000000000000000000000000 -0000000000000000000000000000000000000303030303030303030000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000006101656300006560000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000003030303030303000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000040404040404040404040404000404000000000000000000000000000000000000 -0000000000000000000000000003030303030303000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000010000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000303030303030303000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000004 -0404040404040404040404040400000000000000000000000000000000000000000000000000 -0000000000000303030303030303030000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000030303030303030000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000404040404 -0404040404040004000000000000000000000000000000000000000000000000000000000000 -0303030303030303030300000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000010000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000001000000000000 -0001000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000001000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000303030303000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000040000040404040404040404 -0404040000000000000000000000000000000000000000000000000000000000000303030303 -0303030303000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000010000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001000000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0303030303030303000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000040404040404040404040404000000 -0000000000000000000000000000000000000000000000000000000003030303030303030300 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000001000000000000646200000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000001000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000030000000003030303 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000004040404040404040400040000000000000000 -0000000000000000000000000000000000000000000003030303030303030000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000010000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010101010101010101626000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000030003000003030300000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000404040404040404040404040000000000000000000000000000 -0000000000000000000000000000000000030303030303030303000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000030303030303030303000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000404040004040404040404000400000000000000000000000000000000000000 -0000000000000000000003030303030303030303000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0060650000006101650000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001010100000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000030303030303030303000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0004000404040404040400040400000000000000000000000000000000000000000000000000 -0000000303030303030303030303030000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000010101000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000006560000064 -65631B1B00000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000003030303030303000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000004040404 -0404040404040400040000000000000000000000000000000000000000000000000000000000 -0303030303030303030300000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000163000061640063620000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000100000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000003030303 -0303030303030303000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000004000404040404040404 -0004000000000000000000000000000000000000000000000000000000000000030303030303 -0303030300000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000100000062630000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000030303030303030300 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000004040404040404040404040000 -0000000000000000000000000000000000000000000000000000030303030303030303030303 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000006263006301000063620000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000100000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000300 -0000000000000000000000000000000000000000000303030303030303030300000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000404000404040404040404040400000000000000 -0000000000000000000000000000000000000000000303030303030303030303030000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000001000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000001B1B006161000064610000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000300000000000000 -0000000000000000000000000000030003030303030303030303000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000400040404040404040404040400000000000000000000000000 -0000000000000000000000000000000003030303030303030303030300000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000100 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000061016563000065600000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000100000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000300000000000000000300000000 -0000000000000000030303030303030003000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000004040404040404040404040000040000000000000000000000000000000000 -0000000000000000000303030303030303030303030303000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000100000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000303030303030300000000000303000300000300000300 -0003030303030303000003000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0404040004040404040404040004000000000000000000000000000000000000000000000000 -0000000000030303030303030303030303030000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000100000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000003000000000300000300000300030303000300000300000303030303030303 -0000000003000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000040404 -0404040404000404000000000000000000000000000000000000000000000000000000000303 -0303030303030303030303030300000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000100000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000010000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0003000000000300000300000303030303030300000300000303030303030303030000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000004040404040404040404 -0404000000000000000000000000000000000000000000000000000000000003030303030303 -0303030303030303000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000100000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000006065620100006560000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000010000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000300030000 -0303030303030303030303030303030303030303030303030300000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000040404040404040404040400000000 -0000000000000000000000000000000000000000000000000000030303030303030303030303 -0303000300000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000646260630100006065000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000006061010100000000000063610101616300000000636101016163000000000000 -0000000000000000000000010000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000030303030303030300000003030303 -0303030303030300030303030303030303030300000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000040404040404040404040404000400000000000000 -0000000000000000000000000000000000000000000303030303030303030303030000030300 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000626000000100000001000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -621B6301000000000000621B63631B6200000000621B63631B62000000000000000000000000 -0000000000010000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000030000000000000000000000000000030003000300030300000003030003030003030300 -0300030303030303030303030000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000400040404040404040404040000000000000000000000000000 -0000000000000000000000000000000003030303030303030303030300030300000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -0000000100006301000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010000 -0000001B6100000000616400001B610000000061640000000000000000000000000000000001 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000003000000 -0003000000000000000000030003030303030303030303030303030003000303030303030303 -0303030300000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000004000404040404040404040004000400000000000000000000000000000000 -0000000000000000000000030303030303030303030303030303030000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000010000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000065640000010000 -6465000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000010000000000656000 -0000006065000065600000000060650000000000000000000000000000000001000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000300000000000003000000000300000000 -0300030303030303030303030300000003030303030303000000000303000300000303030000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000040404040404040404040400040000000000000000000000000000000000000000000000 -0000000000030303030303030303030303030303030300000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000010000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000060621B63016364626300000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000010000000000626300000000636200 -0062630000000063620000000000000000000000000000000001000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000300000003030303030303000300000000030000030003 -0003000303030303030303000003000000000000000303000300000003000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000040404 -0404040404040404040400000000000000000000000000000000000000000000000000000303 -0303030303030303030303030303030300000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000636162016261630000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000010000000000010000000000000100000100000000 -0000010000000000000000000000000000000001000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000300000003000003000303030303030300030000030003000300000003 -0300000003000003000000000303030303030300000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000004040404040404040404 -0404040000000000000000000000000000000000000000000000000000000000030303030303 -0303030303030303030300000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000010000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010000000000010000000000000100000100000000000001000000 -0000000000000000000000000001000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0303030303030303000003000003000300030303030303030303030300000000030000000000 -0003000000000000000300000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000004040404040404040404040400040400 -0000000000000000000000000000000000000000000000000000000303030303030303030303 -0303030300000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000010000000000626300000000636200006263000000006362000000000000000000 -0000000000000001010101010000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000030000 -0003000003000003000300000000030000030000000000000000030000000000000000000000 -0000000300000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000404040404040404040404040004000400000000 -0000000000000000000000000000000000000000000303030303030303030303030303030303 -0300000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000101010101000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001010101010101010100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -0000000000656000000000606500006560000000006065000000000000000000000000000000 -0001000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000030303030303030303 -0303030303000300030000030000000000000000000000000000000000000000000000030000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000404040404040404040404040400040000000000000000000000 -0000000000000000000000000000000003030303030303030303030303030000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -631B610000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000100000000001B -6100000000616400001B61000000006164000000000000000000000000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000030000000300000000000300000000 -0300030000030000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000404040404040404040404040404000004000000000000000000000000000000 -0000000000000000000000000303030303030303030303030300000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000001B1B0000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001000000000000621B63631B62 -00000000621B63631B6200000000000000000000000000000000000100000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000300000000000300000000030000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0404040404040404040404040404000400000000000000000000000000000000000000000000 -0000000000000303030303030303030303030303030000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000063620000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001010101010101000000636101016163000000006361 -0101616300000000000000000000000000000000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000300000000000300030303030303030000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000400040404 -0404040404040404040000000000000000000000000000000000000000000000000000000000 -0003030303030303030303030303030000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000010000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000100000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000030000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000004040404040404040404 -0404040404000000000000000000000000000000000000000000000000000000030303030303 -0303030303030303030000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000001000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000060620000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000101010000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000030000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000004040004040404040404040404040404 -0404000000000000000000000000000000000000000000000000000303030303030303030303 -0303030300000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001010100 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000636062640000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000100000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000003000000000000000000 -0000000000000000030000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000400000404040404040404040404040404040000000000 -0000000000000000000000000000000000000000000303030303030303030303030303000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000100000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010101 -0101016564000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000003000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000404040404040404040404040404000000000000000000000000 -0000000000000000000000000000000303030303030303030303030303030000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000100000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000003000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000404040404040404040404040404040000040000000000000000000000000000 -0000000000000000000003030303030303030303030303000003000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000100000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000010000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000003030303030303000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0004040404040404040404040404040004000000000000000000000000000000000000000000 -0000000000000303030303030303030303030303000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000100000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000010000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000003000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000040000040404 -0404040404040404040400000400000000000000000000000000000000000000000000000303 -0303030303030303030303030303000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010101010101010101010101000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000300 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000004040404040404040404 -0404040400040400000000000000000000000000000000000000000000000000000303030303 -0303030303030303030303000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000611B6300631B6100000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000010000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000300000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000004040404040404040404040404040404 -0404000000000000000000000000000000000000000000000000000303030303030303030303 -0303000003000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000061 -6400000000001B61000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000004000004040404040404040404040404040000000004 -0000000000000000000000000000000000000303030303030303030303030303030303030300 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000010000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000062630000000000 -6362000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000001000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000004040404040404040404040404040400040404000000000000 -0000000000000000000000000000000300000003030303030303030303030300000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000010000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001630000000000630100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000404000404040404040404040404040404040400000000000000000000000000 -0000000000000000000300000003030303030303030303030303030300000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000065640000000000646500000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000001000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000004 -0400040404040404040404040404040404040400000000000000000000000000000000000000 -0000000300000003030303030303030303030300000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000010000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000063621B6300631B626300000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001010100000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000404040404 -0404040404040404040404040404000000000000000000000000000000000000000000000000 -0000000303030303030303030300000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0101010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000636162016261630000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000040404040404040404040404 -0404040404040404000400000000000000000000000000000000000000000000000003030303 -0303030303030300000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000404040404040404040404040404 -0404040000000400000000000000000000000000000000000000000003030303030303030303 -0300000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000404040404040404040404040404040404040404 -0000000000000000000000000000000000000000000303030303030303030303030300000300 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000100000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000040004040404040404040404040404040404040400040000000000 -0000000000000000000000000000000000030303030303030303030303030300000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000060656201000065600000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000404040404040404040404040404040404040004000004000000000000000000 -0000000000000000000000030303030303030303030303030300000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000006462606301000060650000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000100000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000040404040404040404040404040404040400000400000000000000000000000000000000 -0000000003030303030303030303030303030303030300000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000001000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000006260000001000000010000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000040404 -0404040404040404040404040404040000000000000000000000000000000000000000000003 -0303030303030303030303030300000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000100 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000100000001000063010000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000100000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000040404040404040404 -0404040404040404040404000000000000000000000000000000000000000003030303030303 -0303030303030303030300000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000100000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000656400 -0001000064650000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000004040404040404040404040404040404 -0404040400000000000000000000000000000000000000000000030303030303030303030303 -0303030300000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000100000000000000000000000000 -000000000000000000000000000000000000000000000000000000000060621B630163646263 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000040004040404040404040404040404040404040004 -0000000000040000000000000000000000000003030303030303030303030303030303030000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000100000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000006361620162616300000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000010000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000004000004040404040404040404040404040404000400040000000400 -0000000000000000000000000000030303030303030303030303030303030303030000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000100000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000010000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000400040404040404040404040404040404040400000400040400000000000000 -0000000000000000030303030303030303030303030303030000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000004 -0000040404040404040404040404040404040404040004040004000000000000000000000000 -0000030303030303030303030303030303030300000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000620000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000010000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000404040404 -0404040404040404040404040404040404040400000000000000000000000000000003030303 -0303030303030303030303030000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000061 -6400000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000004040004040404040404 -0404040404040404040400040400000000000000000000000000000000000003030303030303 -0303030303030300000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000010000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000611B63000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000001000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000004040404040404040404040404040404 -0404040404000004000000000000000000000000000000030303030303030303030303030303 -0303030000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000010000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001010101010101010100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000400000404040404040404040404040404040404040004 -0000000000000000000000000000000003030303030303030303030303030303030303000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000001000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000040404040404040404040404040404040404040404040400000000 -0000000000000000000000000003030303030303030303030303030303000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000010000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000004040000040400040404040404040404040404040404040400000000000000000000 -0000000000000003030303030303030303030303030303000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000040400 -0000000404040404040404040404040404040404000400000000000000000000000000000000 -0003030303030303030303030303030303030000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000404 -0004040404040404040404040400040000000000000000000000000000000000000003030303 -0303030303030303030303030300000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000040400000404040404 -0404040404040404000404000000000004000000000000000000000303030303030303030303 -0303030303030303000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000100000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000003000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000040404040404040404040404 -0404040400040000000400000000000000000000000303030303030303030303030303030303 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000003000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000004000004040404040404040404040404040000 -0400040000000000000000000000000000000303030303030303030303030300000300000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000030000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000101010000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000300 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000400040404040404040404040404000000000400000000 -0000000000000000000000000303030303030303030303030303000300000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000003000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010101000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000630000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000303030303030300000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000004040404040404040404040404040400040004000000000000000000 -0000000000030303030303030303030303030303030303030000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000003000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000100 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0060000001000000010000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000100000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000300000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000404040404040404040404040404040400040404040000000004000000000303 -0303030303030303030303030303030303030300000000000000000000000000000000000000 -0000000000000000000000000000000000000003030303030303000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000100000000000000 -0000000000000000000000000000000000000000000000000000000000000000000101610163 -0000010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000300000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000004 -0404040404040404040404040404040400040404040000000400000000000000000303030303 -0303030303030300030303030000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000003000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000100000000000000000000000000 -0000000000000000000000000000000000000000000000000000000060610101626501630000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000300000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000404040404040404 -0404040404040404040004000400000400040000000000000000030303030303030303030303 -0303030303030303030000000000000000000000000000000000000000000000000000000000 -0000000000000000000003000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000100000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000163641B01016261000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000010000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000404040404040404040404040404 -0404000400040000000004000000000000000000000303030303030303030303030303030303 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0003030303030303000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000100000000000000000000000000000000000000000000000000 -0000000000000000000000000000006164630100000001636461000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000010000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000004040404040404040404040404040404000400 -0404040400040004000000000000000000030303000303030303030003030303000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000300 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000000006162010161646301000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000004040404040404040404040404040404040004000404000000 -0400000000000000000000030303030303030303030303030303030303000000000000000000 -0000000000000000000000000000000000000000000000000000000000000300000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000630165620101616463000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000010000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000004040404040404040404040404040404040400040404040004000400000000 -0000000000000300000303030303030003030303030300030000000000030000000000000000 -0000000000000000000000000000000000000000000000000300000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0100006301616201000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0004040404040404040404040404040404040004040000000400000000000000000000000000 -0303030303030303030303030303030303030000000000030000000000000000000000000000 -0000000000000000000000000000000303030303030300000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000010000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000100 -0060000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000001000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000040004040404 -0404040404040404040404040404040404040004000400000000000000000000000000030303 -0303030303030303030303030000000300030000000000000000000000000000000000000000 -0000000000000000000000000300000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000010000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000630000000100000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000006061010100000000 -0000636101016163000000000000000000000000000000000001000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000004000404040404040404 -0404040404040400040404000000040000000000000000000000000303030303030303030303 -0303030303030303030303030303030000000000000000000000000000000000000000000000 -0000000000000300000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000621B6301000000000000621B6363 -1B62000000000000000000000000000000000001000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000400040404040404040404040404040404 -0404040404040004000400000000000000000000000000030303030303030303030303030303 -0000000300030000000000000000000000000000000000000000000000000000000000000000 -0300000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000010000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000100000000001B61000000006164000000 -0000000000000000000000000001000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000004040404040404040404040404040404040404040000 -0400000000000000000000000000000303030303030303030303030303030303030303030303 -0300000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000100000000006560000000006065000000000000000000 -0000000000000001000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000404040404040404040404040404040404040404040004000400000000 -0000000000000000000000000303030303030303030303030303000000030003000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000100000000006263000000006362000000000000000000000000000000 -0001000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000040404040404040404040404040404040400000404040400000000000000 -0000000303030303030303030303030303030303030000030000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000100000000000100000000000001000000000000000000000000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0004040404040404040404040404040404040404040004040000000000000000000000000000 -0303030303030303030303030300030000030000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010000 -0000000100000000000001000000000000000000000000000000000100000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000400040404 -0404040404040404040404040004040404000000000000000000000000000000030303030303 -0303030303030303030000030003030000000300000000000000000000000000000300000000 -0000000000000000030000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000010000000000626300 -0000006362000000000000000000000000000000000101010101000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000040004040404040404040404 -0404040004040400040400000000000000000000000000030303030303030303030303030303 -0303030303030003030000000300000000000000000000000000000300000000000000000000 -0000030000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000101010101000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000010000000000656000000000606500 -0000000000000000000000000000000100000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000004040404040400040004000004 -0004040404000000000000000000000000000000030303030303030303030303030303000003 -0003030000000300000000000000000000000000000300000000000000000000000003000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000001000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000100000000001B6100000000616400000000000000 -0000000000000000000100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000404040404040404000000040400040404000404 -0000000000000000000000030303030303030303030303030303030303030303030303030303 -0303030300000000000000000303030303030300000000000003030303030303000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000100 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000001000000000000621B63631B620000000000000000000000000000 -0000000100000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000040404040404040404040404040404040404040004040400040004 -0000000000000000030303030303030303040303030303040303030303000000030000000000 -0000000000000000000300000000000300000000000003000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000100000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010101010101010000006361010161630000000000000000000000000000000000010000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000004040404040404040404040404040404000404040004000400000000000000 -0000030003030303030303030403030304000303030303000000030000000000000000000000 -0000000300000000000300000000000003000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000100000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0404040404040404040404040400040404040404000400040000000000000000000003000303 -0303030303030304030403000303030303000000030000000000000000000000000000030000 -0000000300000000000003000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000100000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000010101000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000004000404040404 -0404040404040404040404040404040404000000040000000000000303030303030403030304 -0304040303040303030303030303000000000000000000030000000003030000030303030303 -0300000000000000000000000000000000000000000003000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001010100000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000010000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000040004040404040404040404 -0404040404040404040400040004000000000000000003030303030304030303040403040400 -0303030303000300000000000000000000030000000003030000000000030000000000000000 -0000000000000000000000000000000003000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000404040404040404040404040404040404 -0404040004000400000000000000000003030303030303040304040403040400030303030300 -0300000000000000000000030000000003030000000000030000000000000000000000000000 -0000000000000000000003000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000010000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000040404040404040404040404000404040404040404040004 -0004000000000003030303030303030303030404030304030304030303030303030303030000 -0000030303030303030303030303030000030000000000000000000000000000000000000000 -0003030303030303000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000300000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000404040404040404040404040404040404040404040404040004000000 -0000000003030000030303040304030403040300030303030300030300000000000000000003 -0000000003030003000000030000000000000300000000000000000000000000000000000300 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000010000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000001000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000300000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000040004040404040404040404040404040404040404040400000400000000000000000303 -0000030304030303040303030400030303030300030300000000000000000003000000000303 -0003000000030000000000000300000000000000000000000000000000000300000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000010000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000300000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000400040404 -0404040404040404040404040404040404040400040004000000000000000303000003040303 -0304030403030304030303030300030300000000000000000003000000000303000300000003 -0000000000000300000000000000000000000000000000000300000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000001000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000030303030303 -0300000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000040404040404 -0404040404040404040404000004000000000000000000000003030303030303030303030303 -0303030303030303030303030300000000000000000000000303030303030303030303030303 -0303030300000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000010000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000030000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000004040404040404040404040404 -0404040404040400040000000000000000000000000003030303030303030303030003030303 -0300030300000000000000000000000000000000000300000003000000000000030000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000030000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000004000404040404040404040404040404040404040404 -0404000404000004000000000004000003040303030304040303030304040303030003030300 -0300000300000300000000030003000303000003030000000000030000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000030000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000040404040404040404040404040404040404040404040404040400 -0000040000000400000003030403030304040403030404030303030003030300030000030000 -0300000000030003000303000003030000000000030000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000400040404040404040404040404040404040404040404000000000000040004 -0000000003030304030403030404040403030303030000030300030000030000030000000003 -0003000303000000030000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000101010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0004000004040404040404040404040404040400040400000000000000000400000303030303 -0303040303030304040303030303030303030303030303030303030303030303030303030303 -0303030303030000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010101000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000040004040404 -0404040404040404040404040404040404000000000000040004000000000303030403040303 -0404040403030303030000030300030000030000030000000003000300030300000003000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000100000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000004000004040404040404040404 -0404040404040404040004040000000004000000040000000303040303030404040303040403 -0303030000030300030000030000030000000003000300030300000003000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000001000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000404000404040404040404040404040404040404 -0404040404040400000400000000000400040404040403040404040403040404030303030303 -0300030303030000030300030003030303030303030303030300030303000000000000000000 -0000000000000003000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000100 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000100000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000040004000404040404040404040404040404040404040404 -0000040004000000040000000404030404040404040304040403030303030303030003030303 -0000000300030000030303000303030303030300030303000000000000000000000000000000 -0003000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000100000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000400040004040404040404040404040404040404040404000400000004 -0004000000000304040404040404040404040303030303030303030003030303000000030003 -0000030303000303030303030300030303000000000000000000000000000000000300000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000100000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000004000400040400040404040404040404040404040000040000000000040000030303 -0303040403040403040404030303030303030303030303030303030303030303030303030303 -0303030303030303030303030303000000000000000000000303030303030300000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000100000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000010000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000040004 -0004040404040404040404040404040404040404000400000004000400000000030404040404 -0404040404040303030303030303030003030303000000030003000003030300030303030303 -0300030303000000000000000000000000000000000300000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000100000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000010000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000004000400040404040404 -0404040404040404040404040404000004000400000004000000040403040404040404030404 -0403030303030303030003030303000000030003000003030300030303030303030003030300 -0000000000000000000000000000000300000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000400040004040404040404040404040404 -0404040404040404040000040000000000040004040304040304040404040304040403030303 -0303030003030303000000030003000003030300030303030303030003030300000000000000 -0000000000000000000300000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000010000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000400040404040404040404040404040404040404040404 -0404040000040404000003040404040404040304040404040304040403040303030303030303 -0303000003030003030303030303030303030303030303030300000303000000000000000000 -0000000000000000030000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000004000404040404040404040404040404040404040404040404000000 -0404000004040000040404040404040404030404040304030303030303030303030300000303 -0003030303030303030303030303030303030300000303000000000000000000000000000000 -0000030000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000010000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000001000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000040004040404040404040404040404040404040404040000040004000404040400 -0000000404040404040404040404030403030303030303030303030300000303000303030303 -0303030303030303030303030300000303000000000000000000000000000000000003000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000010000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0400040404040404040404040404040404040404000000000400000304040303030303030404 -0404040304040403040303030303030303030303030303030303030303030303030303030303 -0303030303030303030303030303000000000000000000000003030303030303000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000001000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000004000404040404 -0404040404040404040404040404040000040004000404040400000000040404040404040404 -0404030403030303030303030303030300000303000303030303030303030303030303030303 -0300000303000000000000000000000000000000000003000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000010000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000400040404040404040404040404 -0404040404040404040404000000040400000404000004040404040404040403040404030403 -0303030303030303030300000303000303030303030303030303030303030303030000030300 -0000000000000000000000000000000003000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000040004040404040404040404040404040404040404 -0404040404000004040400000304040404040404030404040404030404040304030303030303 -0303030300000303000303030303030303030303030303030303030000030300000000000000 -0000000000000000000003000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000100000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000100000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000004040004040404040404 -0404040404040404040404040404040404040404040404040404040403040404040403040404 -0403030303030303030303030303030303030303030303030303030303030303030303030303 -0300030303000000030003000303030000000300000000000000000000030000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000001000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000100000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000040400040404000404040404040404 -0404040404040404040404040404040404000404040404040404040404040404030303030303 -0303030303030303030303030303030303030303030303030303030303030303030003030300 -0000030003000303030000000300000000000000000000030000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000100 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000100000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000404040404040404040404040404040404040404 -0404040404040404040400000004040404040404040404040403030303030303030303030303 -0303030303030303030303030303030303030303030303030303030003030300000003000300 -0303030000000300000000000000000000030000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000100000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010101 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000004040004040400040404040404040404040004040404040404 -0404040000000003040404040403040404040303030303030303030303030303030303030303 -0303030303030303030303030303030303030303030303030303030303030303030303030303 -0303030300000000030303030303030000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001010100000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000010000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000404040404040404040404040404040404040404040404040404040404040000 -0004040404040404040404040403030303030303030303030303030303030303030303030303 -0303030303030303030303030303030003030300000003000300030303000000030000000000 -0000000000030000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000100000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000010000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000004 -0400040404000404040404040404040404040404040404040404040404040400040404040404 -0404040404040404030303030303030303030303030303030303030303030303030303030303 -0303030303030303030003030300000003000300030303000000030000000000000000000003 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000100000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000010000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000404000404040404 -0404040404040404040404040404040404040404040404040404040404040304040404040304 -0404040303030303030303030303030303030303030303030303030303030303030303030303 -0303030003030300000003000300030303000000030000000000000000000003000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000010000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000010000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000001000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000010000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000001000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000010000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000606101010000000000000000000000 -0000000000000001000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000621B63010000000000000000000000000000000000 -0001000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000000000000000000000000000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000010000000000000000000000000000000000000100000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000100000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000000000000000000000000000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000001000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000100000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000040400 -0404000404040404040404040404040404040404040404040404040404040404040404040404 -0404040404040404040303040303030303040303030303030303030303030303030303030303 -0303030303030303030303030303030303000303030000030303030303000000000303030300 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -0000000000000000000000000000000100000000000000000000000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000000000000000000000000000000010000000000000000000100 -0000000000000000000000000000000000000000000000000000000100000000000000000000 -0000000000000000000000000000000000000000000000000000000100000000000000000000 -0000000000000000000100000000000000000100000000000000000000000000000000000000 -0000000000000000000100000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000000000000000000000000000000010404000404040404 -0401040404040404040404040404040404040404040404040404040404040404040404040404 -0404030304030403030304030303030303030303030303030303030303030303030303030303 -0303030303030303030303000303030000030303030303000000000303030300000000000000 -0000000000000000000000000100000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000000000000000000000000000000000100000000 -0000000001000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000000000000 -0000000000000000000100000000000000000000000000000000000000000000000000000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000000000000000000000000000000010000000000000000000100000000000000 -0000000000000000000000000000000000000000000100000000000000000000000000000000 -0000000000000000000000000000000000000000000100000000000000000000000000000000 -0000000100000000000000000100000000000000000000000000000000000000000000000000 -0000000100000000000000000000000000000000000000000000000000000000000000000000 -0000000001000000000000000000000000000000000000010004040404040404040404040404 -0404040404040404040404040404040404040404040404040404040404040404040403040303 -0304030403030303030303030303030303030303030303030303030303030303030303030303 -0303030303000303030000030303030303000000000303030300000000000000000000000000 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000000000000000000000000000000000100000000000000000100 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000000000000000000000000 -0000000101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010101010101010101 -0101010101010101010101010101010101010101010101010101010101010100000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000004040404040404040404040404040404040404040404040404 -0404040404040404040404040404040404040404040403040303030403040303030303030303 -0303030303030303030303030303030303030303030303030303030303030300030303000003 -0303030303000000000303030300000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000404000404040404040004040404040404040404040404040404040404040404 -0404040404040404040404040404040403030403040303030403030303030303030303030303 -0303030303030303030303030303030303030303030303030300030303000003030303030300 -0000000303030300000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000001000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000004 -0400040400040404040404040404040404040404040404040404040404040404040404040404 -0404040404040404040404030304030303030304030303030303030303030303030303030303 -0303030303030303030303030303030303030300030303000003030303030300000000030303 -0300000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000101010101 -0101000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000606101010000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000606101010000000000006361010161630000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000606101 -0100000000000063610101616300000000636101016163000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000060610101000000000000636101016163000000006361010161 -6300000000636101016163000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000060610101000000000000 -6361010161630000000063610101616300000000636101016163000000000063610101616300 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000006061010100000000000063610101616300000000636101016163000000006361 -0101616300000000006361010161630000000063610101616300000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000062 -1B63010000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000621B6301000000000000621B63631B620000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000621B63010000000000 -00621B63631B6200000000621B63631B62000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000621B6301000000000000621B63631B6200000000621B63631B620000000062 -1B63631B62000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000621B6301000000000000621B63631B62 -00000000621B63631B6200000000621B63631B620000000000621B63631B6200000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -621B6301000000000000621B63631B6200000000621B63631B6200000000621B63631B620000 -000000621B63631B6200000000621B63631B6200000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000100000000001B6100000000616400000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000100000000001B6100000000 -616400001B610000000061640000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000100000000001B6100000000616400001B6100000000616400001B61000000006164 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000100000000001B6100000000616400001B6100 -000000616400001B610000000061640000001B61000000006164000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010000 -0000001B6100000000616400001B6100000000616400001B610000000061640000001B610000 -0000616400001B61000000006164000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000010000000000656000000000606500000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000010000000000656000000000606500006560 -0000000060650000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000100 -0000000065600000000060650000656000000000606500006560000000006065000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000065600000000060650000656000000000606500 -0065600000000060650000006560000000006065000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000010000000000656000 -0000006065000065600000000060650000656000000000606500000065600000000060650000 -6560000000006065000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000001000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -0000000000626300000000636200000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000000000626300000000636200006263000000006362 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000100000000006263 -0000000063620000626300000000636200006263000000006362000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001000000000062630000000063620000626300000000636200006263000000 -0063620000006263000000006362000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000010000000000626300000000636200 -0062630000000063620000626300000000636200000062630000000063620000626300000000 -6362000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000001000000000001 -0000000000000100000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000010000000000010000000000000100000100000000000001000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000100000000000100000000000001 -0000010000000000000100000100000000000001000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000001000000000000010000010000000000000100000100000000000001000000 -0100000000000001000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000010000000000010000000000000100000100000000 -0000010000010000000000000100000001000000000000010000010000000000000100000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000001000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001000000000001000000000000 -0100000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000010000000000010000000000000100000100000000000001000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000100000000000100000000000001000001000000 -0000000100000100000000000001000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000100000000 -0001000000000000010000010000000000000100000100000000000001000000010000000000 -0001000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000010000000000010000000000000100000100000000000001000001 -0000000000000100000001000000000000010000010000000000000100000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000001000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000001000000000062630000000063620000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -0000626300000000636200006263000000006362000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000100000000006263000000006362000062630000000063620000 -6263000000006362000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000100000000006263000000 -0063620000626300000000636200006263000000006362000000626300000000636200000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000010000000000626300000000636200006263000000006362000062630000000063 -6200000062630000000063620000626300000000636200000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000100 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000001000000000065600000000060650000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000001000000000065600000 -0000606500006560000000006065000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000006560000000006065000065600000000060650000656000000000 -6065000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000100000000006560000000006065000065 -6000000000606500006560000000006065000000656000000000606500000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000001 -0000000000656000000000606500006560000000006065000065600000000060650000006560 -0000000060650000656000000000606500000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000100000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000100000000001B610000000061640000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000100000000001B610000000061640000 -1B61000000006164000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0100000000001B6100000000616400001B6100000000616400001B6100000000616400000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000100000000001B6100000000616400001B610000000061 -6400001B610000000061640000001B6100000000616400000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000100000000001B -6100000000616400001B6100000000616400001B610000000061640000001B61000000006164 -00001B6100000000616400000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000100000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0001000000000000621B63631B62000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001000000000000621B63631B6200000000621B63631B -6200000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000000 -00621B63631B6200000000621B63631B6200000000621B63631B620000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000001000000000000621B63631B6200000000621B63631B6200000000621B -63631B620000000000621B63631B620000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000001000000000000621B63631B62 -00000000621B63631B6200000000621B63631B620000000000621B63631B6200000000621B63 -631B620000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000101010101010100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000101010101010100 -0000636101016163000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000001010101010101000000636101016163000000006361010161630000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000010101010101010000006361010161 -6300000000636101016163000000006361010161630000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0101010101010100000063610101616300000000636101016163000000006361010161630000 -0000006361010161630000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000001010101010101000000636101016163000000006361 -0101616300000000636101016163000000000063610101616300000000636101016163000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000100000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000063016100000000000000000000000000000000000001000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000100000000000000000000006101630000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000100000000000000000000000000010000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000061620000000000000000000000000000000000000001000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000010000 -0000000000000000000062610000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000100000000000000000000000000010000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -6301600000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000010000000000000000 -0000000060016300000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000100000000636101621B00000001010101010000006065016264000000000100 -1B62016264000000006361620162640065600000000000636200000000000000646500000000 -01006162621B0000616201610000000001000000006361620162640000010061620100006065 -01016560000000001B6201016560000000606501626400000000006361620162640000606501 -01656000000001001B620162640000000063650162610001000000001B620101656000000065 -6400000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -010000000062640063611B0000000100000000006362640060626000000001611B6300606264 -000063621B630060610064650000000000611B00000000000000656400000000016164636365 -1B6164636365640000000100000063621B630060610000016164000000606264636364626000 -00611B630063606500006362640060626000000063621B630060610060626463636462600000 -01611B6300606264000063626463631B6101000000611B630063606500000064610000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000010000000000 -0000006362000000010000000000611B0000006065000000011B0000000060650000611B0000 -0000000000626300000063016300000000000000626300000000016400000060016400000060 -6500000001000000611B00000000000000011B00000000616400000000646100000100000000 -00000000611B0000006065000000611B00000000000061640000000064610000011B00000000 -60650000611B000000001B010000000100000000000000000063620000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000001000000001B620101010100 -000001000000000062630000006362000000016300000000636200006263000000000000001B -610000001B610000000000000000010000000000016300000000016300000000010000000100 -0000626300000000000000016300000000626300000000636200006561630000000000006263 -0000006362000000626300000000000062630000000063620000016300000000636200006263 -0000000063010000006561630000000000000000010000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000010000006165600000000100000001000000 -0000010101010101010000000100000000000001000001000000000000000063626300006260 -0000000000000000010000000000010000000000010000000000010000000100000001000000 -0000000000010000000000010000000000000100006361016261600000000101010101010100 -0000010000000000000001000000000000010000010000000000000100000100000000000001 -0000006361016261600000000000010000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000010000006263000000630100000001000000000062630000 -0000000000000100000000000001000062630000000000000000611B00646500000000000000 -0000626300000000010000000000010000000000010000000100000062630000000000000001 -0000000000626300000000636200000000006364656100006263000000000000000062630000 -0000000062630000000063620000010000000000000100006263000000006301000000000000 -6364656100000063620000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000100000062630000001B0100000001000000000061640000000000000000 -01000000000000010000611B0000000000000000636200656400000000000000000061640000 -00000100000000000100000000000100000001000000611B0000000000000001000000000061 -64000000006461000000000000006301000061640000000000000000611B0000000000006164 -000000006461000001000000000000010000611B000000001B01000000000000000063010000 -0064610000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -000001000000616163631B610100000062640000000063626463006065000000010000000000 -0001000063621B6300606100000000651B620000000000000000000064650000000001000000 -0000010000000000010000000100000063621B63006061000001000000000060626463636462 -60000065646300631B6500006362646300606500000063621B63006061006062646363646260 -000001000000000000010000636264636364610100000065646300631B650000006564000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000001000000 -6361620161000100000060620101000000606501016560000000010000000000000100000063 -61620165640000000060011B0000000000000000000063016000000001000000000001000000 -0000010000000100000000636162016564000001000000000000646501016560000000606162 -01621B0000000060650101656000000000636162016564000064650101656000000001000000 -000000010000006365016261000100000060616201621B000000600163000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000001630000000000000000000000616200000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000626100000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000631B6100 -0000000000000000000000630161000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000061016300000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000101610000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000000000000000000000000000000000000000 -0000000000000000 - -end -%%PageTrailer -%%Trailer -%%EOF diff --git a/doc/libmicrohttpd_performance_data.png b/doc/libmicrohttpd_performance_data.png Binary files differ. diff --git a/doc/m1.txt b/doc/m1.txt @@ -1,194 +0,0 @@ -Dear all, - -We're happy to announce reaching the first milestone for the -STF-funded MHD 2.0 project, which is completing the MHD HTTP header -and thus the design for the next generation API. We have now -spent several months iterating between discussing, designing, -optimising, editing, and testing details and are finally -happy with the result. - -Key objectives for us were: - -- simplify application code that uses MHD -- keep the API and the MHD code size small -- ensure the API is extensible -- enable use of different TLS backends, avoid backend-specific - settings to use backends in the same way. -- make API work with HTTP 1.x, HTTP/2 and HTTP/3 -- preserve or improve portability across platforms -- stay compatible to a wide range of C and C++ compilers - -The main changes these objectives inspired are to: - -- Split the MHD_AccessHandlerCallback functionality into - various separate callbacks to keep the API simple for - simple requests while allowing complex logic to be - incrementally introduced via the new "struct MHD_Action". - Main effects: - * improved type safety - * client code most likely to always need all arguments - passed to callbacks, while keeping rarely used - arguments available via the introspection API - * harder or impossible to make calls at the wrong time - or to forget to do key processing steps - * clients more likely to avoid repeated URL dispatching - * Easier to add commonly used features like a generic - URL dispatcher - * Improved modularity, easier to not compile in some - features (actions) to minimize code size -- We changed how MHD is configured, providing a new - strongly-typed but still extensible mechanism - to set options, avoiding the use of 'varargs' for - options while also not introducing new symbols for - any kind of option. The new construction uses - either inline functions or macros depending on the - compiler to initialize a struct with a variant union; - as a result, application developers get the experience - of using well-typed functions, while no such functions - actually exist in the library, keeping the code size - minimal, especially if features are not even used :-). -- Unified the way how settings are used for daemon, - connection and response objects. -- Removed the separation of options and flags and - made it harder to pass inconsistent options -- improved terminology across the API, in particular by - eliminating confusion between 'request' and 'connection', - but also by introducing new 'nouns' such as 'session', - 'stream' and 'action', but also 'String' which returns a - 'String' that is both 0-terminated but ALSO has a - known length (eliminating need for applications - to call strlen() on all strings returned by MHD). - Also changed the API to use more consistent - prefixes for related functions by using - "MHD_subject_verb_object" naming convention -- significantly simplified for application processing of - client's upload. Removed the need for troublesome (for - application) incremental processing (especially problematic - for forms processing), while keeping automatic limits - for memory allocations, preventing by design a wide range - of remote attacks. -- Added unified and detailed introspection API for library, - daemon, connection, stream and request objects. - The API is designed in the same way for all object, simplifying - use for the application. The new API is detailed and allow - application to extract any required information in a simple - way. Also separated "fixed" and "dynamic" properties of objects - for letting compiler optimise application code better. -- Integrated HTTP status into the response object, as - this is way more logical and we are aware of various - implementations being forced to basically pass them - around as a tuple. -- simplified API for common-case of one-shot responses by - eliminating need for destroy response in most cases -- Improved portability by avoiding fixed types, like uint32_t, - as they may not exist on some platforms. Instead use - types like uint_fast32_t. Avoided use of enums with very - large bitmasks as 'int' could be just 16 bits on some platforms - resulting in enum values higher than 65535 being silently dropped. -- Improved possibility of use of zero-copy style for parsing - uploaded data, including of the PostProcessor parser while - still allowing applications to do stream processing if data - does not fit into main memory. This both simplifies usage - in the common case where uploaded data is small, while also - nicely supporting use-cases with large data streams. -- Made responses unmodifiable after first use. Modifiable responses - cannot be thread-safe. However, MHD-generated headers (Date, - Connection/Keep-Alive) are part of the *request* and do not count - as part of the immutable "response" here. Removed "footers" from - responses. With unmodifiable responses everything should be "headers". - However, footers are supported as part of a *request* instead. -- Move response codes from MHD_HTTP_xxx namespace to MHD_HTTP_CODE_xxx - namespace. This avoids potential clashes with other MHD constant names. -- Introduced various new "enums" especially for constants - introduced in HTTP/2 where use of these constants can - then avoid having to map between protocol numbers and - strings (but applications may still also use the strings) - This also includes better status codes returned from - API calls to diagnose issues (no more just "YES/NO") -- Let application to use request methods as a enum, avoid repeated - string comparison by sharing result of the already performed - internal detection of the request method. Keep ability to - use non-standard HTTP requests methods if needed via use - of introspection API. -- Introduced "MHD_APP_SOCKET_CNTX_TYPE" hack to allow - applications to improve type-safety by overriding - the type of "closure" arguments instead of using - "void *" pointers. -- Significant re-design of the event loop APIs to simplify integrating - MHD with external event loops while preserving O(1) processing cost. -- Added many annotations to help compiler determine invariants (if - supported by the compiler), such as arguments not being NULL, etc. -- Removal of various legacy symbols only exported for API compatibility. - - -While these are lots of changes, we want to give you a first brief preview of -how this will impact client code using the library. Here is an example of how -clients used to initialize the MHD daemon (from demo.c): - -OLD>> -d = MHD_start_daemon ( - MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD - | MHD_USE_ERROR_LOG, - (uint16_t) port, - NULL, NULL, - &generate_page, - NULL, - MHD_OPTION_CONNECTION_MEMORY_LIMIT, - (size_t) (256 * 1024), -#ifdef PRODUCTION - MHD_OPTION_PER_IP_CONNECTION_LIMIT, - (unsigned int) (64), -#endif - MHD_OPTION_CONNECTION_TIMEOUT, - (unsigned int) (120 /* seconds */), - MHD_OPTION_THREAD_POOL_SIZE, - (unsigned int) NUMBER_OF_THREADS, - MHD_OPTION_NOTIFY_COMPLETED, - &response_completed_callback, - NULL, - MHD_OPTION_END); -if (NULL == d) - error(); -<< - -This was one big variadic mess, and getting any of the -types wrong for any of the options could result in -trouble, sometimes depending on the target platform. - -With MHD 2.0, the same code will look like this: - -NEW>> -d = MHD_daemon_create (&generate_page, - NULL); -if (MHD_SC_OK != - MHD_daemon_options_set ( - d, - MHD_D_OPTION_BIND_PORT (MHD_AF_DUAL, port), - MHD_D_OPTION_WM_WORKER_THREADS (NUMBER_OF_THREADS), - MHD_D_OPTION_CONN_MEMORY_LIMIT (256*1024), - MHD_D_OPTION_PER_IP_LIMIT (64), - MHD_D_OPTION_DEFAULT_TIMEOUT (120), - MHD_D_OPTION_NOTIFY_CONNECTION (&response_completed_callback, - NULL))) - error(); -if (MHD_SC_OK != - MHD_daemon_start (d)) - error(); -<< - -Note that you can can call MHD_daemon_options_set() multiple times if you need -to handle errors for individual options. Thanks to extensive trickery on our -part, the resulting type-safe code should *also* be almost as compact and fast -as the previous version (mostly, this adds two additional library API calls, -but in return you can get more precise status codes back). - - -While we thought hard about the new API and poured our experience into the -re-design, we still might have overlooked something and thus value community -feedback. - -We thank Sovereign Tech Fund for funding this work. - -Happy hacking! - -Christian & Evgeny diff --git a/doc/manual/actions.inc b/doc/manual/actions.inc @@ -0,0 +1,418 @@ +When handling HTTP requests from clients in a +@code{MHD_RequestCallback} the main result of the handler is always a +@code{struct MHD_Action}. The action returned by the handler +determines how the processing of the HTTP request should continue. + +@anchor{MHD_Action} +@deftp {C Struct} MHD_Action +Actions are returned by the application to MHD +to drive the request handling of MHD. +@end deftp + +It is important to remember that the +@ref{MHD_RequestCallback,,@code{MHD_RequestCallback}} is +invoked immediately after MHD has parsed the HTTP request +@emph{headers}. This means, the client may not yet have uploaded the +request body (for example, if the request is using the POST +method). Depending on the HTTP protocol version and the size of the +upload, the client may actually wait for confirmation (``101 +Continue'') from the HTTP server before proceeding with the upload. +Thus, when the @code{MHD_RequestCallback} is invoked, we generally +have several choices: + +@itemize @bullet{} +@item Return an HTTP response immediately. If the client would have +proceeded to send a body, this may possibly preempt it from +uploading a body by denying the request. + +@item Fail hard by closing the connection. This is usually the +least desirable choice and should be reserved to cases where the +server has no resources to generate even an response to indicate +a failure. + +@item Suspend handling the request. This can be useful if generating +a response requires some other server-side process to make progress +or to rate-limit overly eager clients. Note that if an application +suspends handling a request, HTTP/1.1-compatible clients may start +the upload anyway (without first waiting for the +"101 Continue" response) as the may fall back to HTTP/1.0 compatibility +in this case. Thus, suspending request handling is not recommended +if an upload is to be prevented. + +@item Explicitly allow the client to upload data, parse it and eventually +return a response (or fail hard by closing the connection). +@end itemize + +@ref{libmicrohttpd2-responses} discusses generating responses in +detail. This chapter will focus on the @emph{other} three +cases.@footnote{There is a special fifth case which applies when an +HTTP/1.x client requests a ``protocol upgrade''. This is most often +used to create a WebSocket. Creating an action for such protocol +upgrades is described in @ref{libmicrohttpd-upgrade}.} + +@node libmicrohttpd-actions-fail +@section Failing hard by closing the connection + +The simplest way to handle a request is to simply close the +connection, not returning any data to the client. This violates +the HTTP protocol, but is of course the ultimate fallback when +regular error handling is not possible. + +@anchor{MHD_action_abort_request} +@deftypefun {const struct MHD_Action *} MHD_action_abort_request (struct MHD_Request *request) + +Creates an action to tell MHD to close the connection hard +(kind-of breaking HTTP specification). This +is actually simply a macro that is equivalent to just @code{NULL}, +except that it also suggests to the compiler that it it should +not emit a warning for not using @var{request}. +@end deftypefun + + + +@node libmicrohttpd-actions-suspend +@section Suspend handling the request + +@code{MHD_action_suspend()} is used to suspend a client's +request. MHD will keep the network connection open until the +application explicitly tells it to resume processing. + +@anchor{MHD_action_suspend} +@deftypefun {const struct MHD_Action *} MHD_action_suspend (struct MHD_Request *request) + +Suspend handling of network data for a given request. This can +be used to dequeue a request from MHD's event loop for a while. + +Suspended requests continue to count against the total number of +requests allowed (per daemon, as well as per IP, if such limits +are set). Suspended requests will NOT time out; timeouts will +restart when the request handling is resumed. While a +request is suspended, MHD may not detect disconnects by the +client. + +@table @var +@item ctx request +the request for which the action is generated +@end table + +The function returns an action to cause a request to be suspended. + +@code{NULL} is returned if any action has been already created for the @var{request}. +@end deftypefun + +After suspending a request, the application must eventually resume +request handling via @code{MHD_request_resume()}. MHD will then call +the @code{MHD_RequestCallback} again for the @var{request}, allowing +the application to again inspect the request and return a new action. + +@cindex long-polling +@anchor{MHD_request_resume} +@deftypefun void MHD_request_resume (struct MHD_Request *request) + +Resume handling of network data for suspended request. It is safe to +resume a suspended request at any time. Calling this function on a +request that was not previously suspended will result in undefined +behaviour. @c FIXME: or a call to the panic function!? + +@table @var +@item ctx request +the request to resume +@end table +@end deftypefun + +If you are using this function in @emph{external} select mode, you +must make sure to run @code{MHD_daemon_process_blocking()} afterwards +(as otherwise the change may not be reflected in the set returned to +your @code{MHD_SocketRegistrationUpdateCallback} and you may end up +with a request that is stuck until the next network activity). + + +@node libmicrohttpd-actions-upload +@section Processing a request body + +There are various ways to create an action that tells MHD that the +application wants to process the body being uploaded by the client. If +the client sent an ``Expect: 100-Continue'' header with its request, +returning any of these will automatically cause MHD to respond with a +``100 Continue'' status and initiate receiving the response from the +client. Thus, applications should never attempt to explicitly return +``100 Continue'' themselves. + +The main function to call to handle uploads discussed in this +section is @code{MHD_action_process_upload()}. While this function +in principle works for any kind of upload, it is not the most +convenient when handling structured data from an HTML form that +is encoded as ``application/x-www-form-urlencoded'' or +``multipart/form-data'' or the (less common) ``text/plain'' +HTML5 form. When handling uploads of these formats, it is +usually better to use @ref{MHD_action_parse_post}. + +@anchor{MHD_action_process_upload} +@deftypefun {const struct MHD_Action *} MHD_action_process_upload (struct MHD_Request *request, size_t large_buffer_size, MHD_UploadCallback uc_full, void *uc_full_cls, MHD_UploadCallback uc_inc, void *uc_inc_cls) + +Creates an action that handles an upload from a client. + +@c FIXME: this isn't exactly elegant. We should see if we can +@c provide a way to generate a TOO_LARGE status response properly instead! +If @var{uc_inc} is @code{NULL} and the body does not fit +into the allocated buffer, the request is aborted without +any response by closing the connection. + +@table @var +@item request +the request to create action for; + +@item large_buffer_size +how large should the upload buffer be. +May allocate memory from the shared "large" +memory pool if necessary and non-zero is given. +Must be zero if @var{uc_full} is @code{NULL}; + +@item uc_full +function to call when complete body is +received (only if it fits into @var{upload_buffer_size} bytes; +can be @code{NULL} if @var{uc_inc} is not @code{NULL}; +must be @code{NULL} is @var{upload_buffer_size} is zero; + +@item uc_full_cls +closure for @var{uc_full}; + +@item uc_inc +function to call to incrementally process the uploaded data +if the upload if larger than @var{upload_buffer_size} +or if @var{upload_buffer_size} cannot be allocated or +if @var{uc_full} is @code{NULL}; +can be @code{NULL} if @var{uc_full} is not @code{NULL}; + +@item uc_inc_cls +closure for @var{uc_inc}. +@end table + +The function returns @code{NULL} on error (out of memory, invalid parameters) +or if any action has been already created for the @var{request}, +and otherwise a pointer to the action. +@end deftypefun + +@code{MHD_action_process_upload()} is a bit overly complicated +as it conflates the two main use-cases: + +@itemize +@item handling of the entire data body in one buffer in memory, and +@item incremental parsing of the upload over time. +@end itemize + +In practice, applications are expected to use the two APIs +that separate these use-cases, specifically +@code{MHD_action_process_upload_full()} and +@code{MHD_action_process_upload_inc()}. + +@anchor{MHD_action_process_upload_full} +@deftypefun {const struct MHD_Action *} MHD_action_process_upload_full (struct MHD_Request *request, size_t large_buffer_size, MHD_UploadCallback uc_full, void *uc_full_cls) + +Creates an action that handles an upload from a client +as a full upload data where MHD places all uploaded data +into a buffer and then gives the result to the application +all at once. + +@c FIXME: this isn't exactly elegant. We should see if we can +@c provide a way to generate a TOO_LARGE status response properly instead! +If @var{uc_inc} is @code{NULL} and the body does not fit +into the allocated buffer, the request is aborted without +any response by closing the connection. + +@table @var +@item request +the request to create action for + +@item large_buffer_size +how large should the upload buffer be. +May allocate memory from the shared "large" +memory pool if necessary. Usually the value +given here will be the size of the upload as +provided by the HTTP request header. + +@item uc_full +function to call when complete body is +received (only if it fits into @var{upload_buffer_size} bytes; + +@item uc_full_cls +closure for @var{uc_full}. +@end table + +The function returns @code{NULL} on error (out of memory, invalid parameters) +or if any action has been already created for the @var{request}, +and otherwise a pointer to the action. +@end deftypefun + +@anchor{MHD_action_process_upload_inc} +@deftypefun {const struct MHD_Action *} MHD_action_process_upload_inc (struct MHD_Request *request, MHD_UploadCallback uc_inc, void *uc_inc_cls) + +Creates an action that handles an upload from a client incrementally. + +@table @var +@item request +the request to create action for; + +@item uc_inc +function to call to incrementally process the uploaded data; + +@item uc_inc_cls +closure for @var{uc_inc}. +@end table +@end deftypefun + +In all three cases, the application must provide callbacks to handle +the uploaded data. These callbacks have the type @code{MHD_UploadCallback}. +The application is provided with the uploaded data (either all of it at +once or just the latest increment) and must return a +@code{struct MHD_UploadAction} to determine how to continue handling +the @var{request}. + + +@anchor{MHD_UploadCallback} +@deftypefn {Function Pointer} {struct MHD_UploadAction *} (*MHD_UploadCallback) (void *cls, struct MHD_Request *request, size_t content_data_size, void *content_data) + +Functions of this type are invoked by MHD whenever an application +should process the HTTP body of a client's request. + +@table @var +@item upload_cls +custom closure provided by the application together with the +pointer to the function + +@item request +the request that is being processed + +@item content_data_size +number of bytes in @var{content_data}, +zero when all data have been processed; + +@item content_data +@var{content_data_size} bytes of the HTTP request body; +can be safely modified in the callback; +the buffer is valid only until the application +returns from the callback; +@code{NULL} when all data of the body have been processed; + +@end table +The returned @code{struct MHD_UploadAction} +informs MHD how to proceed further with the +@var{request}. Returning @code{NULL} is +equivalent to @code{MHD_upload_action_abort_request()}. +@end deftypefn + +The @code{struct MHD_UploadAction} is quite similar to +the @ref{MHD_Action,,@code{struct MHD_Action}} except that it is only +applicable when processing client uploads. + +@anchor{MHD_UploadAction} +@deftp {C Struct} MHD_UploadAction +Actions are returned by the application to MHD +to drive the request handling of MHD. +@end deftp + +There are four basic @code{struct MHD_UploadAction}s that +applications can use: + +@c FIXME: the fact that there are upload actions that only +@c work for incremental upload processing suggests to me +@c again that we should just have MHD_Action and not Upload/DCC actions. +@itemize +@item continue processing the upload (for incremental upload processing only) +@item suspend processing the upload (say to slow down the client to allow + the application to keep up) +@item abort handling the request (closing the connection), and +@item returning an HTTP response +@end itemize + +The following functions generate the respective upload actions. + + +@anchor{MHD_upload_action_continue} +@deftypefun {const struct MHD_UploadAction *} MHD_upload_action_continue (struct MHD_Request *request) + +Action telling MHD to continue processing the upload. +Valid only for incremental upload processing. + +@table @var +@item request +the request to create the upload action for; +@end table + +Fails and returns @code{NULL} when used in combination with a +full upload callback, for the final (with zero bytes of data) +call to an incremental callback or on a request that is not +handling an upload. +@c FIXME: the fact that we fail here if an upload action +@c is created for a request that isn't doing an upload suggests to me +@c again that we should just have MHD_Action and not Upload/DCC actions. + +@end deftypefun + + +@anchor{MHD_upload_action_abort_request} +@deftypefun {const struct MHD_UploadAction *} MHD_upload_action_abort_request (struct MHD_Request *request) + +Aborts handling the request by closing the connection. This +is actually simply a macro that is equivalent to just @code{NULL}, +except that it also suggests to the compiler that it it should +not emit a warning for not using @var{request}. + +@table @var +@item request +the request to create the upload action for; +@end table +@end deftypefun + + +@anchor{MHD_upload_action_from_response} +@deftypefun {const struct MHD_UploadAction *} MHD_upload_action_from_response (struct MHD_Request *request, struct MHD_Response *response) + +Converts a @var{response} to an upload action. If +@code{MHD_R_O_REUSABLE} is not set, the reference to the +@var{response} is consumed by the conversion. If +@code{MHD_R_O_REUSABLE} is @code{MHD_YES}, then the @var{response} can +be used again to create other actions in the future. However, the +@var{response} is frozen by this step and must no longer be modified +(i.e. by setting headers). + +@table @var +@item request +the request to create the upload action for; + +@item response +the response to return to the client. +@end table + +The function returns a pointer to the upload action; the upload action +must be consumed otherwise the response object may leak; The function +returns @code{NULL} if it failed (no memory) or if any other upload +action has been already created for the @var{request} (or if the +request is currently not in a state of handling an upload). When the +function fails, the response object is nevertheless consumed and need +not be "destroyed" by the application. + +@end deftypefun + +@anchor{MHD_upload_action_suspend} +@deftypefun {const struct MHD_UploadAction *} MHD_upload_action_suspend (struct MHD_Request *request) + +Suspend handling of network data for the given @var{request}. This can +be used to dequeue a request from MHD's event loop for a while. + +Suspended requests continue to count against the total number of +requests allowed (per daemon, as well as per IP, if such limits +are set). Suspended requests will NOT time out; timeouts will +restart when the request handling is resumed. While a +request is suspended, MHD may not detect disconnects by the +client. + +@table @var +@item request +the request to create the upload action for; +@end table +@end deftypefun + +After suspending an upload action, applications must +use @ref{MHD_request_resume,,@code{MHD_request_resume()}} +to resume processing the upload. +\ No newline at end of file diff --git a/doc/manual/authentication.inc b/doc/manual/authentication.inc @@ -0,0 +1,876 @@ +@cindex authentication +@noindent +MHD supports three types of client authentication: + +@itemize + +@item Basic authentication uses a simple authentication method that +transmits username and password in simple base64 encoding. Username +and password are exchanged in cleartext between the client and the +server, so this method must only be used for non-sensitive content or +when the session is protected with TLS. When using basic +authentication MHD will have access to the clear password, possibly +allowing the application to create a chained authentication toward an +external authentication server. + +@item Digest authentication uses a one-way authentication method based on +cryptographic hash algorithms. Only the hash is transmitted over the +network, hence protecting the user's password. A nonce is used to +prevent replay attacks. This method is appropriate for general use, +especially when TLS is not used to encrypt the transmission. + +@item Client certificate authentication uses a X.509 certificate from the +client. This is the strongest authentication mechanism and also +requires the use of TLS. Client certificate authentication can be used +simultaneously with Basic or Digest Authentication in order to provide +a two levels authentication (like, for instance, separate machine and +user authentication). + +@end itemize + +@menu +* libmicrohttpd-dauth basic:: Using Basic Authentication. +* libmicrohttpd-dauth digest:: Using Digest Authentication. +* libmicrohttpd-dauth example:: Example for Digest Authentication. +@c * libmicrohttpd-dauth token:: Using Token Authentication. +@c FIXME * libmicrohttpd-dauth tls:: Using TLS Client Authentication. +@end menu + + +@node libmicrohttpd-dauth basic +@section Using Basic Authentication +@cindex basic authentication + +@ref{MHD_LIB_INFO_FIXED_HAS_AUTH_BASIC,,@code{MHD_LIB_INFO_FIXED_HAS_AUTH_BASIC}} +can be used to detect if the MHD build includes support for HTTP basic +authorization. + +To use HTTP basic authentication, the HTTP server must first return a +response with status @code{MHD_HTTP_STATUS_UNAUTHORIZED} asking the +client to authenticate. This is usually done @emph{after} checking +whether the client did already authenticate, which we will look at +later in this section. To challenge a client to authenticate using +HTTP basic authentication, MHD offers the +@code{MHD_response_add_auth_basic_challenge()} function which +@emph{modifies} an existing response, adding HTTP headers asking the +client to authenticate. + +@deftypefun {enum MHD_StatusCode} MHD_response_add_auth_basic_challenge (struct MHD_Response *response, const char *realm, enum MHD_Bool prefer_utf8) + +Adds a basic authentication "challenge" to the response. The +@var{response} must use @code{MHD_HTTP_STATUS_UNAUTHORIZED} for its +HTTP status code. + +If access to any resource should be limited to specific users, +authenticated by basic authentication mechanism, and the request for +this resource does not have basic authentication information +(@xref{@code{MHD_AuthBasicCreds},,MHD_AuthBasicCreds}), then a +response with a basic authentication "challenge" should be sent by +extending an error response using this function. This works as an +indication that basic authentication should be used for the access. + +See RFC 7617, section 2 for details. + +@table @var +@item response +the response to update; should contain the "access denied" body; note: this + function sets the "WWW Authenticate" header and thus the caller + should not set this header; the response must have + @code{MHD_HTTP_STATUS_UNAUTHORIZED} HTTP status code; passing + @code{NULL} is tolerated, in which case the result will be + @code{MHD_SC_RESP_POINTER_NULL} + +@item realm +the realm presented to the client + +@item prefer_utf8 +if not set to @code{MHD_NO} the parameter 'charset="UTF-8"' +will be added, indicating for client that UTF-8 encoding is preferred + +@end table + +The function returns +@itemize +@item @code{MHD_SC_OK} if it succeeded +@item @code{MHD_SC_TOO_LATE} if the response has been already "frozen" (used to create an action), +@item @code{MHD_SC_RESP_HEADERS_CONFLICT} if a Basic Authentication "challenge" was already added, +@item @code{MHD_SC_RESP_POINTER_NULL} if @var{response} was set to @code{NULL}, +@item @code{MHD_SC_RESP_HTTP_CODE_NOT_SUITABLE} is response status code is wrong, +@item @code{MHD_SC_RESP_HEADER_VALUE_INVALID} if realm is zero-length or has CR or LF characters, +@item @code{MHD_SC_RESPONSE_HEADER_MEM_ALLOC_FAILED} if memory allocation failed, +@item or possibly other error codes (that could be defined in the future) on failure. +@end itemize + +@end deftypefun + +@c FIXME: current header ONLY exports this API (and the _p/_a variants) if static inline is supported; that's not nice, API changes based on compiler. +@c FIXME: also not convinced this API is even all that useful. Maybe remove? +MHD provides a convenience API that adds the basic authentication challenge +to response and turns it into the action to be returned +from the @ref{MHD_RequestCallback,,@code{MHD_RequestCallback}}. + +@deftypefun {const struct MHD_Action *} MHD_action_basic_auth_challenge (struct MHD_Request *request, const char *realm, enum MHD_Bool prefer_utf8, struct MHD_Response *response, enum MHD_Bool abort_if_failed) + +Creates an action to reply with a basic authentication "challenge". +The response must use @code{MHD_HTTP_STATUS_UNAUTHORIZED} for its HTTP +status code. + +If access to any resource should be limited to specific users, +authenticated by basic authentication mechanism, and the request for +this resource does not have basic authentication information +(@xref{MHD_AuthBasicCreds}), then a response with a basic +authentication "challenge" should be sent by extending an error +response using this function. This works as an indication that basic +authentication should be used for the access. + +See RFC 7617, section-2 for details. + +@table @var +@item request +the client request to generate the action for + +@item realm +the realm presented to the client + +@item response +the reply to send; should contain the "access denied" body; note: this + function sets the "WWW Authenticate" header and thus the caller + should not set this header; the response must have + @code{MHD_HTTP_STATUS_UNAUTHORIZED} HTTP status code; passing + @code{NULL} is tolerated, in which case the result will be + @code{MHD_SC_RESP_POINTER_NULL} + +@item prefer_utf8 +if not set to @code{MHD_NO} the parameter 'charset="UTF-8"' +will be added, indicating for client that UTF-8 encoding is preferred + +@item abort_if_failed +if set to @code{MHD_NO} the response will be returned even if +MHD failed to add Basic Authentication "challenge", +if set to @code{MHD_YES} the HTTP request will be aborted +if the "challenge" could not be added. +@end table +@end deftypefun + +If the client has supplied an HTTP basic authorization header, the +application can obtain the credentials using request introspection. +@ref{MHD_REQUEST_INFO_DYNAMIC_AUTH_BASIC_CREDS,,@code{MHD_REQUEST_INFO_DYNAMIC_AUTH_BASIC_CREDS}} +can be used to obtain the credentials as a @code{struct +MHD_AuthBasicCreds}. + +@anchor{MHD_AuthBasicCreds} +@deftp {C Struct} MHD_AuthBasicCreds username password + +Information decoded from a client's header with basic authentication data. +@table @var +@item @code{struct MHD_String} username +The username; + +@item @code{struct MHD_StringNullable} password +The password, string pointer may be @code{NULL} if +the password is not properly encoded in the +transmission from the client. +@end table +@end deftp + + +@example +@verbatiminclude examples/basic-authentication.c +@end example + + + +@node libmicrohttpd-dauth digest +@section Using Digest Authentication +@cindex digest authentication + +@ref{MHD_LIB_INFO_FIXED_HAS_AUTH_DIGEST,,@code{MHD_LIB_INFO_FIXED_HAS_AUTH_DIGEST}} +can be used to detect if the MHD build includes support for HTTP digest +authorization. + + +To use HTTP digest authentication, the HTTP server must first return a +response with status @code{MHD_HTTP_STATUS_UNAUTHORIZED} asking the +client to authenticate. This is usually done @emph{after} checking +whether the client did already authenticate, which we will look at +later in this section. To challenge a client to authenticate using +HTTP digest authentication, MHD offers the +@code{MHD_response_add_auth_digest_challenge()} function which +@emph{modifies} an existing response, adding HTTP headers asking the +client to authenticate. +MHD supports various features of HTTP digest authentication, including +various hash algorithms and levels of quality of protection (qop) which +must be specified by the application when creating the challenge. + +@deftypefun {enum MHD_StatusCode} MHD_response_add_auth_digest_challenge (struct MHD_Response *response, const char *realm, const char *opaque, const char *domain, enum MHD_Bool indicate_stale, enum MHD_DigestAuthMultiQOP mqop, enum MHD_DigestAuthMultiAlgo malgo, enum MHD_Bool userhash_support, enum MHD_Bool prefer_utf8) + +Adds a digest authentication "challenge" to the response. +The @var{response} must use @code{MHD_HTTP_STATUS_UNAUTHORIZED} for its HTTP status code. + +@cindex qop +If @var{mqop} allows both RFC 2069 (@code{MHD_DIGEST_AUTH_QOP_NONE}) +and other QOP values, then the "challenge" is formed like if +@code{MHD_DIGEST_AUTH_QOP_NONE} bit was not set, because such +a "challenge" should be backwards-compatible with RFC 2069. + +If @var{mqop} allows only @code{MHD_DIGEST_AUTH_MULT_QOP_NONE}, +then the response is formed in strict accordance with RFC 2069 +(no 'qop', no 'userhash', no 'charset'). +For better compatibility with clients, it is recommended (but +not required) to set @var{domain} to @code{NULL} in this mode. + +New nonces are generated each time when the resulting response is +used. + +See RFC 7616, section 3.3 for details. + +@table @var + +@item response +the response to update; should contain the "access denied" +body; note: this function sets the "WWW Authenticate" header and +the caller should not set this header; +the response must have a @code{MHD_HTTP_STATUS_UNAUTHORIZED} HTTP status +code; a value of @code{NULL} is tolerated (the result will then be +@code{MHD_SC_RESP_POINTER_NULL}); + +@item realm +the realm presented to the client; + +@item opaque +the string for the opaque value, can be @code{NULL}, but @code{NULL} is +not recommended for better compatibility with clients; +the recommended format are string using hex or Base64 encoding; + +@item domain +an optional space-separated list of URIs for which the +same authorisation could be used, URIs can be in form +"path-absolute" (the path for the same host with initial slash) +or in form "absolute-URI" (the full path with protocol), in +any case client may assume that URI is in the same "protection +space" if it starts with any of values specified here; +could be @code{NULL} (clients typically assume that the same +credentials could be used for any URI on the same host); +this list provides information for the client only and does +not actually restrict anything on the server side; + +@item indicate_stale +if set to @code{MHD_YES} then an indication of a stale nonce +having been used in the client's request is indicated by adding +``stale=true'' to the authentication header; this +instructs the client to retry immediately with the new +nonce and the same credentials, without asking the user +for the new password; + +@item mqop +the quality of protection to use (@xref{MHD_DigestAuthMultiQOP}); + +@item algo +digest algorithm to use; if several algorithms are allowed +then one challenge for each allowed algorithm is added to the +response (@xref{MHD_DigestAuthMultiAlgo}); + +@item userhash_support +if set to @code{MHD_YES} then support of the ``userhash'' variant is +indicated, allowing the client to provide @code{hash("username:realm")} +instead of the username in clear text; +note that clients are @emph{allowed} to provide the username +in cleartext even if this parameter set to @code{MHD_YES}; +when userhash is used, the application must be ready to +identify users by provided userhash value instead of +the plaintext username; @xref{MHD_digest_auth_calc_userhash} and +@xref{MHD_digest_auth_calc_userhash_hex} + +@item prefer_utf8 +if set to @code{MHD_YES}, the parameter ``charset=UTF-8'' is +added, indicating to the client that UTF-8 encoding for +the username is preferred +@end table + +The function returns +@itemize +@item @code{MHD_SC_OK} if it succeeded +@item @code{MHD_SC_TOO_LATE} if the response has been already "frozen" (used to create an action), +@item @code{MHD_SC_RESP_HEADERS_CONFLICT} if a Basic Authentication "challenge" was already added, +@item @code{MHD_SC_RESP_POINTER_NULL} if @var{response} was set to @code{NULL}, +@item @code{MHD_SC_RESP_HTTP_CODE_NOT_SUITABLE} is response status code is wrong, +@item @code{MHD_SC_RESP_HEADER_VALUE_INVALID} if realm is zero-length or has CR or LF characters, +@item @code{MHD_SC_RESPONSE_HEADER_MEM_ALLOC_FAILED} if memory allocation failed, +@item or possibly other error codes (that could be defined in the future) on failure. +@end itemize +@end deftypefun + + +@cindex qop +@anchor{MHD_DigestAuthMultiQOP} +@deftp {Enumeration} MHD_DigestAuthMultiQOP + +Quality of protection (QOP) levels supported by the server. Values of +this enumeration can be combined with OR to create a bitmask, allowing +the server to offer multiple protection levels to the client. + +@table @code + +@item MHD_DIGEST_AUTH_MULT_QOP_INVALID +Invalid/unknown QOP. + +@item MHD_DIGEST_AUTH_MULT_QOP_NONE +No QOP parameter. +The digest authentication is to proceed as described in +the old RFC 2069 original specification. +This mode is not allowed by latest RFCs and should be used only to +communicate with clients that do not support more modern modes (with QOP +parameter). +This mode is less secure than other modes and inefficient. + +@item MHD_DIGEST_AUTH_MULT_QOP_AUTH +The 'auth' QOP type. + +@item MHD_DIGEST_AUTH_MULT_QOP_AUTH_INT +The 'auth-int' QOP type. This value is @emph{not} actually supported by MHD. +Reserved value. + +@item MHD_DIGEST_AUTH_MULT_QOP_ANY_NON_INT +The 'auth' QOP type OR the old RFC2069 (no QOP) type. +In other words: any types except 'auth-int'. +RFC2069-compatible mode is allowed, thus this value should be used only +when it is really necessary. + +@item MHD_DIGEST_AUTH_MULT_QOP_AUTH_ANY +Any 'auth' QOP type ('auth' or 'auth-int'). +Currently supported by MHD as 'auth' QOP type only. + +@end table +@end deftp + + +@cindex hash +@cindex digest +@anchor{MHD_DigestAuthMultiAlgo} +@deftp {Enumeration} MHD_DigestAuthMultiAlgo +Which digest algorithm should be used. Values of +this enumeration can be combined with OR to create a bitmask, allowing +the server to offer multiple hash functions to the client. + +@table @code + +@item MHD_DIGEST_AUTH_MULT_ALGO_INVALID +Unknown or invalid algorithm type. + +@item MHD_DIGEST_AUTH_MULT_ALGO_MD5 +The 'MD5' algorithm, non-session version. Deprecated, only use if you +have legacy clients that require it. + +@item MHD_DIGEST_AUTH_MULT_ALGO_MD5_SESSION +The 'MD5-sess' algorithm. +Not actually supported by MHD for authentication. +Reserved value. + +@item MHD_DIGEST_AUTH_MULT_ALGO_SHA256 +The 'SHA-256' algorithm, non-session version. + +@item MHD_DIGEST_AUTH_MULT_ALGO_SHA256_SESSION +The 'SHA-256-sess' algorithm. +Not supported by MHD for authentication. +Reserved value. + +@item MHD_DIGEST_AUTH_MULT_ALGO_SHA512_256 +The 'SHA-512-256' (SHA-512/256) algorithm, non-session version. + +@item MHD_DIGEST_AUTH_MULT_ALGO_SHA512_256_SESSION +The 'SHA-512-256-sess' (SHA-512/256 session) algorithm. +Not supported by MHD for authentication. +Reserved value. + +@item MHD_DIGEST_AUTH_MULT_ALGO_SHA_ANY_NON_SESSION +SHA-256 or SHA-512/256 non-session algorithm, MHD will choose +the preferred or the matching one. + +@item MHD_DIGEST_AUTH_MULT_ALGO_ANY_NON_SESSION +Any non-session algorithm, MHD will choose the preferred or +the matching one. + +@item MHD_DIGEST_AUTH_MULT_ALGO_SHA_ANY_SESSION +The SHA-256 or SHA-512/256 session algorithm. +Not supported by MHD. +Reserved value. + +@item MHD_DIGEST_AUTH_MULT_ALGO_ANY_SESSION +Any session algorithm. +Not supported by MHD. +Reserved value. + +@item MHD_DIGEST_AUTH_MULT_ALGO_MD5_ANY +The MD5 algorithm, session or non-session. +Currently supported as non-session only. + +@item MHD_DIGEST_AUTH_MULT_ALGO_SHA256_ANY +The SHA-256 algorithm, session or non-session. +Currently supported as non-session only. + +@item MHD_DIGEST_AUTH_MULT_ALGO_SHA512_256_ANY, +The SHA-512/256 algorithm, session or non-session. +Currently supported as non-session only. + +@item MHD_DIGEST_AUTH_MULT_ALGO_SHA_ANY_ANY +The SHA-256 or SHA-512/256 algorithm, session or non-session. +Currently supported as non-session only. + +@item MHD_DIGEST_AUTH_MULT_ALGO_ANY +Any algorithm. When sending a challenge to the client, +MHD will send challenges for each supported algorithms. When checking +client requests with responses to challenges, MHD will allow +the client to answer with any algorithm it supports. +@end table +@end deftp + + +@c FIXME: did not document MHD_action_digest_auth_challenge (and _p/_a variants), again not always available (depends on static inline!) +@c FIXME: not convinced we want to keep that, just looks like bloat, + +When using digest authentication with @var{userhash_support}, applications +have to compute the @var{userhash} from the @var{username} and the +@var{realm}. This can be done using @code{MHD_digest_auth_calc_userhash()}. + + + +@cindex userhash + +@anchor{MHD_digest_auth_calc_userhash} +@deftypefun {enum MHD_StatusCode} MHD_digest_auth_calc_userhash (enum MHD_DigestAuthAlgo algo, const char *username, const char *realm, size_t bin_buf_size, void *userhash_bin) + +Calculates the @var{userhash_bin} and returns it as binary data. + +The "userhash" is the hash of the string "username:realm". + +The "userhash" can be used to avoid sending username in cleartext in +a header when a client is using digest authorization. + +The userhash is not designed to hide the username in a local database or files, as the username in cleartext is still required for +the @code{MHD_digest_auth_check_digest()} function to check the response, +it can only can be used to hide the plaintext username in HTTP headers. + +This function could be used when the new username is added to a username +database to save the "userhash" alongside with the username (preferably) or +when loading list of the usernames to generate the userhash for every loaded +username (this will cause delays at the start with longer lists). + +Once "userhash" is generated it could be used to identify users by clients +with "userhash" support. + +The result of the computation may be cached and reused across requests. +@table @var + +@item algo +the hash algorithm to use for userhash calculations, @xref{MHD_DigestAuthAlgorithm}; + +@item username +the username; + +@item realm +the realm; + +@item bin_buf_size +the size of the @var{userhash_bin} buffer, must be at least +@code{#MHD_digest_get_hash_size()} bytes long; + +@item userhash_bin +the output buffer for userhash as binary data; +if this function succeeds, then this buffer will be set to +@code{MHD_digest_get_hash_size()} bytes of userhash upon return; + +@end table + +Possible return values include: +@itemize +@item @code{MHD_SC_OK} on success, +@item @code{MHD_SC_OUT_BUFF_TOO_SMALL} if @var{bin_buf_size} is too small, +@item @code{MHD_SC_HASH_FAILED} if hashing failed, or +@item @code{MHD_SC_AUTH_DIGEST_ALGO_NOT_SUPPORTED} if + the requested @var{algo} is unknown or unsupported. +@end itemize + +@end deftypefun + +Different hash algorithms can be specified for the +@var{algo} when computing the userhash. + +@cindex hash +@cindex digest +@anchor{MHD_DigestAuthAlgorithm} +@deftp {Enumeration} MHD_DigestAuthAlgorithm +Which digest algorithm should be used. + +@table @code +@item MHD_DIGEST_AUTH_ALGO_INVALID +Unknown or invalid algorithm type. Using this value will cause MHD to fail. + +@item MHD_DIGEST_AUTH_ALGO_MD5 +Use (deprecated, ancient, insecure) MD5. + +@item MHD_DIGEST_AUTH_ALGO_MD5_SESSION +Use (deprecated, ancient, insecure) MD5-sess. Not supported by MHD. + +@item MHD_DIGEST_ALG_SHA256 +Use SHA-256. + +@item MHD_DIGEST_ALG_SHA256_SESSION +Use SHA-256-sess. Not supported by MHD. + +@item MHD_DIGEST_ALG_SHA512_256 +Use SHA-512_256. + +@item MHD_DIGEST_ALG_SHA512_256_SESSION +Use SHA-512_256-sess. Not supported by MHD. + +@end table +@end deftp + +Given a @ref{MHD_DigestAuthAlgorithm,,@code{MHD_DigestAuthAlgorithm}}, +@code{MHD_digest_get_hash_size()} can be used to determine the length +of the corresponding binary hash value. + + +@deftypefun {size_t} MHD_digest_get_hash_size (enum MHD_DigestAuthAlgo algo) + +Return the digest size in bytes for the specified hash algorithm @var{algo}. + +@table @var + +@item algo +the hash algorithm to use for userhash calculations, @xref{MHD_DigestAuthAlgorithm}; +@end table +The function returns the number of bytes of a hash value of the +given @var{algo}. It returns zero if @var{algo} is invalid or +unknown. + +@end deftypefun + + +@c FIXME: MHD_digest_auth_calc_userhash_hex not yet documented, why is this one useful in a MICRO-API that is supposed to be minimal? Do we want to keep it!? + +One key advantage of using digest authentication is not only that +the password does not have to be transmitted in the clear, but +also that the application does not need to store the user's password +in cleartext. Instead, applications @emph{should} use +@code{MHD_digest_auth_calc_userdigest()} to compute a hash of +the user's credentials and only store the resulting digest. + +@cindex userdigest + +@anchor{MHD_digest_auth_calc_userdigest} +@deftypefun {enum MHD_StatusCode} MHD_digest_auth_calc_userdigest (enum MHD_DigestAuthAlgo algo, const char *username, const char *realm, const char *password, size_t bin_buf_size, void *userhash_bin) + +Calculates a userdigest and returns it as a binary data. +The "userdigest" is the hash of the "username:realm:password" string. +The "userdigest" can be used to avoid storing the password in clear text +in database/files of the application. + +This function is designed to improve security of stored credentials, +using "userdigest" does not improve security of the authentication process. + +The result can be used to store @var{username} and @var{userdigest_bin} pairs instead of +@var{username} and @var{password} pairs. +To further improve privacy, application may +store @var{username}, @var{userhash} and @var{userdigest} triplets +and enable @var{userhash_support}. + + +@table @var + +@item algo +the hash algorithm to use for userhash calculations, @xref{MHD_DigestAuthAlgorithm}; + +@item username +the username + +@item realm +the realm + +@item password +the password belonging to @var{username} + +@item bin_buf_size +the size of the @var{userdigest_bin} buffer, must be at least +@code{#MHD_digest_get_hash_size()} bytes long + +@item userdigest_bin +the output buffer for userdigest as binary data; +if this function succeeds, then this buffer will be set to +@code{MHD_digest_get_hash_size()} bytes of userhash upon return + +@end table + +Possible return values include: +@itemize +@item @code{MHD_SC_OK} on success, +@item @code{MHD_SC_OUT_BUFF_TOO_SMALL} if @var{bin_buf_size} is too small, +@item @code{MHD_SC_HASH_FAILED} if hashing failed, +@item @code{MHD_SC_AUTH_DIGEST_ALGO_NOT_SUPPORTED} if + the requested @var{algo} is unknown or unsupported. +@end itemize + +@end deftypefun + +When a client provides a digest authentication header, the application +@emph{must} first use introspection using +@ref{MHD_REQUEST_INFO_DYNAMIC_AUTH_DIGEST_INFO,,@code{MHD_REQUEST_INFO_DYNAMIC_AUTH_DIGEST_INFO}} +to determine the client's identity and algorithmic choices. +Introspection will return a @code{struct MHD_AuthDigestInfo}, or +@code{NULL} if the client did not provide a digest +authorization header. + +@c FIXME: MHD_REQUEST_INFO_DYNAMIC_AUTH_DIGEST_USERNAME is not discussed. When exactly is this necessary!? => will be removed. + +@anchor{MHD_AuthDigestInfo} +@deftp {C Struct} MHD_AuthDigestInfo + +Information decoded from a client's header with digest authentication data. +@table @var + +@item @code{enum MHD_DigestAuthAlgo} algo +The algorithm as selected by the client. +Set automatically to MD5 if not explicitly specified by client. + +@item @code{enum MHD_DigestAuthUsernameType} uname_type +The type of username used by client. +@xref{MHD_DigestAuthUsernameType} + +@item @code{struct MHD_StringNullable} username +The username as a string. +Used only if @var{uname_type} is standard or extended, always +@code{NULL} otherwise. +If extended notation is used, this string is a pct-decoded string +with charset and language tag removed (i.e. it is original username +extracted from the extended notation). +When userhash is used by the client, the string pointer is @code{NULL} and +@var{userhash_hex} and @var{userhash_bin} will be set instead. + +@item @code{struct MHD_StringNullable} userhash_hex +The userhash string. +Valid only if @var{uname_type} is userhash. +This is unqoted string without decoding of the hexadecimal +digits (as provided by the client). +@c FIXME: why do we return both the _hex and the _bin variants? Seems redundant! + +@item @code{const uint8_t *} userhash_bin +The userhash decoded to binary form. +Used only if @var{uname_type} is userhash, always @code{NULL} otherwise. +When not @code{NULL}, this points to binary sequence of @var{userhash_bin_size} bytes. +The valid size should be @code{MHD_digest_get_hash_size()} bytes. +@emph{Warning:} This buffer points to binary data, there is no zero termination! +@emph{Warning:} To avoid buffer overruns, always check the size of the data before + use, because @var{userhash_bin} can point even to zero bytes of data. + +@item @code{size_t} userhash_bin_size +The size of the data pointed by @var{userhash_bin}. +Always zero when @var{userhash_bin} is @code{NULL}. + +@item @code{struct MHD_StringNullable} opaque +The 'opaque' parameter value, as specified by client. +If not specified by client then string pointer is @code{NULL}. + +@item @code{struct MHD_StringNullable} realm +The 'realm' parameter value, as specified by client. +If not specified by client then string pointer is @code{NULL}. + +@item @code{enum MHD_DigestAuthQOP} qop +The quality of protection (qop) parameter value. + +@item @code{size_t} cnonce_len +Length of the @var{cnonce} parameter, including possible +backslash-escape characters. @var{cnonce} is used in hash +calculation. +An application may want to reject too large @var{cnonce} +values to limit CPU load. +A few kilobytes is a reasonable limit, typical values for +@var{cnonce} should just use 32-160 characters. + +@item @code{enum MHD_DigestAuthNC} nc_type +The type of the nonce count (nc) value provided in the request. +@xref{MHD_DigestAuthNC} + +@item @code{uint_fast32_t} nc +The nonce count (nc) parameter value. +Can be used by application to limit the number of nonce re-uses. If @var{nc} +is higher than application wants to allow, then "auth required" response +with ``stale=true'' could be used to force client to retry with the fresh +@var{nonce}. +Set to zero when @var{nc_type} is not set to +@code{MHD_DIGEST_AUTH_NC_NUMBER}. + +@end table +@end deftp + +The type of client nonce provided by the client is represented +by an @code{enum MHD_DigestAuthNC}. + +@anchor{MHD_DigestAuthNC} +@deftp {Enumeration} MHD_DigestAuthNC + +The type of nonce count (nc) value provided in the request. + +@table @code + +@item MHD_DIGEST_AUTH_NC_NUMBER +Readable hexdecimal non-zero number. +The decoded value is placed in the @var{nc} member of +@ref{MHD_AuthDigestInfo,,@code{MHD_AuthDigestInfo}}. + +@code MHD_DIGEST_AUTH_NC_ZERO +Readable zero number. +Compliant clients should not use such values. +Should probably be treated as an invalid request. + +@code MHD_DIGEST_AUTH_NC_NONE +No @var{nc} value was provided by the client. +Unless old RFC 2069 mode is allowed, this should be treated as an invalid +request. + +@code MHD_DIGEST_AUTH_NC_TOO_LONG +The provided ``nc'' value was too long to be decoded. +Compliant clients should not use such values. +Should be treated as an invalid request. + +@code MHD_DIGEST_AUTH_NC_TOO_LARGE +The provided ``nc'' value was too large to fit into a @code{uint32_t}. +Compliant clients should not use such values. +Can be treated as request with a stale nonce or as an invalid request. + +@end table +@end deftp + +@c FIXME: MHD_DigestAuthUsernameType not defined + +Finally, given the client's identity (username or userhash) the +application must possibly determine the username from the userhash, +and always determine the userdigest. Given the @var{username} and +@var{userdigest} and the set of algorithms allowed by the application, +it can can use @code{MHD_digest_auth_check_digest()} to actually check +the digest authentication provided by the client's request. + +@anchor{MHD_digest_auth_check_digest} +@deftypefun {enum MHD_DigestAuthResult} MHD_digest_auth_check_digest (struct MHD_Request *request, const char *realm, const char *username, size_t userdigest_size, const void *userdigest, uint_fast32_t max_nc, enum MHD_DigestAuthMultiQOP mqop, enum MHD_DigestAuthMultiAlgo malgo) + +@cindex userdigest +Authenticates the authorization header sent by the client by using +hash of "username:realm:password". + +If RFC2069 mode is allowed by setting bit @code{MHD_DIGEST_AUTH_QOP_NONE} in +@var{mqop} and the client uses this mode, then server generated nonces are +used as one-time nonces because nonce-count is not supported in this old RFC. +Communication in this mode is very inefficient, especially if the client +requests several resources one-by-one as for every request a new nonce must +be generated and client repeats all requests twice (first time to get a new +nonce and second time to perform an authorised request). + +@table @var +@item request +the request; + +@item realm +the realm for authorization of the client; + +@item username +the username to be authenticated, must be in clear text +even if userhash is used by the client; + +@item userdigest_size +the size of the @var{userdigest} in bytes, must match the +hashing algorithm; + +@item userdigest +the precalculated binary hash of the string +"username:realm:password", +@xref{MHD_digest_auth_calc_userdigest,,@code{MHD_digest_auth_calc_userdigest}}; + +@item max_nc +the maximum allowed nonce counter (nc) value, if a client's nc +exceeds the specified value then @code{MHD_DAUTH_NONCE_STALE} is +returned; if zero is specified the daemon's default value is used; + +@item mqop +the quality of protection (QOP) level to use; + +@item malgo +digest algorithms allowed to use, authentication will fail if +the algorithm used by the client is not allowed by this parameter; +only the base algorithms (MD5, SHA-256, SHA-512/256) +cannot be used at the same time for this function +as the @var{userdigest} must match specified algorithm; + +@end table + +The function returns the result of the authentication check. +@xref{MHD_DigestAuthResult}. + +@end deftypefun + +@anchor{MHD_DigestAuthResult} +@deftp {Enumeration} MHD_DigestAuthResult + +The result of digest authentication of the client. + +@table @code +@item MHD_DAUTH_OK +Authentication is OK; + +@item MHD_DAUTH_ERROR +General error, like ``out of memory''; +Authentication may be valid, but cannot be checked; + +@item MHD_DAUTH_HEADER_MISSING +No "Authorization" header for digest authentication +is present in the client's request. + +@item MHD_DAUTH_HEADER_BROKEN +Header is in a wrong format. +Also returned if required parameters in Authorization header are missing +or broken. + +@item MHD_DAUTH_UNSUPPORTED_ALGO +Unsupported algorithm used by the client. + +@item MHD_DAUTH_UNSUPPORTED_QOP +Unsupported quality of protection (qop) level used by the client. + +@item MHD_DAUTH_INVALID_USERDIGEST_SIZE +Incorrect userdigest size used by the client. + +@item MHD_DAUTH_WRONG_USERNAME +Wrong 'username'. + +@item MHD_DAUTH_WRONG_REALM +Wrong 'realm'. + +@item MHD_DAUTH_WRONG_URI +Wrong 'URI' (or URI parameters). + +@item MHD_DAUTH_WRONG_QOP +'qop' value specified by the client is not in the set of values +allowed by the specification or the server disallowed the use of +the given 'qop' mode. + +@item MHD_DAUTH_WRONG_ALGO +The (hash) algorithm value specified by the client is not in the set of values +allowed by the specification or the server disallowed the use of +the given hash function mode. + +@item MHD_DAUTH_TOO_LARGE +Too large (larger than 64 KiB) ``Authorization'' parameter value. + +@item MHD_DAUTH_NONCE_STALE +The 'nonce' is too old. Suggest the client to retry with the same +username and password to get the fresh 'nonce'. +The validity of the 'nonce' may be not checked. + +@item MHD_DAUTH_NONCE_WRONG +The 'nonce' is wrong. May indicate an attempted attack. + +@item MHD_DAUTH_RESPONSE_WRONG +The 'response' is wrong. May indicate using the wrong password. + +@end table +@end deftp + +@c FIXME: we should probably add an example here... +\ No newline at end of file diff --git a/doc/manual/callbacks.inc b/doc/manual/callbacks.inc @@ -0,0 +1,258 @@ + +@deftypefn {Function Pointer} enum MHD_Result {*MHD_AcceptPolicyCallback} (void *cls, const struct sockaddr * addr, socklen_t addrlen) +Invoked in the context of a connection to allow or deny a client to +connect. This callback return @code{MHD_YES} if connection is allowed, +@code{MHD_NO} if not. + +@table @var +@item cls +custom value selected at callback registration time; +@item addr +address information from the client; +@item addrlen +length of the address information. +@end table +@end deftypefn + + + +@deftypefn {Function Pointer} void {*MHD_RequestCompletedCallback} (void *cls, struct MHD_Connectionconnection, void **req_cls, enum MHD_RequestTerminationCode toe) +Signature of the callback used by MHD to notify the application about +completed requests. + +@table @var +@item cls +custom value selected at callback registration time; + +@item connection +connection handle; + +@item req_cls +value as set by the last call to the +@code{MHD_AccessHandlerCallback}; + +@item toe +reason for request termination see @code{MHD_OPTION_NOTIFY_COMPLETED}. +@end table +@end deftypefn + + +@deftypefn {Function Pointer} enum MHD_Result {*MHD_KeyValueIterator} (void *cls, enum MHD_ValueKind kind, const char *key, const char *value, size_t value_size) +Iterator over key-value pairs. This iterator can be used to iterate +over all of the cookies, headers, or @code{POST}-data fields of a +request, and also to iterate over the headers that have been added to a +response. + +@table @var +@item cls +custom value specified when iteration was triggered; + +@item kind +kind of the header we are looking at + +@item key +key for the value, can be an empty string + +@item value +value corresponding value, can be NULL + +@item value_size +number of bytes in @code{value}. This argument was introduced in +@code{MHD_VERSION} 0x00096301 to allow applications to use binary +zeros in values. Applications using this argument must ensure that +they are using a sufficiently recent version of MHD, i.e. by testing +@code{MHD_get_version()} for values above or equal to 0.9.64. +Applications that do not need zeros in values and that want to compile +without warnings against newer versions of MHD should not declare this +argument and cast the function pointer argument to +@code{MHD_KeyValueIterator}. + +@end table + +Return @code{MHD_YES} to continue iterating, @code{MHD_NO} to abort the +iteration. +@end deftypefn + + +@deftypefn {Function Pointer} ssize_t {*MHD_ContentReaderCallback} (void *cls, uint64_t pos, char *buf, size_t max) +Callback used by MHD in order to obtain content. The callback has to +copy at most @var{max} bytes of content into @var{buf}. The total +number of bytes that has been placed into @var{buf} should be returned. + +Note that returning zero will cause MHD to try again. +Thus, returning zero should only be used in conjunction +with @code{MHD_suspend_connection()} to avoid busy waiting. + +While usually the callback simply returns the number of bytes written +into @var{buf}, there are two special return value: + +@code{MHD_CONTENT_READER_END_OF_STREAM} (-1) should be returned +for the regular end of transmission (with chunked encoding, MHD will then +terminate the chunk and send any HTTP footers that might be +present; without chunked encoding and given an unknown +response size, MHD will simply close the connection; note +that while returning @code{MHD_CONTENT_READER_END_OF_STREAM} is not technically +legal if a response size was specified, MHD accepts this +and treats it just as @code{MHD_CONTENT_READER_END_WITH_ERROR}. + +@code{MHD_CONTENT_READER_END_WITH_ERROR} (-2) is used to indicate a server +error generating the response; this will cause MHD to simply +close the connection immediately. If a response size was +given or if chunked encoding is in use, this will indicate +an error to the client. Note, however, that if the client +does not know a response size and chunked encoding is not in +use, then clients will not be able to tell the difference between +@code{MHD_CONTENT_READER_END_WITH_ERROR} and +@code{MHD_CONTENT_READER_END_OF_STREAM}. +This is not a limitation of MHD but rather of the HTTP protocol. + +@table @var +@item cls +custom value selected at callback registration time; + +@item pos +position in the datastream to access; note that if an +@code{MHD_Response} object is re-used, it is possible for the same +content reader to be queried multiple times for the same data; however, +if an @code{MHD_Response} is not re-used, MHD guarantees that +@var{pos} will be the sum of all non-negative return values obtained +from the content reader so far. +@end table + +Return @code{-1} on error (MHD will no longer try to read content and +instead close the connection with the client). +@end deftypefn + + +@deftypefn {Function Pointer} void {*MHD_ContentReaderFreeCallback} (void *cls) +This method is called by MHD if we are done with a content reader. +It should be used to free resources associated with the content reader. +@end deftypefn + + +@deftypefn {Function Pointer} enum MHD_Result {*MHD_PostDataIterator} (void *cls, enum MHD_ValueKind kind, const char *key, const char *filename, const char *content_type, const char *transfer_encoding, const char *data, uint64_t off, size_t size) +Iterator over key-value pairs where the value maybe made available in +increments and/or may not be zero-terminated. Used for processing +@code{POST} data. + +@table @var +@item cls +custom value selected at callback registration time; + +@item kind +type of the value; + +@item key +zero-terminated key for the value; + +@item filename +name of the uploaded file, @code{NULL} if not known; + +@item content_type +mime-type of the data, @code{NULL} if not known; + +@item transfer_encoding +encoding of the data, @code{NULL} if not known; + +@item data +pointer to size bytes of data at the specified offset; + +@item off +offset of data in the overall value; + +@item size +number of bytes in data available. +@end table + +Return @code{MHD_YES} to continue iterating, @code{MHD_NO} to abort the +iteration. +@end deftypefn + + +@deftypefn {Function Pointer} void* {*MHD_WebSocketMallocCallback} (size_t buf_len) +@cindex websocket +This callback function is used internally by many websocket functions +for allocating data. +By default @code{malloc} is used. +You can use your own allocation function with @code{MHD_websocket_stream_init2} +if you wish to. +This can be useful for operating systems like Windows +where @code{malloc}, @code{realloc} and @code{free} are compiler-dependent. +You can call the associated @code{malloc} callback of +a websocket stream with @code{MHD_websocket_malloc}. + +@table @var +@item buf_len +size of the buffer to allocate in bytes. +@end table + +Return the pointer of the allocated buffer or @code{NULL} on failure. +@end deftypefn + + +@deftypefn {Function Pointer} void* {*MHD_WebSocketReallocCallback} (void *buf, size_t new_buf_len) +@cindex websocket +This callback function is used internally by many websocket +functions for reallocating data. +By default @code{realloc} is used. +You can use your own reallocation function with +@code{MHD_websocket_stream_init2} if you wish to. +This can be useful for operating systems like Windows +where @code{malloc}, @code{realloc} and @code{free} are compiler-dependent. +You can call the associated @code{realloc} callback of +a websocket stream with @code{MHD_websocket_realloc}. + +@table @var +@item buf +current buffer, may be @code{NULL}; + +@item new_buf_len +new size of the buffer in bytes. +@end table + +Return the pointer of the reallocated buffer or @code{NULL} on failure. +On failure the old pointer must remain valid. +@end deftypefn + + +@deftypefn {Function Pointer} void {*MHD_WebSocketFreeCallback} (void *buf) +@cindex websocket +This callback function is used internally by many websocket +functions for freeing data. +By default @code{free} is used. +You can use your own free function with +@code{MHD_websocket_stream_init2} if you wish to. +This can be useful for operating systems like Windows +where @code{malloc}, @code{realloc} and @code{free} are compiler-dependent. +You can call the associated @code{free} callback of +a websocket stream with @code{MHD_websocket_free}. + +@table @var +@item cls +current buffer to free, this may be @code{NULL} then nothing happens. +@end table +@end deftypefn + + +@deftypefn {Function Pointer} size_t {*MHD_WebSocketRandomNumberGenerator} (void *cls, void* buf, size_t buf_len) +@cindex websocket +This callback function is used for generating random numbers +for masking payload data in client mode. +If you use websockets in server mode with @emph{libmicrohttpd} then +you don't need a random number generator, because +the server doesn't mask its outgoing messages. +However if you wish to use a websocket stream in client mode, +you must pass this callback function to @code{MHD_websocket_stream_init2}. + +@table @var +@item cls +closure specified in @code{MHD_websocket_stream_init2}; +@item buf +buffer to fill with random values; +@item buf_len +size of buffer in bytes. +@end table + +Return the number of generated random bytes. +The return value should usually equal to buf_len. +@end deftypefn diff --git a/doc/manual/daemon_options.inc b/doc/manual/daemon_options.inc @@ -0,0 +1,1317 @@ +@node libmicrohttpd-daemon-workmode +@section Configuring the work mode + +The work mode option determines how MHD should process connections +concurrently. The work mode is set by providing a @code{struct +MHD_WorkModeWithParam} that includes the various configuration +settings for the work mode. While @code{MHD_D_OPTION_WORK_MODE} can in +principle be used to set the work mode, the MHD API offers various +convenience APIs for each of the work modes. + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_WORK_MODE (struct MHD_WorkModeWithParam wmp) + +Set MHD work (threading and polling) mode. +Consider use of @code{MHD_D_OPTION_WM_EXTERNAL_PERIODIC()}, +@code{MHD_D_OPTION_WM_EXTERNAL_EVENT_LOOP_CB_LEVEL()}, +@code{MHD_D_OPTION_WM_EXTERNAL_EVENT_LOOP_CB_EDGE()}, +@code{MHD_D_OPTION_WM_EXTERNAL_SINGLE_FD_WATCH()}, +@code{MHD_D_OPTION_WM_WORKER_THREADS()} or +@code{MHD_D_OPTION_WM_THREAD_PER_CONNECTION()} +instead of direct use of this option. + +@table @var + +@item wmp +the work mode setting, to be created by either @code{MHD_WM_OPTION_EXTERNAL_PERIODIC()}, @code{MHD_WM_OPTION_EXTERNAL_EVENT_LOOP_CB_LEVEL()}, @code{MHD_WM_OPTION_EXTERNAL_EVENT_LOOP_CB_EDGE()}, @code{MHD_WM_OPTION_EXTERNAL_SINGLE_FD_WATCH()}, @code{MHD_WM_OPTION_WORKER_THREADS()}, or @code{MHD_WM_OPTION_THREAD_PER_CONNECTION()}. + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + +As explained, the usual way to set the work mode is to use one of +the following convenience APIs instead of using +@code{MHD_D_OPTION_WORK_MODE()} directly. We will thus describe +each work mode together with the option used to set it. + +@node libmicrohttpd-daemon-workmode-external-periodic +@subsection External periodic + +In this mode, the application must periodical call +@code{MHD_daemon_process_blocking()}, where MHD internally checks all +sockets automatically. This is the default mode. It is the simplest +to use, but also inefficient as it requires busy-waiting by the +application. + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_WM_EXTERNAL_PERIODIC() + +Create parameter for @code{MHD_daemon_set_options()} for work mode with +no internal threads and no support for event loops. +Returns an object of type @code{struct MHD_DaemonOptionAndValue} +with the requested settings. + +@end deftypefun + +When using this mode, it is critical that the application +frequently calls @code{MHD_daemon_process_blocking()}. + +@anchor{MHD_daemon_process_blocking} +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_daemon_process_blocking (struct MHD_Daemon *daemon, uint_fast64_t microsec) + +Run the websever operation with possible blocking. + +Supported only in @code{MHD_WM_EXTERNAL_PERIODIC} mode. + +This function does the following: waits for any network event not more +than specified number of microseconds, processes all incoming and +outgoing data, processes new connections, processes any timed-out +connection, and does other things required to run the webserver. Once all +connections are processed, the function returns. + +This function is useful for quick and simple (lazy) webserver +implementation if an application needs to run only a single thread and +does not even have an event loop. + +@table @var + +@item daemon +the daemon to run + +@item microsec +the maximum time in microseconds to wait for network and other +events. Theere is no guarantee that function blocks for the specified +amount of time. The real processing time can be shorter (if some data +or connection timeout comes earlier) or longer (if data processing +requires more time, especially in user callbacks). If set to '0' then +function does not block and processes only already available data (if +any). If set to @code{MHD_WAIT_INDEFINITELY}, this function waits for +events indefinitely (blocks until next network activity or connection +timeout). + +@end table + +Returns @code{MHD_SC_OK} on success, otherwise an error code. +@end deftypefun + + + + +@node libmicrohttpd-daemon-workmode-external-event-loop +@subsection External event loop + +In this mode, the application must provide a callback to +MHD where MHD will inform the application about network events +it cares about. The application must then call +@ref{MHD_daemon_event_update,,@code{MHD_daemon_event_update()}} +and @ref{MHD_daemon_process_nonblocking,,@code{MHD_daemon_process_nonblocking()}} +to drive MHD's network interaction. + +@anchor{MHD_D_OPTION_WM_EXTERNAL_EVENT_LOOP_CB_LEVEL} +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_WM_EXTERNAL_EVENT_LOOP_CB_LEVEL(MHD_SocketRegistrationUpdateCallback cb_val, void *cb_cls_val) + +Create parameter for @code{MHD_daemon_set_options()} for work mode with +an external event loop with level triggers. + +@table @var + +@item cb_val +callback implemented by the application to learn about MHD's needs; + +@item cb_cls_val +closure argument for @var{cb_val}; + +@end table + +Returns an object of type @code{struct MHD_DaemonOptionAndValue} +with the requested settings. + +@end deftypefun + +@anchor{MHD_D_OPTION_WM_EXTERNAL_EVENT_LOOP_CB_EDGE} +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_WM_EXTERNAL_EVENT_LOOP_CB_EDGE(MHD_SocketRegistrationUpdateCallback cb_val, void *cb_cls_val) + +Create parameter for @code{MHD_daemon_set_options()} for work mode with +an external event loop with edge triggers. + +@table @var + +@item cb_val +callback implemented by the application to learn about MHD's needs; + +@item cb_cls_val +closure argument for @var{cb_val}; + +@end table + +Returns an object of type @code{struct MHD_DaemonOptionAndValue} +with the requested settings. + +@end deftypefun + +How to use an external event loop is described in detail +in another chapter of this manual. +@xref{libmicrohttpd2-external,,Using external event loops}. + + +@node libmicrohttpd-daemon-workmode-external-single-fd +@subsection External single FD watch + + +@anchor{MHD_D_OPTION_WM_EXTERNAL_SINGLE_FD_WATCH} +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_WM_EXTERNAL_SINGLE_FD_WATCH() + +Create parameter for @code{MHD_daemon_set_options()} to create a work +mode with no internal threads and an aggregate watch file descriptor (FD). +When using this setting, applications @emph{must} use +@ref{MHD_DAEMON_INFO_FIXED_AGGREGATE_FD,,@code{MHD_DAEMON_INFO_FIXED_AGGREGATE_FD}} +to get the single FD that gets triggered by any MHD event. This FD can +be watched as an aggregate indicator for all MHD events. This mode is +available only on selected platforms (currently GNU/Linux +only). @xref{MHD_LIB_INFO_FIXED_HAS_AGGREGATE_FD,,@code{MHD_LIB_INFO_FIXED_HAS_AGGREGATE_FD}}. When the FD is +triggered, @code{MHD_daemon_process_nonblocking()} should be called as +soon as possible by the application. + +Returns an object of type @code{struct MHD_DaemonOptionAndValue} +with the requested settings. +@end deftypefun + +@anchor{MHD_daemon_process_nonblocking} +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_daemon_process_nonblocking (struct MHD_Daemon *daemon) + +Run the websever operation without blocking. + +Supported only in @code{MHD_WM_EXTERNAL_SINGLE_FD_WATCH} mode. + +This function does the following: checks for any network events that +are ready, processes all incoming and outgoing data, processes new +connections, processes any timed-out connection, and does other things +required to run the webserver. Once all network events have been +processed, the function immediately returns. + +@table @var + +@item daemon +the daemon to run; + +@end table + +Returns @code{MHD_SC_OK} on success, otherwise an error code. +@end deftypefun + + + +@node libmicrohttpd-daemon-workmode-worker-threads +@subsection Worker threads + + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_WM_WORKER_THREADS(unsigned int num_workers) + +Create parameter for @code{MHD_daemon_set_options()} for work mode +with @var{num_workers} internal worker threads that each listen for +incoming connections and handle multiple clients. If number of +threads is one, then daemon starts with single worker thread that +handles all connections. If number of threads is larger than one, +then handling of connections is distributed among the workers. + + +@table @var + +@item num_workers +the number of worker threads, zero is treated as one; + +@end table + +Returns an object of type @code{struct MHD_DaemonOptionAndValue} +with the requested settings. + +@end deftypefun + +@node libmicrohttpd-daemon-workmode-thread-per-connection +@subsection Thread per connection + + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_WM_THREAD_PER_CONNECTION() + +Create parameter for @code{MHD_daemon_set_options()} for work mode +one internal thread for listening, and additional internal threads per +connection. Use this if handling requests is CPU-intensive or blocking, +our application is thread-safe and you have plenty of memory (per +connection) as each thread requires its own stack. +Applications using this mode should strongly consider using +@ref{MHD_D_OPTION_GLOBAL_CONNECTION_LIMIT,,@code{MHD_D_OPTION_GLOBAL_CONNECTION_LIMIT}}. + +Returns an object of type @code{struct MHD_DaemonOptionAndValue} +with the requested settings. + +@end deftypefun + + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_POLL_SYSCALL (enum MHD_SockPollSyscall els) + +Select a sockets watch system call to be used for internal polling. + +@table @var + +@item els +mode to use; @code{MHD_SPS_AUTO} is the default if this +option is not set. @xref{MHD_SockPollSyscall} + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()} +@end deftypefun + +@anchor{MHD_SockPollSyscall} +@deftp {Enumeration} MHD_SockPollSyscall + +Possible ways for sockets polling for internal syscalls. + +@table @code + +@item MHD_SPS_AUTO +Automatic selection of the best-available method. This is also the +default. + +@item MHD_SPS_SELECT +Force use of @code{select()}. + +@item MHD_SPS_POLL +Force use of @code{poll()}. + +@item MHD_SPS_EPOLL +Force use of @code{epoll()}. +@end table +@end deftp + + +@node libmicrohttpd-daemon-logging +@section Configuring logging and notifications + +Options in this section allow an application to receive notifications +from MHD whenever the library's logic reaches a particular stage. This +includes general logging, but also daemons, connecitons or requests +reaching a particular stage of their respective lifecycle. + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_LOG_CALLBACK (MHD_LoggingCallback log_cb, void *log_cb_cls) + +Set a callback to use for logging. + +@table @var + +@item log_cb +the callback to use for logging, +@code{NULL} to disable logging. +Logging to @code{stderr} is enabled by default; + +@item log_cb_cls +the closure for the logging callback; + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_EARLY_URI_LOGGER (MHD_EarlyUriLogCallback cb, void *cb_cls) + +Set a callback to be called first for every request when the request line is received (before any parsing of the header). +This callback is the only way to get raw (unmodified) request URI as URI is parsed and modified by MHD in-place. +Mandatory URI modification may apply before this call, like binary zero replacement, as required by RFCs. + +@table @var + +@item cb +the early URI callback; + +@item cb_cls +the closure for the callback; + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + + +@anchor{MHD_EarlyUriLogCallback} +@deftypefn {Function Pointer} void (*MHD_EarlyUriLogCallback) (void *cls, const struct MHD_EarlyUriCbData *req_data, void **request_app_context_ptr) + +Function called by MHD to allow the application to log the full URI of any new request. +This is the only moment when unmodified URI is provided. +After this callback MHD parses the URI and modifies it by extracting +URL arguments in-place. + +If this callback is set then it is the first application function called +for every new request. + +If a @ref{MHD_RequestEndedCallback} is also set then it is guaranteed +that @ref{MHD_RequestEndedCallback} is called for the same request +eventually. Application may allocate request specific data in this +callback and de-allocate the data in @ref{MHD_RequestEndedCallback}. + +@table @var +@item cls +custom value provided by the application at callback registration time; + +@item req_data +data about the client's request; + +@item request_app_contex_ptr +pointer to a location that can be set to +an application context for the request; +initially the location is guaranteed to +point to @code{NULL}; + +@end table +@end deftypefn + +The @var{req_data} provides the following information +about the request: + + +@anchor{MHD_EarlyUriCbData} +@deftp {C Struct} struct MHD_EarlyUriCbData + +Data for @ref{MHD_EarlyUriLogCallback}s. + +@table @var + +@item @code{struct MHD_Request *} request +The request handle. +Headers will not yet be available. + +@item @code{struct MHD_String} full_uri +The full URI ("request target") from the HTTP request, including URI parameters (the part after '?'). + +@item @code{enum MHD_HTTP_Method} method +The HTTP method of the request; + +@end table +@end deftp + + + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_DAEMON_READY_CALLBACK (MHD_DaemonReadyCallback cb, void *cb_cls) + +Set a callback to be called for pre-start finalisation. + +The specified callback will be called one time, after network initialisation, TLS pre-initialisation, but before the start of the internal threads (if allowed) + +@table @var + +@item cb +the pre-start callback; + +@item cb_cls +the closure for the callback; + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + +@anchor{MHD_DaemonReadyCallback} +@deftypefn {Function Pointer} void (*MHD_DaemonReadyCallback) (void *cls) + +The specified callback will be called one time, +after network initialisation, TLS pre-initialisation, but before +the start of the internal threads (if we have any). + +This callback may use introspection call to retrieve and adjust some +of the daemon's aspects. For example, the TLS backend handle could be +obtained via introspection and used to configure some additional +TLS-backend specific settings. + +@table @var +@item cls +custom value provided by the application at callback registration time; + +@end table + +@end deftypefn + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_NOTIFY_CONNECTION (MHD_NotifyConnectionCallback ncc, void *ncc_cls) + +Set a function that should be called whenever a connection is started or closed. + +@table @var + +@item ncc +the callback for notifications; + +@item cls +the closure for the callback; + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + + +@anchor{MHD_NotifyConnectionCallback} +@deftypefn {Function Pointer} void (*MHD_NotifyConnectionCallback) (void *cls, struct MHD_ConnectionNotificationData *data) +@c FIXME: why is 'data' not const? +@c FIXME: non-uniform: for requests, we have the +@c application context in the argument, here we have it +@c inside of data; not nice! + + +@table @var +@item cls +custom value provided by the application at callback registration time; + +@item data +details about the connection; + +@end table + +@end deftypefn + +@c FIXME: elaborate on MHD_ConnectionNotificationData +@c FIXME: but only after we revised it! + +@c FIXME: elaborate on MHD_ConnectionNotificationCode + +@anchor{MHD_ConnectionNotificationDetails} +@deftp {C Union} struct MHD_ConnectionNotificationDetails + +@var{code}-specific details on how a request ended. +So far not used, only a placeholder. + +@table @var + +@item @code{void *} reserved +Placeholder. Do not used. + +@end table +@end deftp + + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_NOTIFY_STREAM (MHD_NotifyStreamCallback nsc, void *nsc_cls) + +Register a function that should be called whenever a stream is started or closed. +For HTTP/1.1 this callback is called one time for every connection. + +@table @var + +@item nsc +the callback for notifications; + +@item nsc_cls +the closure for the callback; + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + + +@anchor{MHD_NotifyStreamCallback} +@deftypefn {Function Pointer} void (*MHD_NotifyStreamCallback) (void *cls, const struct MHD_StreamNotificationData *data) +@c FIXME: non-uniform: for requests and connections, we have an +@c application context in the argument, here have none! + + +@table @var +@item cls +custom value provided by the application at callback registration time; + +@item data +details about the stream; + +@end table + +@end deftypefn + + +@anchor{MHD_StreamNotificationData} +@deftp {C Struct} struct MHD_StreamNotificationData + +Data for functions of type @ref{MHD_NotifyStreamCallback}. + +@table @var + +@item @code{struct MHD_Stream *} stream +The stream handle; + +@item @code{enum MHD_StreamNotificationCode} code +The code of the event; + +@item @code{union MHD_StreamNotificationDetail} details +Detailed information about the event the notification is about; + +@end table +@end deftp + + +@anchor{MHD_StreamNotificationCode} +@deftp {Enumeration} MHD_StreamNotificationCode + +Type of stream notifications. + +@table @code + +@c FIXME: rename to OPENED? more symmetric! +@item MHD_STREAM_NOTIFY_STARTED +A new stream has been started. + +@item MHD_STREAM_NOTIFY_CLOSED +A stream is being closed. + +@end table +@end deftp + +@c FIXME: ealborate on MHD_StreamNotificationDetail +@c FIXME: strongly consider inlining the started structure... + + +@node libmicrohttpd-daemon-listen +@section Configuring the listen socket + +The options in this section determine how MHD will listen +for incoming connections. MHD can either be told to +open its own listen socket (in which case the application +must specify the address family and port, or the complete +socket address), or MHD can be given a listen socket that +is already pre-configured (for example, if systemd socket +activation is used). It is even possible to run MHD without +a listen socket, and only give it the (already accepted) +connections from clients. Note that these are mutually +exclusive choices, as a single daemon only ever uses a +single listen socket. + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_BIND_PORT (enum MHD_AddressFamily af, uint_least16_t port) + +Bind to the given TCP port and address family. + +Does not work with @code{MHD_D_OPTION_BIND_SA()} or +@code{MHD_D_OPTION_LISTEN_SOCKET()}. + +If no listen socket options (@code{MHD_D_OPTION_BIND_PORT()}, @code{MHD_D_OPTION_BIND_SA()}, or @code{MHD_D_OPTION_LISTEN_SOCKET()}) are used, MHD does not listen for incoming connections. + +@table @var + +@item af +the address family to use, +Use the special @code{MHD_AF_NONE} to disable the listen socket (the same effect as if this option is not used). + +@item port +port to use, 0 to let system assign any free port, +ignored if @var{af} is @code{MHD_AF_NONE} + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + +@deftp {Enumeration} MHD_AddressFamily + +Address family to be used by MHD. + +@table @code + +@item MHD_AF_NONE +Option not given. Do not listen at all +(unless listen socket or address specified by +other means). + +@item MHD_AF_AUTO +Pick "best" available method automatically. + +@item MHD_AF_INET4 +Use IPv4 only. + +@item MHD_AF_INET6 +Use IPv6 only. + +@item MHD_AF_DUAL +Use dual stack (IPv4 and IPv6 on the same socket). + +@item MHD_AF_DUAL_v4_OPTIONAL +Use dual stack (IPv4 and IPv6 on the same socket), +fallback to pure IPv6 if dual stack is not possible. + +@item MHD_AF_DUAL_v6_OPTIONAL +Use dual stack (IPv4 and IPv6 on the same socket), +fallback to pure IPv4 if dual stack is not possible. + +@end table +@end deftp + + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_BIND_SA (size_t sa_len, const struct sockaddr *sa, enum MHD_Bool dual) + +Bind to the given socket address. + +Does not work in combination with @code{MHD_D_OPTION_BIND_PORT()} or @code{MHD_D_OPTION_LISTEN_SOCKET()}. + +If no listen socket options (@code{MHD_D_OPTION_BIND_PORT()}, @code{MHD_D_OPTION_BIND_SA()}, or @code{MHD_D_OPTION_LISTEN_SOCKET()}) are used, MHD does not listen for incoming connections. + +@table @var + +@item sa_len +the size of the socket address pointed by @var{sa}. + +@item sa +the address to bind to; can be IPv4 (AF_INET), IPv6 (AF_INET6) or even a UNIX domain socket (AF_UNIX) + +@item dual +When a previous version of the protocol exists (like IPv4 when @var{v_sa} is IPv6) bind to both protocols (IPv6 and IPv4). + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_LISTEN_SOCKET (MHD_Socket listen_fd) + +Accept connections from the given socket. Socket +must be a TCP or UNIX domain (SOCK_STREAM) socket. + +Does not work in combination with @code{MHD_D_OPTION_BIND_PORT()} or +@code{MHD_D_OPTION_BIND_SA()}. + +If no listen socket options (@code{MHD_D_OPTION_BIND_PORT()}, @code{MHD_D_OPTION_BIND_SA()}, or @code{MHD_D_OPTION_LISTEN_SOCKET()}) are used, MHD does not listen for incoming connections. + +@table @var + +@item listen_fd +the listen socket to use, ignored if set to @code{MHD_INVALID_SOCKET}. + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_LISTEN_ADDR_REUSE (enum MHD_DaemonOptionBindType reuse_type) + +Select mode of reusing address:port listen address. + +Works only when @code{MHD_D_OPTION_BIND_PORT()} or +@code{MHD_D_OPTION_BIND_SA()} are also used. + +@table @var + +@item reuse_type +address reuse options to use + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + +@anchor{MHD_DaemonOptionBindType} +@deftp {Enumeration} MHD_DaemonOptionBindType + +Parameter for listen socket binding type. Determines what should +happen if multiple processes try to bind to the same port. + +@table @code + +@item MHD_D_OPTION_BIND_TYPE_SHARED +The listen socket binds to the networks address with sharing the address. +Several sockets can bind to the same address. + +@item MHD_D_OPTION_BIND_TYPE_NOT_SHARED +The listen socket binds to the networks address without sharing the +address, except allowing binding to port/address which is only in +TIME_WAIT state (the state after closing connection). On some +platforms it may also allow to bind to specific address if other +socket already bound to the same port of wildcard address (or bind to +wildcard address when other socket already bond to specific address +with the same port). Typically achieved by enabling the +@code{SO_REUSEADDR} socket option. This is the default. + +@item MHD_D_OPTION_BIND_TYPE_NOT_SHARED_STRICTER +The listen socket binds to the networks address without sharing the +address. The daemon way fail to start when any sockets still in +TIME_WAIT state on the same port, which effectively prevents quick +restart of the daemon on the same port. On W32 systems this option +works like @code{MHD_D_OPTION_BIND_TYPE_NOT_SHARED} due to OS +limitations. + +@item MHD_D_OPTION_BIND_TYPE_EXCLUSIVE +The list socket binds to the networks address in explicit exclusive +mode. Works as @code{MHD_D_OPTION_BIND_TYPE_NOT_SHARED_STRICTER} on +platforms without support for the explicit exclusive socket use. + +@end table +@end deftp + + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_TCP_FASTOPEN (enum MHD_TCPFastOpenType option, unsigned int queue_length) + +Configure TCP_FASTOPEN option, including setting a +custom @var{queue_length}. + +Note that having a larger queue size can cause resource exhaustion +attack as the TCP stack has to now allocate resources for the SYN +packet along with its DATA. + +Works only in combination with @code{MHD_D_OPTION_BIND_PORT()} or @code{MHD_D_OPTION_BIND_SA()}. + +@table @var + +@item option +the type use of of TCP FastOpen; @xref{MHD_TCPFastOpenType} + +@item queue_length +the length of the queue, zero to use system or MHD default, +silently ignored on platforms without support for custom queue size. + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + + +@anchor{MHD_TCPFastOpenType} +@deftp {Enumeration} MHD_TCPFastOpenType + +Possible levels of support or enforcement for TCP_FASTOPEN. + +@table @code +@item MHD_FOM_DISABLE +Disable use of TCP_FASTOPEN. + +@item MHD_FOM_AUTO +Enable TCP_FASTOPEN where supported. +On GNU/Linux it works with a kernel >= 3.6. +This is the default. + +@item MHD_FOM_REQUIRE +Require support for TCP_FASTOPEN. +This causes @code{MHD_daemon_start()} to fail +if TCP_FASTOPEN cannot be enabled! + +@end table +@end deftp + + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_LISTEN_BACKLOG (unsigned int backlog_size) + +Use the given backlog for the @code{listen()} call. + +Works only when @code{MHD_D_OPTION_BIND_PORT()} +or @code{MHD_D_OPTION_BIND_SA()} are used. + +@table @var + +@item backlog_size +Backlog to use. A value of zero implies to use MHD/system defaults. + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + + + +@node libmicrohttpd-daemon-tls +@section Configuring TLS + +The following options can be used to configure +MHD to use TLS, turning an HTTP server into an +HTTPS server. + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_TLS (enum MHD_TlsBackend backend) + +Enable TLS (HTTPS) and select TLS backend + +@table @var + +@item backend +the TLS backend to use, +@code{MHD_TLS_BACKEND_NONE} for non-TLS (plain TCP) connections + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()} +@end deftypefun + +@c FIXME: const is commented out in C API!? +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_TLS_CERT_KEY (const char *mem_cert, const char *mem_key, const char *mem_pass) + +Provide TLS key and certificate data in-memory. +Works only if TLS mode is enabled. + +@table @var + +@item mem_cert +The X.509 certificates chain in PEM format loaded into memory (not a filename). +The first certificate must be the server certificate, following by the chain of signing +certificates up to (but not including) CA root certificate. + +@item mem_key +the private key in PEM format loaded into memory (not a filename) + +@item mem_pass +the option passphrase phrase to decrypt the private key, +could be NULL if private key does not need a password + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_TLS_CLIENT_CA (const char *mem_client_ca) + +Provide the certificate of the certificate authority (CA) to be used by the MHD daemon for client authentication. +Works only if TLS mode is enabled. + +@table @var + +@item mem_client_ca +the CA certificate in memory (not a filename) + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_TLS_PSK_CALLBACK (MHD_PskServerCredentialsCallback psk_cb, void *psk_cb_cls) + +Configure PSK to use for the TLS key exchange. + +@table @var + +@item psk_cb +the function to call to obtain pre-shared key + +@item psk_cb_cls +the closure for @var{psk_cb} + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_NO_ALPN () + +Control ALPN for TLS connection. +If this option is set but TLS is not enabled overall, +it is silently ignored (does not cause a failure). +By default ALPN is automatically used for TLS connections. + +@table @var + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + + +@node libmicrohttpd-daemon-authentication +@section Configuring HTTP authentication + +@c FIXME: const commented out in C API!? +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_RANDOM_ENTROPY (size_t buf_size, const void *buf) + +Set strong random data to be used by MHD. +Currently the data is only used for digest authentication. +@c FIXME: is it NOT enabled if the option is not set? Unclear english! +Daemon support for digest authentication is enabled automatically when this option is used. +The recommended size is 32 bytes. +Sizes larger then 32 bytes are unlikely to increase +security (assuming a strong random number generator was +used to create @var{buf}). + +@table @var + +@item buf_size +the size of the buffer + +@item buf +the buffer with strong random data, the content will be copied by MHD + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()} +@end deftypefun + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_AUTH_DIGEST_MAP_SIZE (size_t size) + +Specify the size of the internal hash map array that tracks generated digest nonces usage. +When the size of the map is too small then need to handle concurrent digest authentication requests, many false-positive stale nonce responses might be produced. +By default, the digest nonce hash map size is 1000 entries. + +@table @var + +@item size +the size of the map array + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_AUTH_DIGEST_NONCE_TIMEOUT (unsigned int timeout) + +Configure nonce validity period for nonces used with HTTP digest +authentication. + +@table @var + +@item timeout +Validity period (in seconds) to apply for the nonces used in +digest authentication. + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_AUTH_DIGEST_DEF_MAX_NC (uint_fast32_t max_nc) + +Default maximum nonce counter (nc) value used ford digest authentication. +@xref{MHD_digest_auth_check_digest}. + +@table @var + +@item max_nc +Maximum nonce counter allowed. Zero is ignored. + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + + +@node libmicrohttpd-daemon-limits +@section Configuring resource limits + +This section is about daemon configuration options that +enable applications to configure resource limits. Setting +resource limits can help ensure that MHD does not use +too many resources, but also ensure that MHD uses enough +resources for optimum performance. + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_DEFAULT_TIMEOUT (unsigned int timeout) + +Specify inactivity timeout for connection. +When no activity for specified time on connection, it is closed automatically. +Use zero for no timeout, which is also the (insecure!) default. It is highly recommended to set a non-zero timeout to ensure connections are not kept open forever. + +@table @var + +@item timeout +the in seconds, zero for no timeout + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + +@anchor{MHD_D_OPTION_GLOBAL_CONNECTION_LIMIT} +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_GLOBAL_CONNECTION_LIMIT (unsigned int glob_limit) + +Sets the maximum number of (concurrent) network connections served by the daemon. + +@table @var + +@item glob_limit +Limit to apply. The real maximum number of network connections could +still be smaller than requested due to the system limitations, +like @code{FD_SETSIZE} when polling via @code{select()} is used. + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_PER_IP_LIMIT (unsigned int limit) + +Sets a limit on the number of (concurrent) network connections made to the server from the same IP address. +Can be used to prevent one IP from taking over all of the allowed connections. If the same IP tries to establish more than the specified number of connections, they will be immediately rejected. + +@table @var + +@item limit +Connection limit to use. 0 for no limit. +@c FIXME: 0 = no limit is correct? + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_ACCEPT_POLICY (MHD_AcceptPolicyCallback apc, void *apc_cls) + +Set a policy callback that accepts/rejects connections based on the client's IP address. The callbeck function will be called before servicing any new incoming connection. + +@table @var + +@item apc +the accept policy callback + +@item apc_cls +the closure for the callback + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()} +@end deftypefun + + +@anchor{MHD_AcceptPolicyCallback} +@deftypefn {Function Pointer} {enum MHD_Bool} (*MHD_AcceptPolicyCallback)(void *cls, size_t addr_len, const struct sockaddr *addr) + +Allow or deny a client to connect. + +@table @var + +@item cls +closure value provided by the application when registering +the callback + +@item addr_len +length of @var{addr} + +@item addr +address information from the client + +@end table +The function must return @code{MHD_YES} if +the connection should be allowed, and +@code{MHD_NO} if it should be denied.\ +@end deftypefn + + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_PROTOCOL_STRICT_LEVEL (enum MHD_ProtocolStrictLevel sl, enum MHD_UseStictLevel how) + +Set how strictly MHD will enforce the HTTP protocol. + +@table @var + +@item sl +the level of strictness + +@item how +the way how to use the requested level + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()} +@end deftypefun + +@c FIXME: define MHD_ProtocolStrictLevel +@c FIXME: define MHD_UseStrictLevel + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_CONN_MEMORY_LIMIT (size_t value) + +The default limit is only 32kb per connection. Applications should be +careful to make sure that the given limit is large enough to fit all +request headers (together with internal parsing information). Half of +the memory will typically be used for I/O buffers. On embedded +platforms, values above 128kb are unlikely to result in significant +performance benefits as TCP buffers are unlikely to support window +sizes above 64k on embedded systems. + +@table @var + +@item value +Maximum memory size per connection in bytes. + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + +@anchor{shared memory pool} +@anchor{MHD_D_OPTION_LARGE_POOL_SIZE} +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_LARGE_POOL_SIZE (size_t value) + +The size of the shared memory pool for accumulated upload processing. +The same large pool is shared for all connections server by MHD and used when application requests avoiding of incremental upload processing to accumulate complete content upload before giving it to the application. +Default is 8Mb. +Can be set to zero to disable use of the shared pool. + +@table @var + +@item value +Size of the large memory pool in bytes. + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_STACK_SIZE () + +Desired size of the stack for the threads started by MHD. +Use 0 to use the operating system's default stack size, which is also the default value used by MHD. +Works only with +@code{MHD_D_OPTION_WM_WORKER_THREADS()} or +@code{MHD_D_OPTION_WM_THREAD_PER_CONNECTION()}. + +@table @var + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()} +@end deftypefun + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_FD_NUMBER_LIMIT (MHD_Socket max_fd) + +The the maximum FD value. +The limit is applied to all sockets used by MHD. +If the listen socket FD is equal to or higher then the specified value, the daemon fail to start. +If a new connection's FD is equal to or higher then the specified value, the connection is rejected. +If an application uses @code{select()} for polling sockets, +the system's @code{FD_SETSIZE} is a good value for this option. +Silently ignored on W32 (WinSock sockets are not integers). + +@table @var + +@item max_fd +Maximum file descriptor to allow (exclusive). +@c FIXME: it is exclusive, right? + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + + + + + +@node libmicrohttpd-daemon-performance +@section Performance tuning options + + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_TURBO () + +Enable `turbo`. +Disables certain calls to @code{shutdown()}, enables aggressive non-blocking optimistic reads and other potentially unsafe optimisations. +Most effects only happen with internal threads with @code{epoll()}. +The 'turbo' mode is disabled by default. + +@table @var + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_DISABLE_THREAD_SAFETY () + +Disable some internal thread safety. +Indicates that MHD daemon will be used by application in single-threaded mode only. When this flag is set then application must call any MHD function only within a single thread. +This flag turns off some internal thread-safety and allows MHD making some of the internal optimisations suitable only for single-threaded environments. +Not compatible with any internal threads modes. +If MHD is compiled with custom configuration for embedded projects without threads support, this option is mandatory. +Thread safety is enabled by default. + +@table @var + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_DISALLOW_UPGRADE () + +You need to set this option if you want to disable use of HTTP Upgrade. +Upgrade may require usage of additional internal resources, which MHD can avoid allocating if they will not be used. +You should only use this option if you do not use upgrade functionality and need a generally minor boost in performance and resources savings. +HTTP upgrade is allowed by default. + +@table @var + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_DISALLOW_SUSPEND_RESUME () + +Disable @ref{MHD_action_suspend,,@code{MHD_action_suspend()}} functionality. + +You should only use this function if you do not use suspend functionality and need a generally minor boost in performance. +Suspending requests is allowed by default. + +@table @var + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()} +@end deftypefun + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_DISABLE_COOKIES () + +Disable cookies parsing. + +Disable automatic cookies processing if cookies are not used. +Cookies are automatically parsed by default. + +@table @var + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()} +@end deftypefun + + + + +@node libmicrohttpd-daemon-other +@section Other daemon options + + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_SIGPIPE_SUPPRESSED () + +Inform that SIGPIPE is suppressed or handled by application. +If suppressed/handled, MHD uses network functions that could generate SIGPIPE, like @code{sendfile()}. +Silently ignored when MHD creates internal threads as for them SIGPIPE is suppressed automatically. + +@table @var + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + + + +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_DISABLE_URI_QUERY_PLUS_AS_SPACE () + +Disable converting plus ('+') character to space in URL arguments (URL part after '?'). +Plus conversion is not required by HTTP RFCs, however it required by HTML specifications, see https://url.spec.whatwg.org/#application/x-www-form-urlencoded for details. +By default plus is converted to space in the query part of a URL. + +@table @var + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + +@cindex{real-time clock} +@anchor{MHD_D_OPTION_SUPPRESS_DATE_HEADER} +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_SUPPRESS_DATE_HEADER () + +Suppresse use of 'Date:' header. +According to RFC should be suppressed only if the system has no real-time clock (RTC). +The 'Date:' is not suppressed (the header is enabled) by default. + +@table @var + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun + +@cindex{Shoutcast} +@deftypefun {struct MHD_DaemonOptionAndValue} MHD_D_OPTION_ENABLE_SHOUTCAST () + +Use SHOUTcast for responses. +This will cause @emph{all} responses to begin with the SHOUTcast 'ICY' line instead of 'HTTP'. + +@table @var + +@end table + +Returns the option to pass to @code{MHD_daemon_set_options()}. +@end deftypefun diff --git a/doc/manual/doptions.inc b/doc/manual/doptions.inc @@ -0,0 +1,107 @@ +@anchor{MHD_DaemonOptionAndValue} +@cindex{option} + +This chapter is about configuring an MHD daemon. MHD daemon +configuration options are represented using a @code{struct +MHD_DameonOptionAndValue}. However, applications should never be +concerned with the internals of this data structure, and only use the +provided API functions and macros explained in this chapter to +construct these options. + +@node libmicrohttpd-daemon-options-setting +@section Setting daemon options + +MHD offers three main ways to set options for a @code{struct MHD_Daemon}: + +@itemize +@item @code{MHD_daemon_set_options()} sets an array of options, +@item @code{MHD_daemon_set_option()} sets an individual option, and +@item @code{MHD_DAEMON_SET_OPTIONS()} sets a list of options. +@end itemize + +All three approaches can be combined for the same daemon +to set various options. We will now look at each of them. + +@code{MHD_daemon_set_options()} is useful if the application needs +complex code to first initialize a set of options, or if it has a +static data buffer with all of the options (say in ROM). It is also +the underlying function used to implement the other styles. + +@anchor{MHD_daemon_set_options} +@deftypefun {struct MHD_StatusCode} MHD_daemon_set_options (struct MHD_Daemon *daemon, const struct MHD_DaemonOptionAndValue *options, size_t options_max_num) + +@table @var +@item daemon +the daemon to configure + +@item options +array of options to set, either @code{MHD_D_OPTION_TERIMINATE()}-terminated or +limited by @var{options_max_num} (whatever comes first). + +@item options_max_num +maximum number of options to process from the @var{options} array, +or @code{MHD_OPTIONS_ARRAY_MAX_SIZE} to process all options from +@var{options} until the @code{MHD_D_OPTION_TERMINATE()}-terminator. + +@end table + +Returns @code{MHD_SC_OK} on success, otherwise the error code of +the first option that could not be set. +@end deftypefun + +To set only a single option, MHD defines a simple convenience API with +@code{MHD_daemon_set_option()}. This is useful if there is only one +option to be set, or if error handling for that specific option is +somehow special (like not failing when setting this particular option +failed). + +@anchor{MHD_DAEMON_set_option} +@deftypefun {struct MHD_StatusCode} MHD_daemon_set_option (struct MHD_Daemon *daemon, const struct MHD_DaemonOptionAndValue *option) + +@table @var +@item daemon +the daemon to configure + +@item option +the option to set + +@end table + +Returns @code{MHD_SC_OK} on success, otherwise the error code from +trying to set the @var{option}. +@end deftypefun + + +An easy way to set a bunch of options without having to worry +about explicitly allocating an array or checking each return +value is to use @code{MHD_DAEMON_SET_OPTIONS()}. + +@anchor{MHD_DAEMON_SET_OPTIONS} +@deftypefun {struct MHD_StatusCode} MHD_DAEMON_SET_OPTIONS (struct MHD_Daemon *daemon, ...) + +@table @var +@item daemon +the daemon to configure + +@item ... +variable-length list of @code{MHD_DaemonOptionAndValue} options +to set; does @emph{not} need to be terminated via +@code{MHD_D_OPTION_TERMINATE()} as such a terminator is added +automatically. + +@end table + +Returns @code{MHD_SC_OK} on success, otherwise the error code of +the first option that could not be set. +@end deftypefun + +The following example illustrates how to set daemon options: + +@example +@verbatiminclude examples/options-example.c +@end example + +The remaining sections of this chapter discuss the various +daemon options available to applications today. + +@include manual/daemon_options.inc diff --git a/doc/manual/external.inc b/doc/manual/external.inc @@ -0,0 +1,296 @@ +A modern HTTP server should handle multiple concurrent connections +and an application embedding an HTTP server into its process may +possibly need do other work not directly related to handling HTTP +requests. + +There are several approches for how an HTTP server can handle +concurrent requests: + +@itemize +@item start a new process per request, or use a pool of processes +@item run a (new) thread per request, or use a pool of threads +@item use an event loop to learn when data can be received from or + sent to the client (based on system calls like @code{select()} + or @code{epoll()}) +@end itemize + +Finally, these different approaches are not mutually exclusive, +it is possible to use multiple processes with multiple threads +each using an event loop. The good news is that MHD supports +all of these. + +The @emph{initially} simplest approach is usually to simply tell MHD +to start one or more new threads to handle connections, allowing the +main application to continue doing its work in its own separate +threats. The disadvantage of this approach is that concurrent +accesses between the main application's threads and MHD's threads +require the use of synchronization primitives (such as mutexes) to +avoid data races. Furthermore, threads are not available on all +platforms and require additional stack space for each thread. + +An alternative to using threads is to integrate MHD's request +processing into the main (event) loop of the application. This is +particularly suitable for applications that already have an event loop +and that avoid using threads for performance, portability, +maintainability or security reasons. We call this approach the +use of MHD with an @emph{external} event loop, in contrast to +MHD creating its own threads with an @emph{internal} event loop. + +This chapter describes MHD's API for integrating a daemon with +an external event loop. Any external event loop needs to ask +MHD for three pieces of information: + +@itemize +@item The set of sockets to wait on for status changes; +@item for each socket the types of status changes to + wait for (ready-to-read, ready-to-write, failed); +@item a timeout for when to wake up MHD again even if nothing + else happened. +@end itemize + +Depending on the operating system and the event loop style, the +representation of these bits of information may differ; in particular, +with @code{epoll()} MHD might even give the application a single +handle that represents the entire set. Finally, we need to +distinguish between event loops that support edge triggers (only +notifying when the status changed to ready) and level triggers +(notifying about the socket being ready, even if it simply remained +ready). + + +@anchor{MHD_SocketRegistrationUpdateCallback} +@node libmicrohttpd-external-registration +@section The @code{MHD_SocketRegistrationUpdateCallback} + +External event loops are enabled using either +@ref{MHD_D_OPTION_WM_EXTERNAL_EVENT_LOOP_CB_LEVEL} or +@ref{MHD_D_OPTION_WM_EXTERNAL_EVENT_LOOP_CB_EDGE} depending +on whether edge or level triggers should be used. In both +cases, the application must provide a function of type +@code{MHD_SocketRegistrationUpdateCallback} when enabling +the option. + +@anchor{MHD_SocketRegistrationUpdateCallback} +@deftypefn {Function Pointer} {MHD_APP_SOCKET_CNTX_TYPE *} (*MHD_SocketRegistrationUpdateCallback) (void *cls, MHD_Socket fd, enum MHD_FdState watch_for, MHD_APP_SOCKET_CNTX_TYPE *app_cntx_old, struct MHD_EventUpdateContext *ecb_cntx) + +Type of a function for registration or de-registration of the sockets to +watch in the external event loop. + +Implementations of this callback must not call +@ref{MHD_daemon_destroy,,code{MHD_daemon_destroy()}}, +@ref{MHD_daemon_quiesce,,@code{MHD_daemon_quiesce()}} or +@ref{MHD_daemon_add_connection,,@code{MHD_daemon_add_connection()}}. + +@table @var +@item cls +custom value provided by the application at callback registration time; + +@item fd +the socket to watch; + +@item watch_for +the states of the @var{fd} to watch, if set to +@code{MHD_FD_STATE_NONE} the socket must be de-registred +and the resources from the application state in the @var{app_cntx_old} should +be released; + +@item app_cntx_old +the old application-defined context for the socket, +@code{NULL} if the @var{fd} socket was not registered before; + +@item ecb_cntx +the context handle to be used +with @code{MHD_daemon_event_update()}; +@end table + +Implementations must return the new socket context to be used with +this @var{fd}. Implementations must return @code{NULL} on de-registration +and on error (in which case the connection to the client will be +closed). + +@end deftypefn + +The registration update callback is provided with @var{fd} which +is the socket for which the external event loop should become +active. The use of @ref{MHD_Socket,,@code{MHD_Socket}} is for +portability. The @var{watch_for} determines the types of +triggers the external event loop should use as triggers. + + +@deftp {Enumeration} MHD_FdState + +The network status of the socket or the type of trigger to wait for. +When set by MHD (for @code{MHD_SocketRegistrationUpdateCallback} and +similar APIs) it indicates a request by MHD to watch for specific +socket state: readiness for receiving the data, readiness for +sending the data and/or an exception state of the socket. +When set by application (and provided to +@code{MHD_daemon_event_update()} and similar APIs) +it must indicate the actual status of the socket. + +In both cases, the actual value may be a bitwise OR +combination of @code{MHD_FD_STATE_RECV}, +@code{MHD_FD_STATE_SEND} and @code{MHD_FD_STATE_EXCEPT}. + +@table @code +@item MHD_FD_STATE_NONE +The socket is not ready for receiving or sending and +does not have any exceptional state. +The state is used for de-registration of sockets in +a @code{MHD_SocketRegistrationUpdateCallback}. + +@item MHD_FD_STATE_RECV +Indicates that socket should be watched for incoming data +(when set for @code{MHD_SocketRegistrationUpdateCallback}) +or that a socket has incoming data ready to read (when used for +@code{MHD_daemon_event_update()}); + +@item MHD_FD_STATE_SEND +Indicates that socket should be watched for availability for sending +(when set for @code{MHD_SocketRegistrationUpdateCallback}) +or that a socket is ready for transmission of data (when used +for @code{MHD_daemon_event_update()}); + +@item MHD_FD_STATE_EXCEPT +Indicates that socket should be watched for disconnect, out-of-band +data available or high priority data available (when set by +@code{MHD_SocketRegistrationUpdateCallback}) +or that a socket has been disconnected, has out-of-band data available or +has high priority data available (when used for +@code{MHD_daemon_event_update()}). This status must not include +signalling the ``remote peer shut down writing'' (FIN) status. + +@item MHD_FD_STATE_RECV_SEND +Combination of @code{MHD_FD_STATE_RECV} and @code{MHD_FD_STATE_SEND}; + +@item MHD_FD_STATE_RECV_EXCEPT +Combination of @code{MHD_FD_STATE_RECV} and @code{MHD_FD_STATE_EXCEPT}; + +@item MHD_FD_STATE_SEND_EXCEPT +Combination of @code{MHD_FD_STATE_SEND} and @code{MHD_FD_STATE_EXCEPT}; + +@item MHD_FD_STATE_RECV_SEND_EXCEPT +Combination of @code{MHD_FD_STATE_RECV}, @code{MHD_FD_STATE_SEND} +and @code{MHD_FD_STATE_EXCEPT}. + +@end table +@end deftp + +@anchor{MHD_APP_SOCKET_CNTX_TYPE} +The @var{app_cntx_old} argument is a bit unusual: +@code{MHD_APP_SOCKET_CNTX_TYPE} is actually a macro that @emph{should} +be defined by the application @emph{before} including +``microhttpd2.h''. If the application does not define this type, it +will be defined as @code{void}. The use of this argument is to give +the application the opportunity to associate its own data structure +with the external event loop trigger responsibility given to it by +MHD. When called to register a @var{fd} for the first time, MHD will +always pass @code{NULL}. Subsequently, MHD will pass whatever value +was returned by the @code{MHD_SocketRegistrationUpdateCallback}. By +giving MHD a pointer to whatever data structure the event loop of the +application wants to use, applications can avoid iterating over their +internal data structures to find an entry for @var{fd}. The use of +an application-defined macro for this type improves type-safety. +When MHD calls the callback to de-register a socket, the application +must free any of its resources associated with @var{app_cntx_old}. +The application must at least store the @var{ecb_cntx}. A typical +application will furthemore store the @var{fd} and the @var{watch_for} +value in the application context. + +Finally, @var{ecb_cntx} is provided because after registration, the +application is expected to call +@ref{MHD_daemon_event_update,,@code{MHD_daemon_event_update()}} +whenever the specified type of event is triggered, and +@code{MHD_daemon_event_update()} requires the @var{ecb_cntx} to allow +MHD to understand which socket changed state. + + +@anchor{MHD_daemon_event_update} +@node libmicrohttpd-external-trigger +@section Notifying MHD that a socket is ready + +When the application's external event loop learns that a socket +is ready for an event MHD registered for, it must call +@code{MHD_daemon_event_update()}. + + +@anchor{MHD_daemon_event_update} +@deftypefun void MHD_daemon_event_update (struct MHD_Daemon *daemon, struct MHD_EventUpdateContext *ecb_cntx, enum MHD_FdState fd_current_state) + +Update the socket's state for MHD. +Must be called for every socket for which the status changed. +In @code{MHD_D_OPTION_WM_EXTERNAL_EVENT_LOOP_CB_LEVEL()} mode +should be called for each registered socket. +In @code{MHD_D_OPTION_WM_EXTERNAL_EVENT_LOOP_CB_EDGE()} mode +should be called only when a socket becomes ready for the specified +event. + +Available only for daemons stated in +@code{MHD_D_OPTION_WM_EXTERNAL_EVENT_LOOP_CB_LEVEL} or +@code{MHD_D_OPTION_WM_EXTERNAL_EVENT_LOOP_CB_EDGE} mode. + +@table @var +@item ecb_cntx +context handle provided during the call +to the @code{MHD_SocketRegistrationUpdateCallback} + +@item fd_current_state +the current state of the socket + +@end table +@end deftypefun + +Note that calling @code{MHD_daemon_event_update()} does not +cause MHD to actually work on the events: MHD will merely +update its internal state. To actually do work, applications +must still call @code{MHD_daemon_process_reg_events()}. + + +@anchor{MHD_daemon_process_reg_events} +@node libmicrohttpd-external-runner +@section Processing externally triggered events + +@anchor{MHD_daemon_process_reg_events} +@deftypefun {enum MHD_StatusCode} MHD_daemon_process_reg_events (struct MHD_Daemon *daemon, uint_fast64_t *next_max_wait) + +Process registered network events and updates sockets registration. +This function first processes @emph{all} +previously registered (via @code{MHD_daemon_event_update()}) +network events (if any) and then calls the +@code{MHD_SocketRegistrationUpdateCallback} +callback for every socket that needs to be added/updated/removed +from the external event loop. + +This function is only available only for daemons stated in +@code{MHD_WM_EXTERNAL_EVENT_LOOP_CB_LEVEL} or +@code{MHD_WM_EXTERNAL_EVENT_LOOP_CB_EDGE} mode. + +@table @var +@item daemon +daemon to process connections of + +@item next_max_wait +address where MHD will store the next maximum wait time in +microseconds to be used for the external event loop as an upper limit; +can be @code{NULL} (but that is uncommon as usually the external event +loop needs to learn the timeout). + +@end table + +Returns @code{MHD_SC_OK} on success, otherwise an +error code. +@end deftypefun + + +@node libmicrohttpd-external-example +@section External event loop example: select + +The following is a simple example for how to implement +an external event loop using @code{select()} using +a level trigger. + +@example c +@verbatiminclude examples/external-select.c +@end example + +@c FIXME: add one for epoll() with edge trigger! diff --git a/doc/manual/http-status-texi.gen b/doc/manual/http-status-texi.gen @@ -0,0 +1,131 @@ +0: No status code, used if no HTTP status is available (uninitialized) [None] +@item MHD_HTTP_STATUS_CONTINUE +100: Continue [RFC7231, Section 6.2.1] +@item MHD_HTTP_STATUS_SWITCHING_PROTOCOLS +101: Switching Protocols [RFC7231, Section 6.2.2] +@item MHD_HTTP_STATUS_PROCESSING +102: Processing [RFC2518] +@item MHD_HTTP_STATUS_EARLY_HINTS +103: Early Hints [RFC8297] +@item MHD_HTTP_STATUS_OK +200: OK [RFC7231, Section 6.3.1] +@item MHD_HTTP_STATUS_CREATED +201: Created [RFC7231, Section 6.3.2] +@item MHD_HTTP_STATUS_ACCEPTED +202: Accepted [RFC7231, Section 6.3.3] +@item MHD_HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION +203: Non-Authoritative Information [RFC7231, Section 6.3.4] +@item MHD_HTTP_STATUS_NO_CONTENT +204: No Content [RFC7231, Section 6.3.5] +@item MHD_HTTP_STATUS_RESET_CONTENT +205: Reset Content [RFC7231, Section 6.3.6] +@item MHD_HTTP_STATUS_PARTIAL_CONTENT +206: Partial Content [RFC7233, Section 4.1] +@item MHD_HTTP_STATUS_MULTI_STATUS +207: Multi-Status [RFC4918] +@item MHD_HTTP_STATUS_ALREADY_REPORTED +208: Already Reported [RFC5842] +@item MHD_HTTP_STATUS_IM_USED +226: IM Used [RFC3229] +@item MHD_HTTP_STATUS_MULTIPLE_CHOICES +300: Multiple Choices [RFC7231, Section 6.4.1] +@item MHD_HTTP_STATUS_MOVED_PERMANENTLY +301: Moved Permanently [RFC7231, Section 6.4.2] +@item MHD_HTTP_STATUS_FOUND +302: Found [RFC7231, Section 6.4.3] +@item MHD_HTTP_STATUS_SEE_OTHER +303: See Other [RFC7231, Section 6.4.4] +@item MHD_HTTP_STATUS_NOT_MODIFIED +304: Not Modified [RFC7232, Section 4.1] +@item MHD_HTTP_STATUS_USE_PROXY +305: Use Proxy [RFC7231, Section 6.4.5] +@item MHD_HTTP_STATUS_SWITCH_PROXY +306: Switch proxy (not used) [RFC7231, Section 6.4.6] +@item MHD_HTTP_STATUS_TEMPORARY_REDIRECT +307: Temporary Redirect [RFC7231, Section 6.4.7] +@item MHD_HTTP_STATUS_PERMANENT_REDIRECT +308: Permanent Redirect [RFC7538] +@item MHD_HTTP_STATUS_BAD_REQUEST +400: Bad Request [RFC7231, Section 6.5.1] +@item MHD_HTTP_STATUS_UNAUTHORIZED +401: Unauthorized [RFC7235, Section 3.1] +@item MHD_HTTP_STATUS_PAYMENT_REQUIRED +402: Payment Required [RFC7231, Section 6.5.2] +@item MHD_HTTP_STATUS_FORBIDDEN +403: Forbidden [RFC7231, Section 6.5.3] +@item MHD_HTTP_STATUS_NOT_FOUND +404: Not Found [RFC7231, Section 6.5.4] +@item MHD_HTTP_STATUS_METHOD_NOT_ALLOWED +405: Method Not Allowed [RFC7231, Section 6.5.5] +@item MHD_HTTP_STATUS_NOT_ACCEPTABLE +406: Not Acceptable [RFC7231, Section 6.5.6] +@item MHD_HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED +407: Proxy Authentication Required [RFC7235, Section 3.2] +@item MHD_HTTP_STATUS_REQUEST_TIMEOUT +408: Request Timeout [RFC7231, Section 6.5.7] +@item MHD_HTTP_STATUS_CONFLICT +409: Conflict [RFC7231, Section 6.5.8] +@item MHD_HTTP_STATUS_GONE +410: Gone [RFC7231, Section 6.5.9] +@item MHD_HTTP_STATUS_LENGTH_REQUIRED +411: Length Required [RFC7231, Section 6.5.10] +@item MHD_HTTP_STATUS_PRECONDITION_FAILED +412: Precondition Failed [RFC7232, Section 4.2][RFC8144, Section 3.2] +@item MHD_HTTP_STATUS_CONTENT_TOO_LARGE +413: Content Too Large [RFC9110, Section 15.5.14] +@item MHD_HTTP_STATUS_URI_TOO_LONG +414: URI Too Long [RFC7231, Section 6.5.12] +@item MHD_HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE +415: Unsupported Media Type [RFC7231, Section 6.5.13][RFC7694, Section 3] +@item MHD_HTTP_STATUS_RANGE_NOT_SATISFIABLE +416: Range Not Satisfiable [RFC7233, Section 4.4] +@item MHD_HTTP_STATUS_EXPECTATION_FAILED +417: Expectation Failed [RFC7231, Section 6.5.14] +@item MHD_HTTP_STATUS_MISDIRECTED_REQUEST +421: Misdirected Request [RFC7540, Section 9.1.2] +@item MHD_HTTP_STATUS_UNPROCESSABLE_CONTENT +422: Unprocessable Content [RFC9110, Section 15.5.21] +@item MHD_HTTP_STATUS_LOCKED +423: Locked [RFC4918] +@item MHD_HTTP_STATUS_FAILED_DEPENDENCY +424: Failed Dependency [RFC4918] +@item MHD_HTTP_STATUS_TOO_EARLY +425: Too Early [RFC8470] +@item MHD_HTTP_STATUS_UPGRADE_REQUIRED +426: Upgrade Required [RFC7231, Section 6.5.15] +@item MHD_HTTP_STATUS_PRECONDITION_REQUIRED +428: Precondition Required [RFC6585] +@item MHD_HTTP_STATUS_TOO_MANY_REQUESTS +429: Too Many Requests [RFC6585] +@item MHD_HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE +431: Request Header Fields Too Large [RFC6585] +@item MHD_HTTP_STATUS_RETRY_WITH +449: Retry with [MS IIS extension] +@item MHD_HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS +451: Unavailable For Legal Reasons [RFC7725] +@item MHD_HTTP_STATUS_INTERNAL_SERVER_ERROR +500: Internal Server Error [RFC7231, Section 6.6.1] +@item MHD_HTTP_STATUS_NOT_IMPLEMENTED +501: Not Implemented [RFC7231, Section 6.6.2] +@item MHD_HTTP_STATUS_BAD_GATEWAY +502: Bad Gateway [RFC7231, Section 6.6.3] +@item MHD_HTTP_STATUS_SERVICE_UNAVAILABLE +503: Service Unavailable [RFC7231, Section 6.6.4] +@item MHD_HTTP_STATUS_GATEWAY_TIMEOUT +504: Gateway Timeout [RFC7231, Section 6.6.5] +@item MHD_HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED +505: HTTP Version Not Supported [RFC7231, Section 6.6.6] +@item MHD_HTTP_STATUS_VARIANT_ALSO_NEGOTIATES +506: Variant Also Negotiates [RFC2295] +@item MHD_HTTP_STATUS_INSUFFICIENT_STORAGE +507: Insufficient Storage [RFC4918] +@item MHD_HTTP_STATUS_LOOP_DETECTED +508: Loop Detected [RFC5842] +@item MHD_HTTP_STATUS_NOT_EXTENDED +509: Bandwidth Limit Exceeded [Apache extension] +@item MHD_HTTP_STATUS_UNINITIALIZED +510: Not Extended [RFC2774] +@item MHD_HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED +511: Network Authentication Required [RFC6585] +@item MHD_HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED + diff --git a/doc/manual/init.inc b/doc/manual/init.inc @@ -0,0 +1,384 @@ +This chapter explains the key functions of MHD to create, start, +quiesce and destroy an HTTP server, as well as how to configure +global logging to receive more detailed messages when something +goes really wrong inside of MHD. + +@node libmicrohttpd-init-panic +@section Setting up a panic handler +@cindex logging + +@code{MHD_PanicCallback} is the type of a function that MHD +calls when it encounters an error that it cannot handle. This +should always be indicative of a serious bug, be it a hardware +failure (such as a bit-flip in RAM or a broken CPU) or a bug +in the application (for example, memory corruption or a +failed assertion). MHD will not cause a panic in case of +normal operation or when there would be a safe way to continue +the execution. + +@anchor{MHD_PanicCallback} +@deftypefn {Function Pointer} {enum MHD_Result} (*MHD_PanicCallback) (void *cls, const char *file, const char *func, unsigned int line, const char *message) + +Invoked in the context of a serious error condition. The callback should not return. Some parameters could be empty strings (with zero-termination at zero position), +especially if MHD is built without support for log messages. +@table @var +@item cls +custom value provided by the application at callback registration time; + +@item file +name of the source file where the error occured; + +@item func +function in the source where the error occured; + +@item line +line in the source file where the error occured; + +@item message +message describing the error; +@end table +@end deftypefn + +MHD comes with a default panic action, which is to print an error +message and call @code{abort()} to terminate the process. +Applications can use @code{MHD_lib_set_panic_func()} to change this +behavior. However, applications must always terminate the process +inside of the panic callback (but they could use @code{exit()} or +@code{_exit()} or some other way to terminate the process instead +of calling @code{abort()}). Note that +the panic function is @emph{expected} to be called in a situation +where the process is in an @emph{unsafe} state, thus even the default +behavior of calling @code{fprintf()} could be dangerous as it may +enable an attacker to further exploit whatever bug caused the panic in +the first place. + +@deftypefun {void} MHD_lib_set_panic_func (MHD_PanicCallback cb, void *cb_cls) +Set a handler for fatal errors. + +@table @var +@item cb +function to call if MHD encounters a fatal internal error. If no handler was set explicitly, MHD will log an error and call @code{abort()}. + +@item cb_cls +closure argument for @var{cb}; the other arguments are the name of the source file, line number and a string describing the nature of the fatal error (which can be @code{NULL}) +@end table +@end deftypefun + +@node libmicrohttpd-init-create +@section Creating an HTTP daemon + +@cindex daemon + +@anchor{MHD_Daemon} +@deftp {C Struct} MHD_Daemon + +Handle for an HTTP daemon. A daemon contains the MHD configuration +and state to listening on a socket for HTTP clients and handle +their requests. +@end deftp + +An application can in principle create multiple daemons, for example +to listen on both port 80 and port 443. Each daemon handles requests +from at most one @code{listen()} socket. +The @code{MHD_daemon_create()} function is used by applications to +create a @code{struct MHD_Daemon}. + +@anchor{MHD_daemon_create} +@deftypefun {struct MHD_Daemon *} MHD_daemon_create (MHD_RequestCallback req_cb, void *req_cb_cls) +Create a new HTTP daemon object. Does not actually start +the HTTP daemon. +@table @var +@item req_cb +Function to call to handle each HTTP request; + +@item req_cb_cls +closure to pass to the @var{req_cb}; +@end table + +Returns @code{NULL} on error (usually out-of-memory), +handle to daemon on success. +@end deftypefun + +When creating an HTTP daemon the application must pass the address of +a function of type @code{MHD_RequestCallback} which MHD will call for +each HTTP request that daemon receives from the network. + +@cindex anchor +@anchor{MHD_RequestCallback} +@deftypefn {Function Pointer} {struct MHD_Action *} (*MHD_RequestCallback) (void *cls, struct MHD_Request *request, const struct MHD_String *path, enum MHD_HTTP_Method method, uint_fast64_t upload_size) + +Functions of this type are invoked by MHD whenever it received an HTTP +request and needs to handle it. + +@table @var +@item cls +custom value provided by the application to @code{MHD_daemon_create()}; + +@item path +the PATH component of the HTTP URL requested by the client. Empty +if the request was just for ``http://domain``, otherwise +starting with ``/``; + +@item method +the HTTP method used by the client; + +@item upload_size +number of bytes of data that the client intends to upload +in the request body; a special value of @code{MHD_SIZE_UNKNOWN} +is provided if the client indicated the use of chunked encoding +and the final upload size is not yet known; +@end table + +The returned @code{struct MHD_Action} determines how MHD will continue +handling the request. Implementations must call MHD +functions to create a @code{struct MHD_Action}, which then determines +the next steps. + +@ref{libmicrohttpd2-actions,,Using actions} explains in more detail how to create +various possible actions. It is also possible to return @code{NULL}, +in which case MHD will close the HTTP connection without returning +anything (not even an error message). This can be used if the socket +must be closed due to a serious error while handling the request (such +as being out-of-memory). +@end deftypefn + +The HTTP @var{method} is not provided as a string as comparing +strings is generally inefficient for the application. Furthermore, +by providing an enumeration value applications often can avoid +implementing case-insensitive ASCII string comparissons. However, +the enumeration only works for HTTP methods specified in RFC 9110. + +@cindex method +@anchor{MHD_HTTP_Method} +@deftp {Enumeration} MHD_HTTP_Method + +Represents canonical HTTP methods as per RFC 9110. + +@table @code +@item MHD_HTTP_METHOD_GET + "GET". Safe. Idempotent. RFC9110, Section 9.3.1. + +@item MHD_HTTP_METHOD_HEAD +"HEAD". Safe. Idempotent. RFC9110, Section 9.3.2. + +@item MHD_HTTP_METHOD_POST +"POST". Not safe. Not idempotent. RFC9110, Section 9.3.3. + +@item MHD_HTTP_METHOD_PUT +"PUT". Not safe. Idempotent. RFC9110, Section 9.3.4. + +@item MHD_HTTP_METHOD_DELETE +"DELETE". Not safe. Idempotent. RFC9110, Section 9.3.5. + +@item MHD_HTTP_METHOD_CONNECT +"CONNECT". Not safe. Not idempotent. RFC9110, Section 9.3.6. + +@item MHD_HTTP_METHOD_OPTIONS +"OPTIONS". Safe. Idempotent. RFC9110, Section 9.3.7. + +@item MHD_HTTP_METHOD_TRACE +"TRACE". Safe. Idempotent. RFC9110, Section 9.3.8. + +@item MHD_HTTP_METHOD_ASTERISK + "*". Not safe. Not idempotent. RFC9110, Section 18.2. + +@item MHD_HTTP_METHOD_OTHER +Non-canonical HTTP method. If an application wants to +support non-canonical HTTP methods, the application +must request the method's value by passing +@code{MHD_REQUEST_INFO_DYNAMIC_HTTP_METHOD_STR} +to @code{MHD_request_get_info_dynamic()}. +@xref{libmicrohttpd2-info request,,request introspection}. + +@end table +@end deftp + +The convenience function @code{MHD_http_method_to_string()} +can be used to convert members of this enumeration to +a string value. + +@anchor{MHD_http_method_to_string} +@deftypefun {const struct MHD_String *} MHD_http_method_to_string (enum MHD_HTTP_Method method) +Get text version of the method name. + +Returns a pointer (!) to the HTTP method as a string. +@code{NULL} is returned if @var{method} is @code{MHD_HTTP_METHOD_OTHER}. + +@table @var +@item method +the method to get the text version for + +@end table +@end deftypefun + +Various additional string constants for HTTP methods are defined in +the @code{microhttpd2.h} header for HTTP methods from a wide range of +RFCs. Check the header for constants with the prefix +@code{MHD_HTTP_METHOD_STR_}. + +@node libmicrohttpd-init-start +@section Starting an HTTP daemon + +After creating an MHD daemon, applications will typically configure +various optional features, such as support for TLS. +@ref{libmicrohttpd2-doptions,,Daemon options} explains how to set the various options. +Once the daemon is correctly configured, applications can start +processing client requests using @code{MHD_daemon_start()}. + +@anchor{MHD_daemon_start} +@deftypefun {enum MHD_StatusCode} MHD_daemon_start (struct MHD_Daemon *daemon) + +Starts an HTTP daemon. Checks that options are consistent, initializes +the TLS library (if enabled), creates the listen socket (if not +disabled) and launches the internal threads (if configured to do so). + +@table @var +@item daemon +Handle to the HTTP daemon to start. Must be configured +but not have been started previously. +@end table + +Returns @code{MHD_SC_OK} on success, otherwise an error code indicative of the problem. +@end deftypefun + +Note that if you configured the daemon to use an +@emph{external} event loop, calling @code{MHD_daemon_start()} +is not sufficient to actually start processing client requests. +In this case, you must also integrate MHD into your event loop. +@xref{libmicrohttpd2-external,,Using external event loops}. + +@node libmicrohttpd-status-codes +@section Interpreting status codes +@cindex status code + +MHD uses the @code{enum MHD_StatusCode} to inform the application +about errors. + +@anchor{MHD_StatusCode} +@deftp {Enumeration} MHD_StatusCode +Status codes are returned to indicate to the +application the success or failure of an +operation. The value ranges have a meaning: + +@itemize +@item from 0 and 10000 + must be handled explicitly by the app. +@item from 10000-19999 + are informational. +@item from 20000-29999 + indicate successful operations. +@item from 30000-39999 + indicate unsuccessful (normal) operations. +@item from 40000-49999 + indicate client errors. +@item from 50000-59999 + indicate MHD server errors. +@item from 60000-65535 + indicate application errors. +@end itemize + +The most common value is @code{MHD_SC_OK} (0) +which indicates a successful operation. +@end deftp + +To obtain a human-readable message explaining the status code, +applications can use @code{MHD_status_code_to_string()}. + +@anchor{MHD_status_code_to_string} +@deftypefun {const struct MHD_String *} MHD_status_code_to_string (struct MHD_StatusCode code) + +Get text description for the MHD status code. +This function works for MHD status codes, not for HTTP status codes! + +@table @var +@item code +the MHD code to get a description for +@end table + +The function returns a pointer to the text description for the +status code, or @code{NULL} if @var{code} is not known. + +@end deftypefun + +The convenience macro @code{MHD_status_code_to_string_lazy()} converts +an @code{enum MHD_StatusCode} directly to a @code{const char *}. It +also ensures that the result is never @code{NULL} by returning +@code{"[No code]"} instead of @code{NULL}. + + +@node libmicrohttpd-init-quiesce +@section Quiescing an HTTP daemon +@cindex quiesce + +Quiescing an HTTP daemon prevents it from further accepting new +connections, but allows it to finish handling existing clients. This +is useful to minimize the disruptions when gracefully shutting down, +restarting or reloading an HTTP service. + +@anchor{MHD_daemon_quiesce} +@deftypefun MHD_Socket MHD_daemon_quiesce (struct MHD_Daemon *daemon) +Stop accepting connections from the listening socket. Allows clients +to continue processing, but stops accepting new connections. + +@table @var +@item daemon +Handle to the HTTP daemon to quiesce. The daemon should have been +started before. +@end table + +The returned socket is the listen socket of the daemon. This value +can be useful in the special case that a listen socket is to be +migrated to another process (i.e. a newer version of the HTTP server). +The caller is made responsible for ultimately closing the returned +socket; however, if MHD is run using threads (anything but external +select mode), it @strong{must not} be closed until @emph{after} +@code{MHD_daemon_destroy()} has been called (as it is theoretically +possible that an existing thread is still using it). + +A value of @code{-1} is returned if either the daemon was not +started or was not listening on a socket. +@end deftypefun + +@cindex socket +@anchor{MHD_Socket} +@deftp {Typedef} MHD_Socket + +The type @code{MHD_Socket} is platform-dependent: +@code{MHD_Socket} is simply an @code{int} on UNIX systems, while on +W32 it is a @code{SOCKET}. +@end deftp + + +@node libmicrohttpd-init-destroy +@section Destroying an HTTP daemon + +Destroying an HTTP daemon using @code{MHD_daemon_destroy()} +immediately stops all MHD processing of associated requests and frees +all associated resources. Applications do @emph{not} have to call +@code{MHD_daemon_quiesce()} before destroying a daemon: if the daemon +was not quiesced first, the listen socket will still be closed and all +ongoing requests will simply be terminated hard by closing the +connections. + +@anchor{MHD_daemon_destroy} +@deftypefun void MHD_daemon_destroy (struct MHD_Daemon *daemon) + +Shutdown and destroy an HTTP daemon. Frees all +resources still associated with the daemon. + +@table @var +@item daemon +Handle to the HTTP daemon to destroy. +@end table +@end deftypefun + + +@node libmicrohttpd-init-example +@section Example: Starting with GNU libmicrohttpd + +The following is a minimal starting point for implementing +an application that uses MHD to add an HTTP server: + +@example c +@verbatiminclude examples/init-example.c +@end example +\ No newline at end of file diff --git a/doc/manual/introduction.inc b/doc/manual/introduction.inc @@ -0,0 +1,377 @@ +@noindent + +GNU libmicrohttpd (MHD) is a small HTTP daemon library implementing +the server-side functionality of the HTTP protocol. MHD is an +official GNU package and part of the GNU project, bringing you +Free/Libre Software since 1983. MHD is released under the GNU +Lesser General Public License (LGPLv3 or later) and gives you +the freedoms to run, copy, distribute, study, change and improve +the software for yourself and others. MHD without TLS support +is also dual-licensed under eCos license (the GPLv3+ with the +eCOS exception). + +Many of MHD's features are optional and can be turned off using +compiler flags. Features include: + +@itemize @bullet +@item Supports HTTP 1.0, HTTP/1.1 and (soon) HTTP2 +@item Basic and digest authentication +@item TLS via OpenSSL or libgnutls (mbedTLS planned) +@item Websockets +@item Different threading modes (select, poll, epoll, thread-per-connection, thread-pool) +@item Stream processing (arbitrary size uploads) +@item Chunked encoding, HTTP pipelining +@item Limiting connections per client IP address +@item Use of @code{sendfile()} +@end itemize + +This manual is for libmicrohttpd2, a major new release of the +library. It is still not battle-tested (compared to the previous) +version, and we would be excited to hear back from you about +real-world use! The previous implementation of MHD is used in a wide +range of implementations. Examples based on reports we've received +from developers include: + +@itemize +@item Embedded HTTP server on a cortex M3 (128 KB code space) +@item Large-scale multimedia server (reportedly serving at the + simulator limit of 7.5 GB/s) +@item Administrative console (via HTTP/HTTPS) for network appliances +@item Streaming Earth observation data from NASA to the Internet +@end itemize + +The remainder of this chapter will give a high-level overview of +the library. + +@menu +* libmicrohttpd-introduction-limitations:: Library limitations. +* libmicrohttpd-introduction-threadmodes:: Thread modes and event loops. +* libmicrohttpd-introduction-compiling:: Compiling libmicrohttpd. +* libmicrohttpd-introduction-pointers:: Using MHD data. +* libmicrohttpd-introduction-sigpipe:: SIGPIPE. +* libmicrohttpd-introduction-w32:: Portability to W32. +* libmicrohttpd-introduction-zos:: Portability to z/OS. +@end menu + + +@node libmicrohttpd-introduction-limitations +@section Limitations + +MHD is supposed to handle everything that it must handle (because the +API would not allow clients to do this), such as basic connection +management. However, some detailed interpretations of HTTP headers, such as +range requests, are deliberately left to the main application. In particular, +if an application developer wants to support range requests, he needs +to explicitly indicate support in responses and also explicitly parse +the range header and generate a suitable response. +@ref{libmicrohttpd2-requests,,Accessing client request data} explains how applications can learn +everything about incoming HTTP requests. + +MHD does understands HTTP headers that control connection management +(specifically, @code{Connection: close} and @code{Expect: 100 +continue} are understood and handled automatically). +@code{Connection: upgrade} is supported by passing control over +the communication to the application (after sending the HTTP +upgrade response header). +@ref{libmicrohttpd-upgrade,Upgrading HTTP connections} explains how to implement connection +upgrades (for example, to implement WebSockets). + +MHD largely leaves implementing the semantics of the different HTTP +methods to the application. One exception is that MHD does understand +@code{HEAD} and will only send the headers of the response and not the +body, even if the client supplied a body. (In fact, applications do +need to construct a response with the correct length, even for +@code{HEAD} request.) + +MHD understands @code{POST} data and is able to decode certain formats +(@code{application/x-www-form-urlencoded}, @code{multipart/form-data} +and @code{text/plain}) using the post processor API. The data stream +of a POST can also be provided directly to the main application, thus +unsupported encodings could still be processed using custom +application logic. @ref{libmicrohttpd2-postprocessor,,Parsing POST +data} explains MHD functions for dealing with POST data in more +detail. + +The @code{microhttp2.h} header file defines various constants used by +the HTTP protocol. This does not mean that MHD actually interprets +all of these values. The provided constants are exported as a +convenience for users of the library. MHD does not require that all +transmitted HTTP headers are part of the standard specification; +applications are free to define their own custom headers and use those +with MHD. Even setting standard headers incorrectly (for example, to test +clients) is possible via the use of options to override sanity checks. + +All symbols defined in the public API start with @code{MHD_}. All +functions are guaranteed to be completely reentrant and thread-safe. +MHD checks for allocation failures and tries to recover gracefully +(for example, by closing the connection). Additionally, clients can +specify resource limits on the overall number of connections, number +of connections per IP address and memory used per connection to avoid +resource exhaustion. @ref{libmicrohttpd2-doptions,,Configuring your +HTTP daemon} explains the MHD API for configuring the various settings +supported for the daemon. + + +@node libmicrohttpd-introduction-threadmodes +@section Thread modes and event loops +@cindex poll +@cindex epoll +@cindex mode +@cindex threads +@cindex select + +MHD supports four basic thread modes and up to three event loop +styles. + +The four basic thread modes are external sockets polling (MHD creates +no threads, event loop is fully managed by the application), internal +polling (MHD creates one thread for all connections), polling in +thread pool (MHD creates a thread pool which is used to process all +connections) and thread-per-connection (MHD creates one thread for +listen sockets and then one thread per accepted connection). + +These thread modes are then combined with the evet loop styles +(polling function type). MHD supports @code{select}, @code{poll} and +@code{epoll}. @code{select} is available on all platforms, +@code{epoll} and @code{poll} may not be available on some platforms. +Note that it is possible to combine MHD using @code{epoll} with an +external @code{select}-based event loop. + +The default (if no other option is passed) is ``external periodic'' +where the application must periodically call on MHD to give it a +chance to do its work. For simple applications, the recommended mode +is an external event loop where MHD tells the application which events +to watch for and when the application needs to call the library. The +highest performance can typically be obtained with a thread pool using +@code{epoll}. + +@c Apache Benchmark (ab) was used to compare the +@c performance of @code{select} and @code{epoll} when using a thread pool +@c and a large number of connections. + +Not all combinations of thread modes and event loop styles are +supported. This is partially to keep the API simple, and partially +because some combinations simply make no sense as others are strictly +superior. Note that the choice of style depends first of all on the +application logic, and then on the performance requirements. +Applications that perform a blocking operation while handling a +request within the callbacks from MHD must use a thread per +connection. This is typically rather costly. Applications that do +not support threads or that must run on embedded devices without +thread-support must use the external mode. Using @code{epoll} is only +supported by some platforms, thus portable applications must at least +have a fallback option available. @ref{tbl:supported} lists the sane +combinations. + +@float Table,tbl:supported +@multitable {@b{thread-per-connection}} {@b{select}} {@b{poll}} {@b{epoll}} +@item @tab @b{select} @tab @b{poll} @tab @b{epoll} +@item @b{external} @tab yes @tab yes @tab yes +@item @b{internal} @tab yes @tab yes @tab yes +@item @b{thread pool} @tab yes @tab yes @tab yes +@item @b{thread-per-connection} @tab no @tab no @tab no @c not yet implemented +@end multitable +@caption{Supported combinations of event styles and thread modes.} +@end float + +In practice, you rarely need to worry about selecting the event +loop style: MHD offers the "automatic" setting, which will pick +the fastest mode available on your platform automatically. + +@xref{libmicrohttpd2-external,,Using external event loops} for details +on how to use MHD with an external event loop. + +@node libmicrohttpd-introduction-compiling +@section Compiling GNU libmicrohttpd +@cindex compilation +@cindex embedded systems +@cindex portability + +MHD uses the standard GNU system where the usual build process +involves running: + +@verbatim +$ ./configure +$ make +$ make install +@end verbatim + +In terms of dependencies, MHD can optionally use OpenSSL or +libgnutls for TLS support. MHD has no hard dependencies +other than libc, and tries to impose minimal requirements +on the C standard library as well. + +MHD supports various options to be given to configure to tailor the +binary to a specific situation. Note that some of these options will +remove portions of the MHD code that are required for +binary-compatibility. They should only be used on embedded systems +with tight resource constraints and no concerns about library +versioning. Standard distributions including MHD are expected to +always ship with all features enabled and with at least one TLS +backend, otherwise unexpected incompatibilities can arise. In +particular, the libtool versioning supported by MHD developers +assumes that you enable all of the optional features. + +Below is a list of MHD-specific options that can be given to +configure:@footnote{Canonical configure options such +as @code{--prefix} are also supported; for a +full list of options run @code{./configure --help}} + +@c FIXME: check with current configure options! +@table @code +@item ``--disable-curl'' +disable running testcases using libcurl + +@item ``--disable-largefile'' +disable support for 64-bit files + +@item ``--disable-messages'' +disable logging of error messages (smaller binary size, not so much fun for debugging) + +@item ``--disable-https'' +disable HTTPS support, even if GNUtls is found; this option must be used if eCOS license is desired as an option (in all cases the resulting binary falls under a GNU LGPL-only license) + +@item ``--disable-postprocessor'' +do not include the post processor API (results in binary incompatibility) + +@item ``--disable-dauth'' +do not include the authentication APIs (results in binary incompatibility) + +@item ``--disable-httpupgrade'' +do not build code for HTTP ``Upgrade'' (smaller binary size, binary incompatible library) + +@item ``--disable-epoll'' +do not include epoll support, even if it supported (minimally smaller binary size, good for portability testing) + +@item ``--enable-coverage'' +set flags for analysis of code-coverage with gcc/gcov (results in slow, large binaries) + +@item ``--with-threads=posix,w32,none,auto'' +sets threading library to use. With use ``none'' to not support threads. In this case, MHD will only support the ``external'' threading modes and not perform any locking of data structures! Use @code{MHD_is_feature_supported(MHD_FEATURE_THREADS)} to test if threads are available. Default is ``auto''. + +@item ``--with-gnutls=PATH'' +specifies path to libgnutls installation + +@end table + + +@node libmicrohttpd-introduction-pointers +@section Applications using data provided by MHD + +@cindex lifetime +@subsection Data lifetime + +MHD will give applications access to its internal data structures via +arguments and return values pointing to memory managed by MHD. This +creates the question as to how long those pointers are assured to stay +valid. + +Most MHD data structures are associated with an HTTP session, +connection, request or response. Thus, pointers associated with a +session, connection, request or response are typically valid until the +respective session, connection, request or response are completed. +This is in particular true for all values obtained via the +introspection API. +@ref{libmicrohttpd2-introspection,,introspection APIs} has more +details on the introspection API. + +Otherwise, values can generally only be assumed to be valid during the +callback where MHD provided a value to the application. Finally, +unless stated otherwise, the application does not need to guarantee +that values it passes into MHD APIs remain valid after the call to an +MHD API returns. + +@cindex string +@subsection Strings + +MHD will frequently make strings available to applications. +In this case, MHD will return a @code{struct MHD_String} or +a @code{struct MHD_StringNullable}. + +@anchor{MHD_String} +@deftp {C Struct} MHD_String len cstr +Represents a string, the pointer is never @code{NULL}. +@table @var +@item @code{size_t} len +Number of characters in @var{str}, not counting 0-termination; + +@item @code{const char *} cstr +0-terminated C-string. Guaranteed to not be @code{NULL}. +@end table +@end deftp + +@anchor{MHD_StringNullable} +@deftp {C Struct} MHD_StringNullable len cstr +Represents a string that could also be @code{NULL}. +@table @var +@item @code{size_t} len +Number of characters in @var{str}, not counting 0-termination; + +@c FIXME: really? or is the pointer to the Nullable NULL!? +@item @code{const char *} cstr +0-terminated C-string. Could be @code{NULL} in some cases. +@end table +@end deftp + +@cindex boolean +@subsection Booleans + +@deftp {Enumeration} MHD_Bool +MHD's representation of a boolean choice. +Values include @code{MHD_NO} (0) and @code{MHD_YES} (1). +@end deftp + + +@node libmicrohttpd-introduction-sigpipe +@section SIGPIPE +@cindex signals + +MHD does not install a signal handler for SIGPIPE. On platforms where +this is possible (such as GNU/Linux), it disables SIGPIPE for its I/O +operations (by passing @code{MSG_NOSIGNAL} or similar flags). On +platforms where this is not possible, SIGPIPE signals may be generated +from network operations by MHD. This will cause the process to die +unless the application explicitly installs a signal handler for SIGPIPE. + +Hence portable code using MHD @strong{must} install a SIGPIPE handler +@emph{or} explicitly block the SIGPIPE signal. MHD does not do so to +avoid messing with other parts of the application that may need to +handle SIGPIPE in a particular way. You can make your application +handle SIGPIPE by calling the following function in @code{main()}: + +@example +@verbatiminclude examples/sigpipe.c +@end example + + +@section Portability to Android + +To cross-compile MHD for Android, install the Android NDK and use: +@verbatim +$ ./configure \ + --target=arm-linux-androideabi \ + --host=arm-linux-androideabi \ + --disable-doc \ + --disable-examples +$ make +@end verbatim + +Similar build commands should work for cross-compilation to other platforms. +Note that you may have to first cross-compile the respective TLS library +to get MHD with TLS support. + + +@section Portability to W32 + +MHD in general ported well to W32. Most MHD features are +supported. W32 do not support some functions, like @code{epoll} and +corresponding MHD features are thus not available on W32. + +@section Portability to z/OS + +It has been a long time since the developers had access to z/OS. +While in principle the code should work, we would appreciate +feedback from the z/OS community on the current version. + + + diff --git a/doc/manual/introspection.inc b/doc/manual/introspection.inc @@ -0,0 +1,605 @@ +This chapter explains how applications can introspect the state of the +MHD library, a @code{struct MHD_Daemon}, a @code{struct +MHD_Connection}, a @code{struct MHD_Session} or a +@code{MHD_Request}. Now, until now most of the discussed APIs have +primarily interacted with a daemon or a request, which raises the +question how applications can even get hold of a connection or +session. The two main ways are either to set daemon options to receive +callbacks (say when a connection or session is established or +completed), or via introspection of a given request. + +All introspection APIs work in a similar way: they are given the +object to inspect, a member of an enumeration specifying what +property the application is interested in, and a pointer to a +@code{union} where MHD is to store the value of the property. + +Introspection APIs for each type of object are split into two +sub-APIs. One function to obtain @emph{fixed} data that never changes +during the lifetime of the inspected object and that the application +can thus continue to reference until the underlying object is +destroyed, and a second function to obtain @emph{dynamic} data that is +ephemeral and that can change over time (including becoming available +later or disappearing) and where the application thus has to be +careful when to ask for the data and to not keep pointers to stale +addresses. + +Furthermore, each of the two sub-APIs comes in two variants, one +main function (such as @code{MHD_daemon_get_info_dynamic_sz()}) +and associated macro (for example, @code{MHD_daemon_get_info_dynamic()}) +that the application should actually use. The difference between +the macro and the function is that the function takes an extra +@code{size_t} argument that specifies the size of the +@code{union} used for the @var{output}. This argument allows MHD +to check that the application's output buffer is of sufficient +size, which could be important if the @code{union} changes between +MHD versions and thus the application possibly has been built with +a different @code{union} definition. The macro simply runs +@code{sizeof()} on the @var{output} variable to provide the +size of the application's allocation. If the buffer is too small +for the requested information, MHD fails safe and returns +@code{MHD_SC_INFO_GET_BUFF_TOO_SMALL}. In the next subsections +we will thus only present the macros that applications should +use, and skip over the @code{_sz()}-functions with the extra +@code{size_t} argument. + +@menu +* libmicrohttpd2-info library:: State information about the library +* libmicrohttpd2-info daemon:: State information about a daemon +* libmicrohttpd2-info connection:: State information about a connection +* libmicrohttpd2-info session:: State information about a session +* libmicrohttpd2-info request:: State information about a request +@end menu + +@node libmicrohttpd2-info library +@section Obtaining state information about the MHD library + +This introspection API returns information about how the MHD +library was compiled. It is primarily useful for applications +that want to double-check that particular features are available. + +@anchor{MHD_lib_get_info_fixed} +@deftypefun {enum MHD_StatusCode} MHD_lib_get_info_fixed (enum MHD_LibInfoFixed info_type, union MHD_LibInfoFixedData *output_buf) + +Obtain information about the MHD library. + +@table @var +@item info_type +the type of information that is desired + +@item output_buf +where to write the desired information (which member is set depends on @var{info_type}) +@end table + +Returns a status code: +@itemize +@item @code{MHD_SC_OK} on success, +@item @code{MHD_SC_INFO_GET_TYPE_UNKNOWN} if @var{info_type} is unknown, +@item @code{MHD_SC_INFO_GET_BUFF_TOO_SMALL} + if @var{output_buf} is too small for this request +@end itemize +The list is not exhaustive, other error codes may be added in the future. +@end deftypefun + +@anchor{MHD_LibInfoFixedData} +@deftp {Enumeration} MHD_LibInfoFixedData +Values of this enum are used to specify what +dynamic information about a daemon is desired. + +@table @code + +@item FIXME_CONSTANT_NAME +FIXME_CONSTANT_DESCRIPTION + +@end table +@end deftp + + +@anchor{MHD_LibInfoFixedData} +@deftp {C Union} MHD_LibInfoFixedData +Represents introspection data that can be returned about the +MHD library. Which member will be set on success depends on the value +given for @var{info_type}. +@table @var +@item @code{FIXME_DATATYPE} FIXME_name +FIXME_DESCRIPTION. + +@end table +@end deftp + + + +@anchor{MHD_lib_get_info_dynamic} +@deftypefun {enum MHD_StatusCode} MHD_lib_get_info_dynamic (enum MHD_LibInfoDynamicType info_type, union MHD_LibInfoDynamicData *output_buf) + +Obtain information about the MHD library. +This information may change after the start of MHD. + +@table @var +@item info_type +the type of information that is desired + +@item output_buf +where to write the desired information (which member is set depends on @var{info_type}) +@end table + +Returns a status code: +@itemize +@item @code{MHD_SC_OK} on success, +@item @code{MHD_SC_TOO_EARLY} if the information is not yet available, + usually because the respective stage in processing was not yet reached, +@item @code{MHD_SC_TOO_LATE} if the information is no longer available, + usually because processing is past the stage where the information is kept, +@item @code{MHD_SC_INFO_GET_TYPE_UNKNOWN} if @var{info_type} is unknown, +@item @code{MHD_SC_INFO_GET_TYPE_NOT_APPLICABLE} + if the requested information is not available for this specific + object due to how that object was configured +@item @code{MHD_SC_INFO_GET_TYPE_UNOBTAINABLE} + if the requested information should be available + but cannot be provided due to some error or other reason, +@item @code{MHD_SC_INFO_GET_BUFF_TOO_SMALL} + if @var{output_buf} is too small for this request +@end itemize +The list is not exhaustive, other error codes may be added in the future. +@end deftypefun + + +@anchor{MHD_LibInfoDynamic} +@deftp {Enumeration} MHD_LibInfoDynamic +Values of this enum are used to specify what +dynamic information about a lib is desired. + +@table @code +@anchor{MHD_LIB_INFO_FIXED_HAS_AGGREGATE_FD} +@item MHD_LIB_INFO_FIXED_HAS_AGGREGATE_FD +Check if aggregate file-descriptor support is available +for this build of the libarary. + +@anchor{MHD_LIB_INFO_FIXED_HAS_UPGRADE} +@item MHD_LIB_INFO_FIXED_HAS_UPGRADE +Check if HTTP upgrade support is available +for this build of the libarary. + +@anchor{MHD_LIB_INFO_FIXED_HAS_AUTH_BASIC} +@item MHD_LIB_INFO_FIXED_HAS_AUTH_BASIC +Check if HTTP basic authentication support is available +for this build of the libarary. + +@anchor{MHD_LIB_INFO_FIXED_HAS_AUTH_DIGEST} +@item MHD_LIB_INFO_FIXED_HAS_AUTH_DIGEST +Check if HTTP digest authentication support is available +for this build of the libarary. + +@anchor{MHD_LIB_INFO_FIXED_HAS_LARGE_FILE} +@item MHD_LIB_INFO_FIXED_HAS_LARGE_FILE +Check if MHD was build with support for "large" files +(above 2 Gigabytes). This should be the case on all modern +platforms, but may not be the case on some embedded or legacy +systems. + +@item FIXME_CONSTANT_NAME +FIXME_CONSTANT_DESCRIPTION + +@end table +@end deftp + + +@deftp {C Union} MHD_LibInfoDynamicData +Represents introspection data that can be returned about a +@var{lib}. Which member will be set on success depends on the value +given for @var{info_type}. +@table @var +@item @code{FIXME_DATATYPE} FIXME_name +FIXME_DESCRIPTION. + +@end table +@end deftp + + + +@node libmicrohttpd2-info daemon +@section Obtaining state information about a daemon + +This introspection API returns information about a daemon. + +@anchor{MHD_daemon_get_info_fixed} +@deftypefun {enum MHD_StatusCode} MHD_daemon_get_info_fixed (struct MHD_Daemon *daemon, enum MHD_DaemonInfoFixed info_type, union MHD_DaemonInfoFixedData *output_buf) + +Obtain information about the MHD @var{daemon}. +The information returned is not changed at after the start +of the daemon until the daemon is destroyed. + +@table @var +@item info_type +the type of information that is desired + +@item output_buf +where to write the desired information (which member is set depends on @var{info_type}) +@end table + +Returns a status code: +@itemize +@item @code{MHD_SC_OK} on success, +@c FIXME: can we really have TOO_EARLY/TOO_LATE for *fixed* data? +@item @code{MHD_SC_TOO_EARLY} if the information is not yet available, + usually because the respective stage in processing was not yet reached, +@item @code{MHD_SC_TOO_LATE} if the information is no longer available, + usually because processing is past the stage where the information is kept, +@item @code{MHD_SC_INFO_GET_TYPE_UNKNOWN} if @var{info_type} is unknown, +@item @code{MHD_SC_INFO_GET_TYPE_NOT_APPLICABLE} + if the requested information is not available for this specific + object due to how that object was configured +@item @code{MHD_SC_INFO_GET_TYPE_UNOBTAINABLE} + if the requested information should be available + but cannot be provided due to some error or other reason, +@item @code{MHD_SC_INFO_GET_BUFF_TOO_SMALL} + if @var{output_buf} is too small for this request +@end itemize +The list is not exhaustive, other error codes may be added in the future. +@end deftypefun + + +@anchor{MHD_DaemonInfoFixed} +@deftp {Enumeration} MHD_DaemonInfoFixed +Values of this enum are used to specify what +dynamic information about a @var{daemon} is desired. + +@table @code +@anchor{MHD_DAEMON_INFO_FIXED_AGGREGATE_FD} +@item MHD_DAEMON_INFO_FIXED_AGGREGATE_FD +Aggregate file-descriptor applications should use when +using an external event loop in combination with +@ref{MHD_D_OPTION_WM_EXTERNAL_SINGLE_FD_WATCH}. + +@item FIXME_CONSTANT_NAME +FIXME_CONSTANT_DESCRIPTION + +@end table +@end deftp + + +@anchor{MHD_DaemonInfoFixedData} +@deftp {C Union} MHD_DaemonInfoFixedData +Represents introspection data that can be returned about a +@var{daemon}. Which member will be set on success depends on the value +given for @var{info_type}. +@table @var + +@item @code{FIXME_DATATYPE} FIXME_name +FIXME_DESCRIPTION. + +@end table +@end deftp + +@anchor{MHD_daemon_get_info_dynamic} +@deftypefun {enum MHD_StatusCode} MHD_daemon_get_info_dynamic (struct MHD_Daemon *daemon, enum MHD_DaemonInfoDynamicType info_type, union MHD_DaemonInfoDynamicData *output_buf) + +Obtain information about the given @var{daemon}. +This information may change after the start of the @var{daemon}. + +@table @var +@item daemon +the daemon about which information is desired; + +@item info_type +the type of information that is desired + +@item output_buf +where to write the desired information (which member is set depends on @var{info_type}) +@end table + +Returns a status code: +@itemize +@item @code{MHD_SC_OK} on success, +@item @code{MHD_SC_TOO_EARLY} if the information is not yet available, + usually because the respective stage in processing was not yet reached, +@item @code{MHD_SC_TOO_LATE} if the information is no longer available, + usually because processing is past the stage where the information is kept, +@item @code{MHD_SC_INFO_GET_TYPE_UNKNOWN} if @var{info_type} is unknown, +@item @code{MHD_SC_INFO_GET_TYPE_NOT_APPLICABLE} + if the requested information is not available for this specific + object due to how that object was configured +@item @code{MHD_SC_INFO_GET_TYPE_UNOBTAINABLE} + if the requested information should be available + but cannot be provided due to some error or other reason, +@item @code{MHD_SC_INFO_GET_BUFF_TOO_SMALL} + if @var{output_buf} is too small for this request +@end itemize +The list is not exhaustive, other error codes may be added in the future. +@end deftypefun + + +@c FIXME: inconsistent suffix "Type" not used for others! +@anchor{MHD_DaemonInfoDynamicType} +@deftp {Enumeration} MHD_DaemonInfoDynamicType +Values of this enum are used to specify what +dynamic information about a daemon is desired. + +@table @code +@item FIXME_CONSTANT_NAME +FIXME_CONSTANT_DESCRIPTION + +@end table +@end deftp + + +@anchor{MHD_DaemonInfoDynamicData} +@deftp {C Union} MHD_DaemonInfoDynamicData +Represents introspection data that can be returned about a +@var{daemon}. Which member will be set on success depends on the value +given for @var{info_type}. +@table @var +@item @code{FIXME_DATATYPE} FIXME_name +FIXME_DESCRIPTION. + +@end table +@end deftp + + +@node libmicrohttpd2-info connection +@section Obtaining state information about a connection + +This introspection API returns information about a connection. + + +@anchor{MHD_connection_get_info_fixed} +@deftypefun {enum MHD_StatusCode} MHD_connection_get_info_fixed (struct MHD_Connection *connection, enum MHD_ConnectionInfoFixed info_type, union MHD_ConnectionInfoFixedData *output_buf) + +Obtain information about the MHD @var{connection}. +The information returned is not changed at after the start +of the connection until the connection is destroyed. + +@table @var +@item info_type +the type of information that is desired + +@item output_buf +where to write the desired information (which member is set depends on @var{info_type}) +@end table + +Returns a status code: +@itemize +@item @code{MHD_SC_OK} on success, +@c FIXME: can we really have TOO_EARLY/TOO_LATE for *fixed* data? +@item @code{MHD_SC_TOO_EARLY} if the information is not yet available, + usually because the respective stage in processing was not yet reached, +@item @code{MHD_SC_TOO_LATE} if the information is no longer available, + usually because processing is past the stage where the information is kept, +@item @code{MHD_SC_INFO_GET_TYPE_UNKNOWN} if @var{info_type} is unknown, +@item @code{MHD_SC_INFO_GET_TYPE_NOT_APPLICABLE} + if the requested information is not available for this specific + object due to how that object was configured +@item @code{MHD_SC_INFO_GET_TYPE_UNOBTAINABLE} + if the requested information should be available + but cannot be provided due to some error or other reason, +@item @code{MHD_SC_INFO_GET_BUFF_TOO_SMALL} + if @var{output_buf} is too small for this request +@end itemize +The list is not exhaustive, other error codes may be added in the future. +@end deftypefun + + +@anchor{MHD_ConnectionInfoFixed} +@deftp {Enumeration} MHD_ConnectionInfoFixed +Values of this enum are used to specify what +dynamic information about a @var{connection} is desired. + +@table @code +@item FIXME_CONSTANT_NAME +FIXME_CONSTANT_DESCRIPTION + +@end table +@end deftp + + +@anchor{MHD_ConnectionInfoFixedData} +@deftp {C Union} MHD_ConnectionInfoFixedData +Represents introspection data that can be returned about a +@var{connection}. Which member will be set on success depends on the value +given for @var{info_type}. +@table @var +@item @code{FIXME_DATATYPE} FIXME_name +FIXME_DESCRIPTION. + +@end table +@end deftp + + +@anchor{MHD_connection_get_info_dynamic} +@deftypefun {enum MHD_StatusCode} MHD_connection_get_info_dynamic (struct MHD_Connection *connection, enum MHD_ConnectionInfoDynamicType info_type, union MHD_ConnectionInfoDynamicData *output_buf) + +Obtain information about the given @var{connection}. +This information may change after the start of the @var{connection}. + +@table @var +@item connection +the connection about which information is desired; + +@item info_type +the type of information that is desired + +@item output_buf +where to write the desired information (which member is set depends on @var{info_type}) +@end table + +Returns a status code: +@itemize +@item @code{MHD_SC_OK} on success, +@item @code{MHD_SC_TOO_EARLY} if the information is not yet available, + usually because the respective stage in processing was not yet reached, +@item @code{MHD_SC_TOO_LATE} if the information is no longer available, + usually because processing is past the stage where the information is kept, +@item @code{MHD_SC_INFO_GET_TYPE_UNKNOWN} if @var{info_type} is unknown, +@item @code{MHD_SC_INFO_GET_TYPE_NOT_APPLICABLE} + if the requested information is not available for this specific + object due to how that object was configured +@item @code{MHD_SC_INFO_GET_TYPE_UNOBTAINABLE} + if the requested information should be available + but cannot be provided due to some error or other reason, +@item @code{MHD_SC_INFO_GET_BUFF_TOO_SMALL} + if @var{output_buf} is too small for this request +@end itemize +The list is not exhaustive, other error codes may be added in the future. +@end deftypefun + + +@c FIXME: inconsistent suffix "Type" not used for others! +@deftp {Enumeration} MHD_ConnectionInfoDynamicType +Values of this enum are used to specify what +dynamic information about a connection is desired. + +@table @code +@item FIXME_CONSTANT_NAME +FIXME_CONSTANT_DESCRIPTION + +@end table +@end deftp + + +@deftp {C Union} MHD_ConnectionInfoDynamicData +Represents introspection data that can be returned about a +@var{connection}. Which member will be set on success depends on the value +given for @var{info_type}. +@table @var +@item @code{FIXME_DATATYPE} FIXME_name +FIXME_DESCRIPTION. + +@end table +@end deftp + + + +@node libmicrohttpd2-info session +@section Obtaining state information about a session + + +This introspection API returns information about a session. + +@deftypefun {enum MHD_StatusCode} MHD_session_get_info_fixed (struct MHD_Session *session, enum MHD_SessionInfoFixed info_type, union MHD_SessionInfoFixedData *output_buf) + +Obtain information about the MHD @var{session}. +The information returned is not changed at after the start +of the session until the session is destroyed. + +@table @var +@item info_type +the type of information that is desired + +@item output_buf +where to write the desired information (which member is set depends on @var{info_type}) +@end table + +Returns a status code: +@itemize +@item @code{MHD_SC_OK} on success, +@c FIXME: can we really have TOO_EARLY/TOO_LATE for *fixed* data? +@item @code{MHD_SC_TOO_EARLY} if the information is not yet available, + usually because the respective stage in processing was not yet reached, +@item @code{MHD_SC_TOO_LATE} if the information is no longer available, + usually because processing is past the stage where the information is kept, +@item @code{MHD_SC_INFO_GET_TYPE_UNKNOWN} if @var{info_type} is unknown, +@item @code{MHD_SC_INFO_GET_TYPE_NOT_APPLICABLE} + if the requested information is not available for this specific + object due to how that object was configured +@item @code{MHD_SC_INFO_GET_TYPE_UNOBTAINABLE} + if the requested information should be available + but cannot be provided due to some error or other reason, +@item @code{MHD_SC_INFO_GET_BUFF_TOO_SMALL} + if @var{output_buf} is too small for this request +@end itemize +The list is not exhaustive, other error codes may be added in the future. +@end deftypefun + + +@deftp {Enumeration} MHD_SessionInfoFixed +Values of this enum are used to specify what +dynamic information about a @var{session} is desired. + +@table @code +@item FIXME_CONSTANT_NAME +FIXME_CONSTANT_DESCRIPTION + +@end table +@end deftp + + +@deftp {C Union} MHD_SessionInfoFixedData +Represents introspection data that can be returned about a +@var{session}. Which member will be set on success depends on the value +given for @var{info_type}. +@table @var +@item @code{FIXME_DATATYPE} FIXME_name +FIXME_DESCRIPTION. + +@end table +@end deftp + + +@deftypefun {enum MHD_StatusCode} MHD_session_get_info_dynamic (struct MHD_Session *session, enum MHD_SessionInfoDynamicType info_type, union MHD_SessionInfoDynamicData *output_buf) + +Obtain information about the given @var{session}. +This information may change after the start of the @var{session}. + +@table @var +@item session +the session about which information is desired; + +@item info_type +the type of information that is desired + +@item output_buf +where to write the desired information (which member is set depends on @var{info_type}) +@end table + +Returns a status code: +@itemize +@item @code{MHD_SC_OK} on success, +@item @code{MHD_SC_TOO_EARLY} if the information is not yet available, + usually because the respective stage in processing was not yet reached, +@item @code{MHD_SC_TOO_LATE} if the information is no longer available, + usually because processing is past the stage where the information is kept, +@item @code{MHD_SC_INFO_GET_TYPE_UNKNOWN} if @var{info_type} is unknown, +@item @code{MHD_SC_INFO_GET_TYPE_NOT_APPLICABLE} + if the requested information is not available for this specific + object due to how that object was configured +@item @code{MHD_SC_INFO_GET_TYPE_UNOBTAINABLE} + if the requested information should be available + but cannot be provided due to some error or other reason, +@item @code{MHD_SC_INFO_GET_BUFF_TOO_SMALL} + if @var{output_buf} is too small for this request +@end itemize +The list is not exhaustive, other error codes may be added in the future. +@end deftypefun + + +@c FIXME: inconsistent suffix "Type" not used for others! +@anchor{MHD_SessionInfoDynamicType} +@deftp {Enumeration} MHD_SessionInfoDynamicType +Values of this enum are used to specify what +dynamic information about a session is desired. + +@table @code +@item FIXME_CONSTANT_NAME +FIXME_CONSTANT_DESCRIPTION + +@end table +@end deftp + + +@anchor{MHD_SessionInfoDynamicData} +@deftp {C Union} MHD_SessionInfoDynamicData +Represents introspection data that can be returned about a +@var{session}. Which member will be set on success depends on the value +given for @var{info_type}. +@table @var +@item @code{FIXME_DATATYPE} FIXME_name +FIXME_DESCRIPTION. + +@end table +@end deftp + + +@node libmicrohttpd2-info request +@section Obtaining state information about a request + +Introspection of requests is described in +@ref{libmicrohttpd-requests-info}. diff --git a/doc/manual/migration.inc b/doc/manual/migration.inc @@ -0,0 +1,502 @@ +This chapter discusses how to convert an existing codebase that uses +GNU libmicrohttpd 1.x (or 0.x) to the GNU libmicrohttpd 2.x API. It +was written based on the experience of migrating GNU Taler's Sync +service to the new API. It should cover @emph{most} of the important +steps, but may omit some details. In general, there are no +@emph{subtle} steps needed to migrate a code base: if the new code +compiles, it most likely is OK as there is no function that kept is +name but changed semantics, and the new API is generally simply safer +to use and has fewer corner cases to consider. + +@node libmicrohttpd-configure +@section Compile-time testing for the MHD 2.x dependency +@cindex autoconf +@cindex automake +@cindex pkg-config + +Typically, the first step for migrating to the new API is to +add (or replace) the detection logic for the MHD library in +the build system. With GNU autotools and @code{pkg-config}, +the following snippet could be placed in @code{configure.ac} +to detect libmicrohttpd2: + +@verbatim +AC_ARG_WITH([microhttpd2], + [AS_HELP_STRING([--with-microhttpd2=PFX], + [base of libmicrohttpd2 installation])], + [SAVE_PKG_PATH="$PKG_CONFIG_PATH" + PKG_CONFIG_PATH="${withval}/lib/pkgconfig" + export PKG_CONFIG_PATH + PKG_CHECK_MODULES([MHD], [libmicrohttpd2 >= 2.0.0], [libmhd2=1], [libmhd2=0]) + PKG_CONFIG_PATH="$SAVE_PKG_PATH"], + [PKG_CHECK_MODULES([MHD], [libmicrohttpd2 >= 2.0.0], [libmhd2=1], [libmhd2=0])]) + +# Do this only if you require MHD2: +AS_IF([test "x$libmhd2" = "x0"], + [AC_MSG_ERROR([This program requires libmicrohttpd >= 2.0.0])]) + +# Alternatively, do this to conditionally compile MHD2 code: +AM_CONDITIONAL([HAVE_MHD2], [test "x$libmhd2" = "x1"]) + +# and/or use this to use ifdef to compile code only when MHD2 is available: +AC_DEFINE_UNQUOTED([HAVE_MHD2], [$libmhd2], + [Define to 1 if libmicrohttpd2 is available]) +@end verbatim + +If you do not want to rely on @code{pkg-config}, you can use +a more direct test: + +@verbatim +# check for libmicrohttpd +AC_MSG_CHECKING([for microhttpd2]) +AC_ARG_WITH([microhttpd2], + [AS_HELP_STRING([--with-microhttpd2=PFX], [base of libmicrohttpd2 installation])], + [AC_MSG_RESULT([given as $with_microhttpd2])], + [AC_MSG_RESULT([not given]) + with_microhttpd2=yes]) +AS_CASE([$with_microhttpd2], + [yes],, + [no],, + [LDFLAGS="-L$with_microhttpd2/lib $LDFLAGS" + CPPFLAGS="-I$with_microhttpd2/include $CPPFLAGS"]) +# This will set HAVE_MHD2 as above for conditional compilation +MHD2_VERSION_AT_LEAST([2.0.0]) +@end verbatim + +The @code{MHD2_VERSION_AT_LEAST} is an M4 macro available in the +@code{mhd2.m4} file as part of the GNU libmicrohttpd2 library which +implements a test for the specific MHD version. You may need to copy +the @code{mhd2.m4} file into your @code{m4/} directory so that GNU +autoconf can find it. + +@cindex meson + +When using @code{Meson} as the buidl system, a dependency test +would typically look like this: + +@verbatim +mhd2_dep = dependency('libmicrohttpd2', required : false) +if not mhd2_dep.found() + mhd_dep2 = cc.find_library('microhttpd2', required : false) +endif +@end verbatim + +Adjust the @code{required} argument to +@code{true} if MHD2 is a mandatory dependency. + +Naturally, there are various variations of the above that +could be used to detect MHD2, so these are merely examples +to get started. + + +@node libmicrohttpd-include +@section Changes to includes +@cindex include + +The obvious change here is to change +@verbatim +#include <microhttpd.h> +@end verbatim + +to + +@verbatim +#include <microhttpd2.h> +@end verbatim + +However, there might be one more subtle consideration, which +is that in the previous version the @code{microhttpd.h} header +required the application to possibly include various system +header first. That requirement was lifted with MHD2, so this +could be an opportunity to review whether some other includes +are still necessary and possibly remove them. + +@node libmicrohttpd-constant-replacement +@section Global constants to migrate + +Globally, the following constants must be renamed. The +constants in this list are 1:1 replacements and thus +a simple global rename operation should be safe: + +@table @code +@item MHD_HEADER_KIND +must be replaced by @code{MHD_VK_HEADER}. + +@item MHD_COOKIE_KIND +must be replaced by @code{MHD_VK_COOKIE}. + +@item MHD_POSTDATA_KIND +must be replaced by @code{MHD_VK_POSTDATA}. + +@item MHD_FOOTER_KIND +must be replaced by @code{MHD_VK_FOOTER}. + +@item MHD_GET_ARGUMENT_KIND +must be replaced by @code{MHD_VK_GET_ARGUMENT}. +@c FIXME: under discussion to change away from GET! + +@item MHD_HTTP_REQUEST_ENTITY_TOO_LARGE +must be replaced by @code{MHD_HTTP_STATUS_CONTENT_TOO_LARGE}. + +@end table + + + + +@node libmicrohttpd-migrate-start-daemon +@section Changes to @code{MHD_start_daemon()} + +The main change to @code{MHD_start_daemon} is to rename the +call to @code{MHD_daemon_create}. The existing argument of +type @code{MHD_AccessHandlerCallback} should be changed +into the new @code{MHD_RequestCallback}. All other arguments +(explicit and from the varargs) +need to be set via @ref{MHD_DAEMON_SET_OPTIONS} and related +APIs. @xref{libmicrohttpd-daemon-options-setting} +Finally, after setting the options, the application +must call @ref{MHD_daemon_start}. Thus, the existing +@code{MHD_start_daemon} is replaced by three main calls: + +@itemize +@item @ref{MHD_daemon_create} +@item @ref{MHD_daemon_set_options} +@item @ref{MHD_daemon_start} +@end itemize + +There are a few minor changes to be made to the related API calls +to quiesce and destroy the daemon: the functions +@code{MHD_stop_daemon()} and @code{MHD_quiesce_daemon()} were renamed +to @code{MHD_daemon_destroy()} and @code{MHD_daemon_quiesce()} +respectively. Nevertheless, the behavior is completely unchanged, +so applications only need to rename the calls. + +@node libmicrohttpd-migrate-loop +@section Migrating an external event loop + +When migrating an external event loop, the first significant change +is that one must expicitly set an option with a callback for MHD +to call on changes to the set of watched sockets. Previously, the +event loop could query MHD using @code{MHD_get_fdset()} (and related +APIs). Now, the application must instead configure the daemon with +a callback: + +@verbatim + MHD_DAEMON_SET_OPTIONS ( + daemon, + MHD_D_OPTION_WM_EXTERNAL_EVENT_LOOP_CB_LEVEL ( + &socket_registration_update, + NULL)); +@end verbatim + +For our example, the application will define +@code{MHD_APP_SOCKET_CNTX_TYPE} to a @code{struct ScoketContext}. +Inside of that structure, the application will track its state for +the external event loop: + +@verbatim +#define MHD_APP_SOCKET_CNTX_TYPE struct SocketContext +#include <microhttpd2.h> + +struct SocketContext { + // Note: add other data specific to the event loop! + struct MHD_EventUpdateContext *ecb_cntx; + MHD_Socket fd; +}; +@end verbatim + +In the respective callback (here @code{socket_registration_update()}) +the application must then update its state for the event loop: + +@verbatim +static MHD_APP_SOCKET_CNTX_TYPE * +socket_registration_update ( + void *cls, + MHD_Socket fd, + enum MHD_FdState watch_for, + MHD_APP_SOCKET_CNTX_TYPE *app_cntx_old, + struct MHD_EventUpdateContext *ecb_cntx) +{ + struct SocketContext *sc; + + if (NULL == app_cntx_old) + { + sc = malloc (sizeof (struct SocketContext)); + sc->ecb_cntx = ecb_cntx; + sc->fd = fd; + } + else + { + sc = app_cntx_old; + } + if (MHD_FD_STATE_NONE == watch_for) + { + // clean up everything in 'app_cntx_old' + free (app_cntx_old); + return NULL; + } + if (MHD_FD_STATE_RECV & watch_for) + { + // Update 'app_cntx_old' to notify on read-ready + // (e.g. FD_SET (fd, readfds)) + } + else + { + // Update 'app_cntx_old' to not notify on read-ready + // (e.g. FD_CLEAR (fd, readfds)) + } + if (MHD_FD_STATE_SEND & watch_for) + { + // Update 'app_cntx_old' to notify on write-ready + // (e.g. FD_SET (fd, writefds)) + } + else + { + // Update 'app_cntx_old' to not notify on write-ready + // (e.g. FD_CLEAR (fd, writefds)) + } + if (MHD_FD_STATE_EXCEPT & watch_for) + { + // Update 'app_cntx_old' to notify on exceptions + // (e.g. FD_SET (fd, exceptfds)) + } + else + { + // Update 'app_cntx_old' to not notify on exceptions + // (e.g. FD_CLEAR (fd, exceptfds)) + } + return sc; +} +@end verbatim + +Finally, when the external event loop detects that the socket is +ready for some operation, it must then signal that the respective +operation is ready: + +@verbatim +struct SocketContext *sc = ...; + +MHD_daemon_event_update (daemon, + sc->ecb_cntx, + MHD_FD_STATE_RECV); +@end verbatim + +Naturally, @code{MHD_FD_STATE_RECV} should be replaced by the +correct set of operations that are ready. + +Finally, the application needs to take care to give MHD a chance +to actually process events. This must be done every time either +the global timeout expired, or @code{MHD_daemon_event_update()} +was called: + +@verbatim +void +run_daemon (void) +{ + uint_fast64_t next_max_wait; + + MHD_daemon_process_reg_events (daemon, + &next_max_wait)); + // wait next_max_wait *or* FD ready before calling + // again +} +@end verbatim + +There is a special case to consider, namely when +@var{next_max_wait} is set to @code{MHD_WAIT_INDEFINITELY} +then the timeout is "forever" and the application should only +wait on the socket states. + +A complete example for this type of external event loop migration +using the GNUnet event loop can be found at +@url{https://git.taler.net/exchange.git/tree/src/mhd}. Here, the +@file{mhd_run.c} file contains the MHD v1.0 logic, and @file{mhd2_run.c} +contains the equivalent MHD v2.0 logic. The external API of the +module is completely unchanged. + +@node libmicrohttpd-migrate-request-handling +@section Migrating request handling + +The first change to request handling is to replace all existing uses +of @code{struct MHD_Connection} with the new @code{struct +MHD_Request}. While @code{struct MHD_Connection} still exists in the +new API, it represents something else and thus legacy code should be +transformed by first changing all @code{struct MHD_Connection} to +@code{struct MHD_Request}. + +When inspecting the HTTP request, the following substitutions +should be made: + +@table @code +@item MHD_lookup_connection_value +replaced by @ref{MHD_request_get_value}; note the slight change +in the return value type. + +@end table + +Applications that previously used the +@var{req_cls} argument of the +@code{MHD_AccessHandlerCallback} must now use +@ref{MHD_REQUEST_INFO_FIXED_APP_CONTEXT} with +@ref{MHD_request_get_info_fixed} to get the +same @code{void **} from inside the +@ref{MHD_RequestInfoFixedData}. +@c FIXME: specify which member (to be renamed...) + + +@node libmicrohttpd-migrate-upload-handling +@section Migrating upload handling + +When handling requests with a body, previous code had to return +@code{MHD_YES} from the main callback on the first call and +then receive the upload data incrementally in subsequent calls. +In MHD2, the application must instead return an action +generated from calls to @ref{MHD_action_process_upload}, +@ref{MHD_action_process_upload_full}, or +@ref{MHD_action_process_upload_inc}. + +Explicitly checking the "Content-Length" request header to ensure +that the upload is not too big is no longer necessary as MHD +now provides the request body length explicitly to the main +callback. + +When returning a response from an upload, calls to +@code{MHD_queue_response} must be replaced by +returning the action created by +@code{MHD_upload_action_from_response}. + + +@node libmicrohttpd-migrate-suspend-handling +@section Migrating suspended requests handling + +Previous calls to @code{MHD_suspend_request} must be +replaced by returning an action from +@ref{MHD_action_suspend}, @ref{MHD_upload_action_suspend} +or @ref{MHD_DCC_action_suspend}. + +Previous calls to @code{MHD_resume_request} must be +replaced by calls to @ref{MHD_request_resume}. + + + +@node libmicrohttpd-migrate-response-generation +@section Migrating response generation + +The main change in response generation is that with MHD2 you +must always already provide the HTTP status code when creating +a response. Thus, functions that could previously merely create +the response from headers and body must be modified to also +take the HTTP status code. Also, previously applications +may have used a simple @code{unsigned int} to represent the +HTTP status code. This should be changed to the new +@code{enum MHD_HTTP_StatusCode}. + +The names for the HTTP status code constants changed, all constants +that started with @code{MHD_HTTP_} need to be updated to use the new +@code{MHD_HTTP_STATUS_} prefix. Note that this only applies +to the HTTP status constants: the constants starting with the +@code{MHD_HTTP_HEADER_} prefix must not be changed! + +Other than that, the main change is that the functions +to generate responses were renamed, the new functions +all start with @code{MHD_response_from_}. All previous +functions have a clear match in the new API. The following +table contains a short cheat-list: + +@table @code +@item MHD_add_response_header +replaced by @ref{MHD_response_add_header}; note the slight change +in the return value type (now @code{MHD_SC_OK} (aka 0) is returned +instead of @code{MHD_YES} (aka 1) for success). + +@item MHD_create_response_from_buffer +replaced by @ref{MHD_response_from_buffer} and convenience +wrappers @ref{MHD_response_from_buffer_static}, +@ref{MHD_response_from_buffer_copy}, +@ref{MHD_response_from_empty}. + +@item MHD_create_response_from_fd +replaced by @ref{MHD_response_from_fd} (with additional @var{offset} +argument). + +@end table + +Finally, to return a response, the call to @code{MHD_queue_response()} +will need to be replaced by a call to +@code{MHD_action_from_response()} or +@code{MHD_upload_action_from_response()} depending on which callback +is returning the response. After calling +@code{MHD_upload_action_from_response()} the calls to +@code{MHD_destroy_response()} should be removed, @emph{unless} +@ref{MHD_R_OPTION_REUSABLE} was set on the response. +Calls to @code{MHD_destroy_response()} on code paths that do not +lead to the response being turned into an action should be +replaced by @code{MHD_response_destroy()}. + +@node libmicrohttpd-migrate-post-processor +@section Migrating post processing + +The main change for post-processing is that instead of taking the +upload data from the main callback and incrementally feeding it into a +@code{struct MHD_PostProcessor}, the application should now simply +create a @ref{MHD_Action} via @ref{MHD_action_parse_post}. This +effectively combines creating the post processor, passing it the +uploaded data and receiving the results. The new API is more powerful, +so if the upload is known to be small enough (like for a simple HTML +form without file uploads) the application no longer needs to deal +with incremental value uploads and can simply inspect all uploaded +values in the @code{MHD_PostDataFinished} callback using +@ref{MHD_request_get_value} (and related APIs) with the +@code{MHD_VK_POSTDATA}. + + +@node libmicrohttpd-migrate-notifications +@section Changes to notification callbacks + +The @code{MHD_OPTION_NOTIFY_COMPLETED} was replaced +with the @code{MHD_R_OTION_TERMINATION_CALLBACK} which +must now be set on each request instead of once per +daemon. + + +@node libmicrohttpd-migrate-introspection +@section Changes to introspection calls + +These are pretty simple substitutions: + +@table @code +@item MHD_get_request_info +replaced by @ref{MHD_request_get_info_fixed} or +@ref{MHD_request_get_info_dynamic} depending on the +type of information requested + +@item MHD_RequestInfo +replaced by @ref{MHD_RequestInfoFixedData} or +@ref{MHD_RequestInfoDynamicData} depending on the +type of information requested + +@item MHD_REQUEST_INFO_ +replaced by @code{MHD_REQUEST_INFO_FIXED_} or +@code{MHD_REQUEST_INFO_DYNAMIC_} depending on the +type of information requested +@xref{libmicrohttpd2-info request,,request introspection} + +@item MHD_get_daemon_info +replaced by @ref{MHD_daemon_get_info_fixed} or +@ref{MHD_daemon_get_info_dynamic} depending on the +type of information daemoned + +@item MHD_DaemonInfo +replaced by @ref{MHD_DaemonInfoFixedData} or +@ref{MHD_DaemonInfoDynamicData} depending on the +type of information daemoned + +@item MHD_DAEMON_INFO_ +replaced by @code{MHD_DAEMON_INFO_FIXED_} or +@code{MHD_DAEMON_INFO_DYNAMIC_} depending on the +type of information daemoned. +@xref{libmicrohttpd2-info daemon, daemon introspection} + +@end table + +The @code{MHD_is_feature_supported} function is replaced by the new +@ref{libmicrohttpd2-info library,,library introspection} API. +\ No newline at end of file diff --git a/doc/manual/postprocessor.inc b/doc/manual/postprocessor.inc @@ -0,0 +1,370 @@ +@cindex POST +MHD provides the post processor API to make it easier for applications to +parse the data of a client's @code{POST} request that is encoded +in one of the typical formats for HTML form data. + +POST data can be processed in two main ways with MHD: +@itemize +@item incrementally, as it is received over the network +@item from memory with random access +@end itemize + +Incremental processing is necessary if the POSTed data does +not fit into main memory, while processing from memory with +random access is often more convenient and generally preferrable +for developers if the data fits into memory. MHD's API allows +the application to do both, even for the same request: the +application can specify how large of an in-memory buffer to +use with @var{buffer_size}, and then to provide a threshold +@var{max_nonstream_size} above which records will be processed +incementally. + +@node libmicrohttpd-postprocessor-start +@section Starting POST processing + +POST handling using this style is initiated by returning an action +created via @code{MHD_action_parse_post()} from +@ref{MHD_RequestCallback,,@code{MHD_RequestCallback}}. + +@anchor{MHD_action_parse_post} +@deftypefun {const struct MHD_Action *} MHD_action_parse_post (struct MHD_Request *request, size_t buffer_size, size_t max_nonstream_size, enum MHD_HTTP_PostEncoding enc, MHD_PostDataReader stream_reader, void *reader_cls, MHD_PostDataFinished done_cb, void *done_cb_cls) + +Creates an action to parse the POSTed content from the client. +The action starts parsing of the POST data. Any record that is larger +than @var{buffer_size} or @var{max_nonstream_size} is given to +the @var{stream_reader} (unless @var{stream_reader} is @code{NULL}). + +If @var{buffer_size} is zero, then buffers will be limited to the +connection's memory pool. To force all POST records to be processed +incrementally via @var{stream_reader} set @var{max_nonstream_size} to +zero. + +@table @var +@item request +the request to create a POST processing action for + +@item buffer_size +the maximum size allowed for the buffers to parse this +request POST data. Within the set limit the buffer is +allocated automatically from the @ref{shared memory pool} +if necessary. + +@item max_nonstream_size +the size of the field (in encoded form) above which +values are not buffered and provided for +the @var{steam_reader} automatically; +useful to have large data (like file uploads) +processed incrementally, while keeping buffer space +for small fields only; +ignored if @var{stream_reader} is @code{NULL} + +@item enc +the data encoding to use, +@code{MHD_HTTP_POST_ENCODING_OTHER} to tell MHD +to detect the encoding automatically (based on HTTP headers); + +@item stream_reader +a function to call for ``oversize'' records in +the stream; can be @code{NULL} if @var{max_nonstream_size} +is not zero; + +@item reader_cls +the closure for the @var{stream_reader}; + +@item done_cb called once all data has been processed, returning +control back to the application to determine the next action; values +smaller than @var{max_nonstream_size} that fit into @var{buffer_size} +will be available during @var{done_cb} via +@ref{MHD_request_get_values_cb,,@code{MHD_request_get_values_cb()}} +and +@ref{MHD_request_get_values_list,,@code{MHD_request_get_values_list()}}, +@ref{MHD_request_get_post_data_cb,,@code{MHD_request_get_post_data_cb()}} +and +@ref{MHD_request_get_post_data_list,,@code{MHD_request_get_post_data_list()}}. + +@item done_cb_cls +the closure for the @var{done_cb} + +@end table + +Returns a pointer to the action, @code{NULL} if creating the action +failed (insufficient memory) or if any action has been already created +for the @var{request}. + +@end deftypefun + +@node libmicrohttpd-postprocessor-incremental +@section Incremental record processing + + +After returning the action created via @code{MHD_action_parse_post} +MHD will first call the given @code{MHD_PostDataReader} for incremental +processing of all records that exceed the length threshold. + +@anchor{MHD_PostDataReader} +@deftypefn {Function Pointer} {enum MHD_Bool} (*MHD_PostDataReader) (void *cls, struct MHD_Request *req, const struct MHD_String *name, const struct MHD_StringNullable *filename, const struct MHD_StringNullable *content_type, const struct MHD_StringNullable *encoding, size_t size, const void *data, uint_fast64_t off, enum MHD_Bool final_data) + +Stream reader for incremental processing of POST records. This +callback is called to incrementally process parsed POST records sent +by the client. The pointers to the @code{struct MHD_String} and +@code{struct MHD_StringNullable} are valid @emph{only} until the +application returns from this callback. + +@table @var +@item cls +custom value provided by the application with the callback; + +@item request +the request to get data for; + +@item name +the name of the POST record; + +@item filename +the name of the uploaded file, @code{NULL} if not provided; + +@item content_type +the mime-type of the data, @code{NULL} if not provided; + +@item encoding +the encoding of the data, @code{NULL} if not provided; + +@item size +the number of bytes in @var{data}, may be zero if @var{final_data} +is @code{MHD_YES}; + +@item data +a pointer to @var{size} bytes of data at the specified +offset @var{off}, @strong{not} zero-terminated; + +@item off +the offset of @var{data} in the overall value, always equal to +the sum of all @var{size} values of previous calls for the same +record; however, note that a client may provide more than one +record with the same @var{name} and the same @var{filename}! Thus +the next record (or file) may be indicated by a zero +value in @var{off} (and the end is indicated by @var{final_data}); + +@item final_data +set to @code{MHD_YES} when this is the last call for the given +record, set to @code{MHD_NO} if additional callbacks for the same +record will be made; + +@end table + +The incremental callback must specify how to continue processing +the upload. The choices are: + +@itemize +@item @code{MHD_upload_action_continue()} if all is well, +@item @code{MHD_upload_action_suspend()} to stop reading from the client + until the request is explicitly resumed by the application, +@item @code{MHD_upload_action_abort_request()} to close the socket, or +@item an action with a response to @emph{discard} the rest of the + upload and transmit the response. +@end itemize + +@end deftypefn + +@node libmicrohttpd-postprocessor-final +@section Final in-memory processing of parsing status and records + +After all large records have been provided to the +@code{MHD_PostDataReader} and MHD has concluded parsing the entire +body sent by the client, MHD will call the @var{done_cb} to give the +application a chance to inspect the records that were small enough to +fit fully into memory and to decide the next action. + +@anchor{MHD_PostDataFinished} +@deftypefn {Function Pointer} {struct MHD_UploadAction} (*MHD_PostDataFinished) (void *cls, struct MHD_Request *req, const struct MHD_PostParseResult *parsing_result) + +The callback to be called when MHD is finished with parsing +all of the body. The @var{stream_reader} will not be called +after this call. Implementations of this function can +use +@ref{MHD_request_get_values_cb,,@code{MHD_request_get_values_cb()}} +and +@ref{MHD_request_get_values_list,,@code{MHD_request_get_values_list()}}, +@ref{MHD_request_get_post_data_cb,,@code{MHD_request_get_post_data_cb()}} +and +@ref{MHD_request_get_post_data_list,,@code{MHD_request_get_post_data_list()}} +to inspect the non-incremental POST data and must ultimately +return an action that determines how to continue handling the +request. + +@table @var +@item cls +custom value provided by the application with the callback; + +@item request +the request to get data for; + +@item parsing_result +status of parsing the request body. +@end table +@end deftypefn + +@deftp {Enumeration} MHD_PostParseResult + +Represents possible outcomes of parsing a client's body. + +@table @code +@item MHD_POST_PARSE_RES_OK +The POST data parsed successfully and completely. + +@item MHD_POST_PARSE_RES_REQUEST_EMPTY +The request had no content or zero-length content. + +@item MHD_POST_PARSE_RES_OK_BAD_TERMINATION +The POST data parsed successfully, but has missing or incorrect +termination. The last record parsed may thus have incorrect +or incomplete data. + +@c FIXME: did I get the distinction right? It is a bit fuzzy. Do we need to distinguish this from the previous case? +@item MHD_POST_PARSE_RES_PARTIAL_INVALID_POST_FORMAT +Parsing of the POST data is definitively incomplete because the client +sent an incorrectly formatted body. The last record parsed has +incorrect or incomplete data. +Some POST data is available or has been provided via callback. + +@item MHD_POST_PARSE_RES_FAILED_NO_POOL_MEM +The POST data cannot be parsed completely because the stream has +not enough free memory in the pool. Some POST data may have been parsed. + +@item MHD_POST_PARSE_RES_FAILED_NO_LARGE_BUF_MEM +The POST data could not be parsed completely because not +enough large shared buffer space was available. +Some POST data may have been parsed. + +@item MHD_POST_PARSE_RES_FAILED_UNKNOWN_CNTN_TYPE +The POST data could not be parsed because the +``Content-Type:'' specified is not understood by MHD. + +@item MHD_POST_PARSE_RES_FAILED_NO_CNTN_TYPE +The POST data cannot be parsed because the +``Content-Type:'' header was not set by the clients. +Applications can sometimes work around this by explicitly +setting @var{enc} when calling @code{MHD_action_parse_post()} +if they see that the ``Content-Type'' was omitted and +they know what it is. + +@item MHD_POST_PARSE_RES_FAILED_HEADER_NO_BOUNDARY +The POST data cannot be parsed because ``Content-Type:'' +request header lacks the required ``boundary'' parameter for +``multipart/form-data''. + +@item MHD_POST_PARSE_RES_FAILED_HEADER_MISFORMED +The POST data cannot be parsed because +``Content-Type: multipart/form-data'' +request header is malformed. + +@item MHD_POST_PARSE_RES_FAILED_HEADER_NOT_MPART +The application set POST encoding to ``multipart/form-data'' +via @var{enc}, but the request has no ``Content-Type: multipart/form-data'' +header which is required to find the ``boundary'' used in this encoding. + +@item MHD_POST_PARSE_RES_FAILED_INVALID_POST_FORMAT +The POST data cannot be parsed because the client's upload +did not abide by the format specified for the POST encoding. + +@end table +@end deftp + +Once the @code{MHD_action_parse_post()} has called the @var{done_cb}, +the application can use the following functions to access the records +that MHD could fit into memory. + +@anchor{MHD_request_get_post_data_cb} +@deftypefun size_t MHD_request_get_post_data_cb (struct MHD_Request *request, struct MHD_PostDataIterator *iterator, void *iterator_cls) + +Call @var{iterator} on all of the post data from the @var{request}. + +@table @var +@item request +the request to get data for + +@item iterator +callback to call on each header; +can be @code{NULL} (then this function will simply just count the records); + +@item iterator_cls +extra argument to pass to @var{iterator} +@end table + +Returns the number of entries iterated over, zero if no records were +available or a postprocessor was not used with @var{request}. +@end deftypefun + +@c FIXME: "Field" is probably a bad name, I think we should change it to "Record" everywhere in the API +@anchor{MHD_PostDataIterator} +@deftypefn {Function Pointer} {enum MHD_Bool} (*MHD_PostDataIterator) (void *cls, const struct MHD_PostField *data) + +Iterator over POST data. The @var{data} pointer is valid only until +the application returns from this function. However, the pointers to +the strings in @var{data} remain valid until any @code{struct +MHD_UploadAction} is provided. If any data is needed beyond this +point, it should be copied into an application-managed buffer. + +@table @var +@item cls +custom value provided by the application with the callback; + +@item data +one data record from the body +@end table + +The callback must return @code{MHD_YES} to continue iterating +or @code{MHD_NO} to abort the iteration. +@end deftypefn + + +@deftp {C Struct} MHD_PostField name value filename content_type transfer_encoding + +Post data record. If any member is not provided/set then pointer to C string is @code{NULL}. If any member is set to empty string then pointer to C string not @code{NULL}, but the @var{len} is zero. + +@table @var +@item @code{struct MHD_String} name +The name of the record; + +@item @code{struct MHD_StringNullable} value +The record's main value; + +@item @code{struct MHD_StringNullable} filename +The filename if provided (only for ``multipart/form-data''); + +@item @code{struct MHD_StringNullable} content_type +The Content-Type if provided (only for "multipart/form-data"); + +@item @code{struct MHD_StringNullable} transfer_encoding +The Transfer-Encoding if provided (only for ``multipart/form-data''). + +@end table +@end deftp + +Alternatively, the application can use +@code{MHD_request_get_post_data_cb} to just count the number of +records and obtain all records without iterating by providing +space for the @var{elements} itself and using +@code{MHD_request_get_post_data_list()}. + + +@anchor{MHD_request_get_post_data_list} +@deftypefun size_t MHD_request_get_post_data_list (struct MHD_Request *request, size_t num_elements, struct MHD_PostField elements[num_elements]) + +Stores all of the post records from the @var{request} in @var{elements}. + +@table @var +@item request +the request to get data for + +@item num_elements +the number of elements in the @var{elements} array + +@item elements +an array of @var{num_elements} where to store the POST records +@end table + +Returns the number of elements stored in @var{elements}, +zero if no data was stored or a postprocessor was not +used with @var{request}. +@end deftypefun diff --git a/doc/manual/requests.inc b/doc/manual/requests.inc @@ -0,0 +1,654 @@ +A @code{struct MHD_Request} is given by MHD to the application +to refer to an individual HTTP request by a client. Applications +primarily are given a request handle as part of the arguments given +to the central @ref{MHD_RequestCallback,,@code{MHD_RequestCallback}} +of each @code{struct MHD_Daemon}. + +@deftp {C Struct} MHD_Request +Handle representing an HTTP request. + +With HTTP/1.1, multiple requests can be run over the same +stream. However, MHD will only show one request per data +stream to the application at any given time. +@end deftp + +This chapter discusses how to inspect the information +from the request @emph{header}. +@xref{libmicrohttpd-actions-upload} for handling data uploaded +by HTTP clients in the body of a request. + + +@node libmicrohttpd-requests-info +@section Inspecting request name-value pairs + +When inspecting requests, MHD classifies values from a client's +request into various @emph{kinds} of values. The different kinds +are represented by the @code{enum MHD_ValueKind}. + +@anchor{MHD_ValueKind} +@deftp {Enumeration} MHD_ValueKind +@cindex header +@cindex kind + +Specifies the source of the name-value pairs in the HTTP protocol. + +@table @code +@item MHD_VK_HEADER +HTTP header (single line in the header). + +@item MHD_VK_COOKIE +Cookies. Note that the original HTTP header containing +all the cookie(s) is also available via @code{MHD_VK_HEADER}. + +@item MHD_VK_URL_ARGUMENT +URL arguments (often called "GET" parameters, but not actually limited to the HTTP GET method). + +@item MHD_VK_POSTDATA +POST data. +This is available only if @ref{MHD_action_parse_post,,@code{MHD_action_parse_post()}} is used, +the body's content encoding is supported by MHD, and only if the posted content +fits within the specified memory buffers. + +@cindex Transfer-Encoding +Warning: The encoding ``multipart/form-data'' has more fields than just +``name'' and ``value'' which are not available via the APIs discussed +in this chapter. @xref{MHD_request_get_post_data_cb} and +@ref{MHD_request_get_post_data_list,,@code{MHD_request_get_post_data_list()}} for more information. +In particular it could be important +to check the ``Transfer-Encoding''. + +@item MHD_VK_FOOTER +Data from client request HTTP footer (only for HTTP 1.1 chunked encodings). + +@item MHD_VK_HEADER_OR_FOOTER +Values from both the HTTP header or footer. + +@item MHD_VK_URL_OR_POST +Values from URL arguments or post data. + +@end table +@end deftp + +Given a value @var{kind} (or possibly a bitmask combining different +kinds), MHD offers various ways to access values from of that kind +for a given @var{request}. + +@c FIXME: why int? what would negative values be used for? +@anchor{MHD_request_get_values_cb} +@deftypefun int MHD_request_get_values_cb (struct MHD_Request *request, enum MHD_ValueKind kind, MHD_NameValueIterator iterator, void *iterator_cls) +Get all the headers matching @var{kind} from the request. + +@table @var +@item request +the HTTP request to inspect; + +@item kind +kinds of name-value pairs of the request to pass to @var{iterator}, +can be a bitmask, ORing the various header kinds that are requested +(@xref{MHD_ValueKind}); + +@item iterator +This callback function is invoked once for each header, with +@var{iterator_cls} as first argument. The +headers are iterated in the same order as they were received from +the network. +@var{iterator} can be @code{NULL}: in this case this function just counts +and returns the number of headers; + +@item iterator_cls +closure argument for @var{iterator}. +@end table + +The function returns the number of entries +iterated over; this can be less than the number of headers if, while +iterating, @var{iterator} returns @code{MHD_NO}. +@end deftypefun + +@var{iterator}s implementing the @code{MHD_NameValueIterator} +are simply given the specific @var{kind} and name-and-value pair. + +@c FIXME: why don't we use NameValueKind here? +@anchor{MHD_NameValueIterator} +@deftypefn {Function Pointer} {enum MHD_Bool} (*MHD_NameValueIterator) (void *cls, enum MHD_ValueKind kind, const struct MHD_NameAndValue *nv) + +Functions of this type are invoked by MHD for each matching +name-value pair. + +@table @var +@item cls +custom closure provided by the application to @code{MHD_request_get_values_cb()}; + +@item kind +the type (kind) of the element; will only have one bit set +(@xref{MHD_ValueKind}); + +@item nv +the name and the value of the element, +the referenced data is valid only until the +application returns from this function. +@end table +The function should return @code{MHD_YES} to continue to +iterate, and @code{MHD_NO} to abort the iteration. +@end deftypefn + + +@anchor{MHD_NameAndValue} +@deftp {C Struct} MHD_NameAndValue name value +Represents a pair of a name and a value. +@table @code +@item @code{struct MHD_String} name +Name under which the value is stored, some kinds allow empty strings; + +@item @code{struct MHD_StringNullable} value +The value of the field. Some kinds allow absence of the value; +the absence is indicated by a @code{NULL} pointer to the C string. +@c FIXME: We need to be clearer if value is NULL or cstr is NULL! +@end table +@end deftp + +@c FIXME: rename GET -> URL? +If @var{kind} is @code{MHD_VK_GET_ARGUMENT}, the @var{value} argument +given to the @var{iterator} callback will be @code{NULL} if the URL +contained a key without an equals operator. +For example, for a HTTP request to the URL ``http://foo/bar?key'', the +@var{value} argument is @code{NULL}; in contrast, a HTTP request to the URL +``http://foo/bar?key='', the @var{value} argument is the empty string. +The normal case is that the URL contains ``http://foo/bar?key=value'' +in which case @var{value} would be the string ``value'' and @var{key} +would contain the string ``key''. + + +@c FIXME: why int? what would negative values be used for? +@anchor{MHD_request_get_values_list} +@deftypefun int MHD_request_get_values_list (struct MHD_Request *request, enum MHD_ValueKind kind, size_t num_elements, struct MHD_NameValueKind elements[num_elements]) +Get all the headers matching @var{kind} from the request. + +The pointers to the strings returned in @var{elements} are valid until +any @code{struct MHD_Action} or @code{struct MHD_UploadAction} is +provided for the @var{request}. If the data is needed beyond this +point, it should be copied to an application buffer before returning +an action. + +@table @var +@item request +the HTTP request to inspect; + +@item kind +kinds of name-value pairs of the request to pass to @var{iterator}, +can be a bitmask, ORing the various header kinds that are requested; + +@item num_elements +length of the @var{elements} array provided + +@item elements +array of length @var{num_elements} to be filled with +the key-value pairs; if @var{request} has more matching elements +than @var{num_elements} than any @var{num_elements} are stored. +@end table + +The function returns the number of entries +stored in @var{elements}, the number cannot be larger +than @var{num_elements}, zero if there were no matching +elements or on any error. +@end deftypefun + +@anchor{MHD_NameValueKind} +@deftp {C Struct} MHD_NameValueKind nv kind +Represents a triplet of a name, value and kind. +@table @code +@item @code{struct MHD_NameAndValue} nv +The name and value of the field +(@xref{MHD_NameAndValue}); + +@item @code{struct MHD_ValueKind} kind +The kind of the field +(@xref{MHD_ValueKind}). +@end table +@end deftp + +@anchor{MHD_request_get_value} +@deftypefun {const struct MHD_StringNullable *} MHD_request_get_value (struct MHD_Connection *connection, enum MHD_ValueKind kind, const char *key) + +Returns a particular data value from a @var{request}. + +@table @var +@item request +the HTTP request to inspect; + +@item kind +kinds of name-value pairs of the request to pass to @var{iterator}, +can be a bitmask, ORing the various header kinds that are requested +(@xref{MHD_ValueKind}); + +@item key +the name of the value to look for (used for case-insensitive +match), use an empty string to lookup 'trailing' values without a key; +@var{key} must reference a zero-terminated ASCII-coded string +representing the value to look for. +@end table +The function returns @code{NULL} if no matching item was found. +If multiple values match the +@var{kind} and @var{key}, returns the first of them. +@end deftypefun + + +The following code is a simple example to determine the +value of a ``Host:'' header. + +@example +@verbatiminclude examples/host-example.c +@end example + + + +@node libmicrohttpd-requests-info +@section Obtaining request status information + +This section describes the request introspection API. It follows the +same patterns as the other introspection APIs described in +@ref{libmicrohttpd2-introspection,,Introspecting MHD objects}. You +may want to refer to the introduction of that chapter for an overview +on MHD introspection. + +@anchor{MHD_request_get_info_fixed_sz} +@deftypefun {enum MHD_StatusCode} MHD_request_get_info_fixed_sz (struct MHD_Request *request, enum MHD_RequestInfoFixedType info_type, union MHD_RequestInfoFixedData *output_buf, size_t output_buf_size) + +Obtain fixed information about the given request. +This information is not changed for the lifetime of the request. + +@table @var +@item request +the request to get information about; + +@item info_type +the type of information requested; + +@item output_buf +output_buf the pointer to union to be set to the requested +information; + +@item output_buf_size +size of @var{output_buf} in bytes +@end table + +The function returns: +@table @code +@item MHD_SC_OK +on success, +@c FIXME: can we really have TOO_EARLY/TOO_LATE for *fixed* data? + +@item MHD_SC_TOO_EARLY +if the information is not yet available, +usually because the respective stage in processing was not yet reached, + +@item MHD_SC_TOO_LATE +if the information is no longer available, +usually because processing is past the stage where the information is kept, + +@item MHD_SC_INFO_GET_TYPE_UNKNOWN +if @var{info_type} is unknown, + +@item MHD_SC_INFO_GET_TYPE_NOT_APPLICABLE +if the requested information is not available for this specific +object due to how that object was configured, + +@item MHD_SC_INFO_GET_TYPE_UNOBTAINABLE +if the requested information should be available +but cannot be provided due to some error or other reason, + +@item MHD_SC_INFO_GET_BUFF_TOO_SMALL +if @var{output_buf} is too small for this request; +@end table +specific @var{info_type} values may yield additional +type-specific error codes. +@end deftypefun + +Using the above function directly is not recommended. +Instead, applications should use @code{MHD_request_get_info_fixed()} +which is more convenient as it uses a macro to automatically +provide the @var{output_buf_size}. + +@anchor{MHD_request_get_info_fixed} +@deftypefun {enum MHD_StatusCode} MHD_request_get_info_fixed (struct MHD_Request *request, enum MHD_RequestInfoFixedType info_type, union MHD_RequestInfoFixedData *output_buf) + +Obtain fixed information about the given request. +This information is not changed for the lifetime of the request. + +@table @var +@item request +the request to get information about; + +@item info_type +the type of information requested; + +@item output_buf +output_buf the pointer to union to be set to the requested +information; +@end table + +The macro returns the same values as +@code{MHD_request_get_info_fixed_sz()} +@end deftypefun + + +@deftp {Enumeration} MHD_RequestInfoFixedType +Selects which fixed information about the request is desired. + +@table @code +@anchor{MHD_REQUEST_INFO_FIXED_HTTP_VER} +@item MHD_REQUEST_INFO_FIXED_HTTP_VER +Get the version of HTTP protocol used for the request. +If the request line has not been fully received yet then @code{MHD_SC_TOO_EARLY} +is returned. +The result is placed in the @var{v_http_ver} member of @var{output_buf}. + +@anchor{MHD_REQUEST_INFO_FIXED_HTTP_METHOD} +@item MHD_REQUEST_INFO_FIXED_HTTP_METHOD +Get the HTTP method used for the +request (as an @ref{MHD_HTTP_Method}). +The result is placed in @var{v_http_method} member. +@xref{MHD_REQUEST_INFO_DYNAMIC_HTTP_METHOD_STR}. + +@item MHD_REQUEST_INFO_FIXED_DAEMON +Return the daemon to which the request belongs to. +The result is placed in the @var{v_daemon} member of @var{output_buf}. + +@item MHD_REQUEST_INFO_FIXED_CONNECTION +Return which connection is associated with the stream which is associated +with the request. The result is placed in the @var{v_connection} member of @var{output_buf}. + +@item MHD_REQUEST_INFO_FIXED_STREAM +Return which stream the request is associated with. +The result is placed in the @var{v_stream} member of @var{output_buf}. + +@anchor{MHD_REQUEST_INFO_FIXED_APP_CONTEXT} +@item MHD_REQUEST_INFO_FIXED_APP_CONTEXT +Returns the pointer to a variable pointing to request-specific +application context data. The same data is provided for +@ref{MHD_EarlyUriLogCallback,,@code{MHD_EarlyUriLogCallback}} and +@ref{MHD_RequestTerminationCallback,,@code{MHD_RequestTerminationCallback}}. +By using provided pointer application may get or set the pointer to +any data specific for the particular request. +The result is placed in the @var{v_ppvoid} member of @var{output_buf}. + +@end table +@end deftp + +@c FIXME: define MHD_RequestTerminationCallback! + +@anchor{MHD_RequestInfoFixedData} +@deftp {C Union} MHD_RequestInfoFixedData + +Fixed information about a request. +This information will not change during the lifetime of the request. + +@table @var +@item @code{struct MHD_Stream *} v_stream +The stream of the request. + +@item @code{struct MHD_Connection *} v_connection +The connection of the request. + +@item @code{struct MHD_Daemon *} v_daemon +The daemon handling the request. + +@item @code{enum MHD_HTTP_ProtocolVersion} v_http_ver +The HTTP protocol version used for the request. + +@item @code{enum MHD_HTTP_Method} v_http_method +The HTTP method of the request. + +@item @code{void **} v_ppvoid +The pointer to a pointer where the application can store +contextual data for the request. +@end table +@end deftp + + +@anchor{MHD_request_get_info_dynamic_sz} +@deftypefun {enum MHD_StatusCode} MHD_request_get_info_dynamic_sz (struct MHD_Request *request, enum MHD_RequestInfoDynamicType info_type, union MHD_RequestInfoDynamicData *output_buf, size_t output_buf_size) + +Obtain dynamic information about the given request. +This information may be changed during the lifetime of the request. +Most of the data provided is available only after the request line or even the complete +request headers have been processed. Data may also be no longer available once MHD +has started to return the response. + +Any pointers in the returned data are only valid until any +@code{struct MHD_Action} or @code{struct MHD_UploadAction} is +returned to MHD. If the returned data is needed beyond this point, +it should be copied into an application buffer before returning an +action. + +@table @var +@item request +the request to get information about; + +@item info_type +the type of information requested; + +@item output_buf +output_buf the pointer to union to be set to the requested +information; + +@item output_buf_size +size of @var{output_buf} in bytes; +@end table + +The function returns +@table @code +@item MHD_SC_OK +on success, +@c FIXME: can we really have TOO_EARLY/TOO_LATE for *fixed* data? + +@item MHD_SC_TOO_EARLY +if the information is not yet available, +usually because the respective stage in processing was not yet reached, + +@item MHD_SC_TOO_LATE +if the information is no longer available, +usually because processing is past the stage where the information is kept, + +@item MHD_SC_INFO_GET_TYPE_UNKNOWN +if @var{info_type} is unknown, + +@item MHD_SC_INFO_GET_TYPE_NOT_APPLICABLE +if the requested information is not available for this specific +object due to how that object was configured, + +@item MHD_SC_INFO_GET_TYPE_UNOBTAINABLE +if the requested information should be available +but cannot be provided due to some error or other reason, + +@item MHD_SC_INFO_GET_BUFF_TOO_SMALL +if @var{output_buf} is too small for this request; +@end table +specific @var{info_type} values may yield additional +type-specific error codes. +@end deftypefun + +Using the above function directly is not recommended. +Instead, applications should probably use +@code{MHD_request_get_info_dynamic()} +which is more convenient as it uses a macro to automatically +provide the @var{output_buf_size}. + +@anchor{MHD_request_get_info_dynamic} +@deftypefun {enum MHD_StatusCode} MHD_request_get_info_dynamic (struct MHD_Request *request, enum MHD_RequestInfoDynamicType info_type, union MHD_RequestInfoDynamicData *output_buf) + +Obtain fixed information about the given request. +This information is not changed for the lifetime of the request. + +@table @var +@item request +the request to get information about; + +@item info_type +the type of information requested; + +@item output_buf +output_buf the pointer to union to be set to the requested +information; +@end table + +The macro returns the same values as +@code{MHD_request_get_info_dynamic_sz()} +@end deftypefun + + +@anchor{MHD_RequestInfoDynamicType} +@deftp {Enumeration} MHD_RequestInfoDynamicType + +Selects what dynamic information about request is desired. +This information may be changed during the lifetime of the request. +Any returned string pointers are valid only until a response is +provided for the request by the application! + +@c FIXME: fix member names in C code, use semantic names, not type-names! +@table @code + +@anchor{MHD_REQUEST_INFO_DYNAMIC_HTTP_METHOD_STR} +@item MHD_REQUEST_INFO_DYNAMIC_HTTP_METHOD_STR +Get the HTTP method used for the request (as a MHD_String). +The result is placed in @var{v_str} member. +The resulting string pointer is valid only until a response is provided. +@xref{MHD_REQUEST_INFO_FIXED_HTTP_METHOD} + +@item MHD_REQUEST_INFO_DYNAMIC_URI +Get the URI used for the request (as a MHD_String), excluding +the parameter part (anything after '?'). +The result is placed in the @var{v_str} member. +The resulting string pointer in valid only until a response is provided. + +@item MHD_REQUEST_INFO_DYNAMIC_NUMBER_GET_PARAMS +Get the number of GET parameters (the decoded part of the original +URI string after '?') +The result is placed in the @var{v_sizet} member. + +@item MHD_REQUEST_INFO_DYNAMIC_NUMBER_COOKIES +Get the number of cookies in the request. +The result is placed in the @var{v_sizet} member. + +@item MHD_REQUEST_INFO_DYNAMIC_HEADER_SIZE +Return length of the client's HTTP request header. +This is a total raw size of the plaintext header. +The result is placed in the @var{v_sizet} member. + +@item MHD_REQUEST_INFO_DYNAMIC_NUMBER_POST_PARAMS +Get the number of decoded POST entries in the request. +The result is placed in the @var{v_sizet} member. + +@item MHD_REQUEST_INFO_DYNAMIC_UPLOAD_PRESENT +Get whether the upload content is present in the request. +The result is @code{MHD_YES} if any upload content is present, even +if the upload content size is zero. +The result is placed in the @var{v_bool} member. + +@item MHD_REQUEST_INFO_DYNAMIC_UPLOAD_CHUNKED +Get whether the chunked upload content is present in the request. +The result is @code{MHD_YES} if chunked upload content is present. +The result is placed in the @var{v_bool} member. + +@item MHD_REQUEST_INFO_DYNAMIC_UPLOAD_SIZE_TOTAL +Get the total request body size. +Results in zero if no body is expected to be uploaded, +@code{MHD_SIZE_UNKNOWN} if the size is not known +(for example, in the case of a chunked upload). +The result is placed in the @var{v_uint64} member. + +@item MHD_REQUEST_INFO_DYNAMIC_UPLOAD_SIZE_RECIEVED +Get the total size of the content upload already received from the client. +This is the total size received, it is possible that some of it has +not yet been seen or fully processed by the application. +The result is placed in the @var{v_uint64} member. + +@item MHD_REQUEST_INFO_DYNAMIC_UPLOAD_SIZE_TO_RECIEVE +Get the total size of the content upload left to be received from +the client. +Results in @code{MHD_SIZE_UNKNOWN} if total size is not known +(for example, in case of a chunked upload). +The result is placed in the @var{v_uint64} member. + +@item MHD_REQUEST_INFO_DYNAMIC_UPLOAD_SIZE_PROCESSED +Get the total size of the content upload already processed (upload callback +called and completed (if any)). +If the value is requested from @code{MHD_UploadCallback}, then result does @emph{not} +include the data currently being processed by the callback. +The result is placed in the @var{v_uint64} member. + +@item MHD_REQUEST_INFO_DYNAMIC_UPLOAD_SIZE_TO_PROCESS +Get the total size of the content upload left to be processed. +The resulting value includes the size of the data not yet received from +the client. +If the value is requested from @code{MHD_UploadCallback}, then result includes +the current data being processed by the callback. +Resulted in @code{MHD_SIZE_UNKNOWN} if total size is not +known (for example, in the case of a chunked upload). +The result is placed in the @var{v_uint64} member. + +@c FIXME: should this not be removed? +@item MHD_REQUEST_INFO_DYNAMIC_AUTH_DIGEST_USERNAME +Returns pointer to information about username in client's digest auth +request. +The resulting pointer is @code{NULL} if no digest auth header is set by +the client, the format of the digest auth header is broken, no +username is provided or the format of the username parameter is broken. +Pointers in the returned structure (if any) are valid until response +is provided for the request. +The result is placed in the @var{v_auth_digest_uname} member. + +@anchor{MHD_REQUEST_INFO_DYNAMIC_AUTH_DIGEST_INFO} +@item MHD_REQUEST_INFO_DYNAMIC_AUTH_DIGEST_INFO +Returns pointer to information about digest auth in client request. +The resulting pointer is @code{NULL} if no digest auth header is set by +the client or the format of the digest auth header is broken. +Pointers in the returned structure (if any) are valid until response +is provided for the request. +The result is placed in the @var{v_auth_digest_info} member. + +@anchor{MHD_REQUEST_INFO_DYNAMIC_AUTH_BASIC_CREDS} +@item MHD_REQUEST_INFO_DYNAMIC_AUTH_BASIC_CREDS +Returns information about Basic Authentication credentials in the request. +Pointers in the returned structure (if any) are valid until +any @code{struct MHD_Action} or @code{struct MHD_UploadAction} +is provided. If the data is needed beyond this point, +it must be copied to an application buffer before providing the action. +If @code{MHD_request_get_info_dynamic_sz()} returns @code{MHD_SC_OK} then +@var{v_auth_basic_creds} is not @code{NULL} and at least the username +is provided. +The result is placed in the @var{v_auth_basic_creds} member. +@end table +@end deftp + + +@c FIXME: again, we should use semantic names, not type-based names! +@anchor{MHD_RequestInfoDynamicData} +@deftp {C Union} MHD_RequestInfoDynamicData +Stores dynamic information about a request. + +@table @var +@item @code{struct MHD_String} v_str +Used when the requested information is a string. + +@item @code{size_t} v_sizet +Used when the requested information is a size. + +@item @code{enum MHD_Bool} v_bool +Used when the requested information is a boolean. + +@item @code{uint_fast64_t} v_uint64 +Used when the requested information is an unsigned 64-bit integer. + +@item @code{const struct MHD_AuthDigestUsernameInfo *} v_auth_digest_uname +Information about client-provided username for digest authentication. + +@item @code{const struct MHD_AuthDigestInfo *} v_auth_digest_info +Information about client's digest authentication. + +@item @code{const struct MHD_AuthBasicCreds *} v_auth_basic_creds +The username and password provided by the client's basic authentication header. +If @code{MHD_request_get_info_dynamic_sz()} returns +@code{MHD_SC_OK} then this pointer is not @code{NULL} and +at least the @var{username} is provided. +@end table +@end deftp diff --git a/doc/manual/response_options.inc b/doc/manual/response_options.inc @@ -0,0 +1,282 @@ +@node libmicrohttpd-response-performance +@subsection Response options for performance optimization + +@anchor{MHD_R_OPTION_REUSABLE} +@deftypefun {struct MHD_ResponseOptionAndValue} MHD_R_OPTION_REUSABLE () + +Make the response object re-usable. +The response will not be consumed by +@ref{MHD_action_from_response,,@code{MHD_action_from_response()}} +and must be destroyed by +@ref{MHD_response_destroy,,@code{MHD_response_destroy()}} +Useful if the same response is repeatedly used. +@table @var +@end table + +Returns the option to pass to @code{MHD_response_set_options()}. +@end deftypefun + +@anchor{MHD_R_OPTION_HEAD_ONLY_RESPONSE} +@deftypefun {struct MHD_ResponseOptionAndValue} MHD_R_OPTION_HEAD_ONLY_RESPONSE () + +Enable special processing of the response as body-less (with undefined +body size). No automatic "Content-Length" or "Transfer-Encoding: +chunked" headers are added when the response is used with +@code{MHD_HTTP_STATUS_NOT_MODIFIED} code or to respond to HEAD +requests. + +The flag also allows applications to set an arbitrary "Content-Length" +header using +@ref{MHD_response_add_header,,@code{MHD_response_add_header()}}. +This flag value can be used only with responses created with a body of +zero length. + +Responses with this flag enabled cannot be used in situations where a +response body must be sent to the client. This flag is primarily +intended to be used when automatic "Content-Length" header computation +by MHD is undesirable in response to HEAD requests. + +@table @var + +@end table + +Returns the option to pass to @code{MHD_response_set_options()}. +@end deftypefun + + + +@node libmicrohttpd-response-compatibility +@subsection Response options to help with compatibility + + +@anchor{MHD_R_OPTION_CONN_CLOSE} +@deftypefun {struct MHD_ResponseOptionAndValue} MHD_R_OPTION_CONN_CLOSE () + +Force MHD to close the connection after sending the response, +prevents keeping connections alive and adds a "Connection: close" header. + +Returns the option to pass to @code{MHD_response_set_options()} +@end deftypefun + +@deftypefun {struct MHD_ResponseOptionAndValue} MHD_R_OPTION_HTTP_1_0_COMPATIBLE_STRICT () + +Only respond in conservative (dumb) HTTP/1.0-compatible mode. +Response still use HTTP/1.1 version in header, but always close the +connection after sending the response and do not use chunked encoding +for the response. You can also set the #MHD_R_O_HTTP_1_0_SERVER flag +to force HTTP/1.0 version in the response. Responses are still +compatible with HTTP/1.1. This option thus ensures: + +@itemize +@item declared reply version: HTTP/1.1 +@item keep-alive: no +@item chunked encoding: no +@end itemize + +This option can be used to communicate with some broken client +which does not implement HTTP/1.1 features but (falsely) advertises +support for HTTP/1.1. +@table @var +@end table + +Returns the option to pass to @code{MHD_response_set_options()} +@end deftypefun + + +@anchor{MHD_R_OPTION_HTTP_1_0_SERVER} +@deftypefun {struct MHD_ResponseOptionAndValue} MHD_R_OPTION_HTTP_1_0_SERVER () + +Only respond in HTTP/1.0-mode. +Contrary to the +@code{MHD_R_O_HTTP_1_0_COMPATIBLE_STRICT} flag, the +response's HTTP version will always be set to 1.0 +and keep-alive connections will be used only if explicitly requested by the client. +The "Connection:" header will be added for both "close" and "keep-alive" connections. +Chunked encoding will not be used for the response. +Due to backward compatibility, HTTP/1.0-responses still can be used with HTTP/1.1 clients. +This option can be used to emulate an HTTP/1.0 server for a specific response +(for the response part only, as chunked encoding in requests (if any) is processed by +MHD before the application selects a response). +This option thus ensures: + +@itemize +@item declared reply version: HTTP/1.0 +@item keep-alive: possible +@item chunked encoding: no +@end itemize + +With this option an HTTP/1.0 server is emulated (with support for "keep-alive" connections). +@table @var +@end table + +Returns the option to pass to @code{MHD_response_set_options()}. +@end deftypefun + + +@node libmicrohttpd-response-observability +@subsection Response options for observability + +@c FIXME: this should be a *request* option! + +@anchor{MHD_R_OPTION_TERMINATION_CALLBACK} +@deftypefun {struct MHD_ResponseOptionAndValue} MHD_R_OPTION_TERMINATION_CALLBACK (MHD_RequestEndedCallback ended_cb, void *ended_cb_cls) + +Set a function to be called once MHD is finished with the request. + +@table @var + +@item ended_cb +the function to call, +@code{NULL} to not use the callback + +@item ended_cb_cls +the closure for the callback +@end table + +Returns the option to pass to @code{MHD_response_set_options()}. +@end deftypefun + + +@anchor{MHD_RequestEndedCallback} +@deftypefn {Function Pointer} void (*MHD_RequestEndedCallback) (void *cls, const struct MHD_RequestEndedData *req_data, void *request_app_context) + +Signature of the callback used by MHD to notify the application about completed requests. + +This is the last callback called for any request (if the +respective option is set by the application). The main +use-case is to clean up the application context. + +@table @var +@c FIXME: we want to get rid of this argument... +@item cls +custom value provided by the application at callback registration time; + +@item data +final data about the client's request; + +@item request_app_contex +value from the location where the application +stored information about the request; @code{NULL} +if the application never stored any data there. + +@end table +@end deftypefn + +The @var{data} provides the following information +about the request: + +@anchor{MHD_RequestEndedData} +@deftp {C Struct} struct MHD_RequestEndedData + +Data for @ref{MHD_RequestEndedCallback}s. + +@table @var + +@item @code{struct MHD_Request *} request +The request handle. +Most of the request data may already be unavailable. + +@item @code{enum MHD_RequestEndedCode} code +Code explaining how the request ended. + +@item @code{union MHD_RequestEndedDetail} details +Further details about how the request ended, specifics +depend on @var{code}. + +@end table +@end deftp + + +@anchor{MHD_RequestEndedCode} +@deftp {Enumeration} MHD_RequestEndedCode + +The @code{enum MHD_RequestEndedCode} specifies reasons +why or how a request has been ended. + +@table @code + +@item MHD_REQUEST_ENDED_COMPLETED_OK +The response was successfully sent. + +@item MHD_REQUEST_ENDED_COMPLETED_OK_UPGRADE +The response was successfully sent and connection is being switched to another protocol. + +@item MHD_REQUEST_ENDED_TIMEOUT_REACHED +No activity on the connection for the number of seconds excdeeding the value specified using @ref{MHD_C_OPTION_TIMEOUT}. + +@item MHD_REQUEST_ENDED_CONNECTION_ERROR +The connection was broken or we had a TLS protocol error. + +@item MHD_REQUEST_ENDED_CLIENT_ABORT +The client terminated the connection by closing the socket either completely or for writing (TCP half-closed) before sending the complete request. + +@item MHD_REQUEST_ENDED_HTTP_PROTOCOL_ERROR +The request was not valid according to HTTP specifications. + +@item MHD_REQUEST_ENDED_BY_APP_ABORT +The application aborted handling the request without +specifying a response. + +@item MHD_REQUEST_ENDED_BY_APP_ERROR +The request was aborted because the application failed to provide a valid response. + +@item MHD_REQUEST_ENDED_NO_RESOURCES +MHD failed to handle the connection due to resource exhaustion. + +@item MHD_REQUEST_ENDED_FILE_ERROR +The request was aborted due to an error reading the file (for responses backed by file descriptors). + +@item MHD_REQUEST_ENDED_NONCE_ERROR +The request was aborted due to MHD failing to generate a valid nonce for digest authentication. + +@item MHD_REQUEST_ENDED_DAEMON_SHUTDOWN +The request was terminated because MHD is closing the +underlying session as MHD is being shut down. + +@end table +@end deftp + + +@anchor{MHD_RequestEndedDetail} +@deftp {C Union} struct MHD_RequestEndedDetail + +@var{code}-specific details on how a request ended. +So far not used, only a placeholder. + +@table @var + +@item @code{void *} reserved +Placeholder. Do not used. + +@end table +@end deftp + + + +@node libmicrohttpd-response-testing +@subsection Response options for testing + + +@anchor{MHD_R_OPTION_CHUNKED_ENC} +@deftypefun {struct MHD_ResponseOptionAndValue} MHD_R_OPTION_CHUNKED_ENC () + +Force use of chunked encoding even if the response content size is known. +Ignored when the response does not have a body. + +Returns the option to pass to @code{MHD_response_set_options()}. +@end deftypefun + + +@anchor{MHD_R_OPTION_INSANITY_HEADER_CONTENT_LENGTH} +@deftypefun {struct MHD_ResponseOptionAndValue} MHD_R_OPTION_INSANITY_HEADER_CONTENT_LENGTH () + +Disable sanity checks that generally prevent clients from manually +setting the HTTP content length option. Also allows applications to +set several "Content-Length" headers. These headers will be returned +to the client even with replies without a body. + +This option is useful when using MHD to test HTTP clients, but should +have no place in production. + +Returns the option to pass to @code{MHD_response_set_options()}. +@end deftypefun diff --git a/doc/manual/responses.inc b/doc/manual/responses.inc @@ -0,0 +1,1236 @@ +@cindex response + +@noindent +Response handling by MHD is asynchronous with respect to the +application execution flow. Instances of type @code{struct MHD_Response} +are not tightly associated with a request or a daemon; +they are managed with reference counting. + +@deftp {C Struct} MHD_Response +Handle for a response to be returned to an HTTP client. +A response includes the HTTP status code, HTTP headers, +a body and possibly HTTP footers. +@end deftp + +@cindex action + +In the simplest case we allocate a new @code{struct MHD_Response} +for each request, use it to create an action and it is (automatically) +destroyed: + +@example +struct MHD_Action * +simple_reply_to_request (struct MHD_Request *request) +{ + const char *data = "<html><body><p>Error!</p></body></html>"; + + return MHD_action_from_response ( + request, + MHD_response_from_buffer_static ( + MHD_HTTP_STATUS_NOT_FOUND, + strlen(data), + data); + ); +} +@end example + +The above code will cause MHD to @code{close()} a connection in +case the memory allocation failed (and log nothing), but unless +an application really needs to handle even such an error more +gracefully, the above code is already fine even in terms of +error handling and leaks no memory (assuming the action is +returned to MHD). + +However, MHD also allows responses to be reused and the same response +structure to be used multiple times. This is explained in more detail +under @ref{MHD_R_OPTION_REUSABLE} in the section on +@ref{libmicrohttpd-response-performance,,Response options for +performance optimization}. + +@menu +* libmicrohttpd-response enqueue:: Returning a response. +* libmicrohttpd-response create:: Creating responses. +* libmicrohttpd-response headers:: Adding headers to a response. +* libmicrohttpd-response options:: Setting response options. +* libmicrohttpd-upgrade:: Creating a response for protocol upgrades. +@end menu + +@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +@c ------------------------------------------------------------ +@node libmicrohttpd-response enqueue +@section Enqueuing a response + +As we have discussed in the previous chapters and shown in the example +above, handling a request requires applications to return a +@code{struct MHD_Action} that tells MHD how to continue. The most +common way to create an action is from a @code{struct MHD_Response} +via @code{MHD_action_from_response}. + +@anchor{MHD_action_from_response} +@deftypefun {struct MHD_Action *} MHD_action_from_response (struct MHD_Request *request, struct MHD_Response *response) + +This instructs MHD to transmit the given @var{response} to +the client. The @var{request} must match the request handle +given to the call that is returning the action. + +@table @var +@item request +the request to create an action for; + +@item response +the response to convert. If this argument is NULL then this +function will behave equivalent to @code{MHD_action_abort_connection()}. +@end table + +Returns an action on success. The action returned must be returned to +MHD, otherwise there @emph{may} be a memory leak. This function +checks that no other action was already created for the given +@var{request} and returns @code{NULL} on API usage errors or possibly +in out-of-memory situations. The application @emph{may} try to create +a different action in this case, but most likely should just give MHD +the @code{NULL} value for the action to close the connection. + +@end deftypefun + +Note that calling @code{MHD_action_from_response()} will typically +consume a response and cause its resources to be released +by MHD once the response has been sent. Thus, after converting +a response to an action applications do not have to call +@code{MHD_response_destroy()} @emph{unless} they used +@ref{MHD_R_OPTION_REUSABLE} as explained below. + + +@node libmicrohttpd-response create +@section Creating responses + +@cindex lifetime +@subsection Destroying responses + +There are various ways for applications to create a @code{struct +MHD_Response}. Almost all of these functions will have to allocate +memory and may fail, returning @code{NULL} to indicate that the +response generation failed. To avoid leaking memory, any response that +was successfull created must @emph{either} be converted into an action +via @code{MHD_action_from_response()} or explicitly destroyed via +@code{MHD_response_destroy()}. + +@anchor{MHD_response_destroy} +@deftypefun void MHD_response_destroy (struct MHD_Response *response) +Destroys a response and associated resources (decrement the +reference counter). Note that MHD may keep some of the resources +around if the response is still in the queue for some clients, so the +memory may not necessarily be freed immediately. + +@table @var +@item response +the response to destroy. +@end table +@end deftypefun + +@subsection HTTP status codes +@cindex status code + +When creating a response, applications must always specify the HTTP +status code that should be returned with the response. MHD provides +@code{enum MHD_HTTP_StatusCode} with all supported HTTP status +codes. Using other numeric values is possible but not advised: in such +cases MHD will be unable to provide the human-readable status code +description and clients are likely to be unhappy about the use of +non-standard codes. + +@anchor{MHD_HTTP_StatusCode} +@deftp {Enumeration} MHD_HTTP_StatusCode + +Represents canonical HTTP status codes. + +@table @code +@include manual/http-status-texi.gen +@end table +@end deftp + + +@subsection Responses from memory buffers + +You can use any of the following functions (or convenience macros) +to create responses from static data in memory: + +@anchor{MHD_response_from_buffer} +@deftypefun {struct MHD_Response *} MHD_response_from_buffer (enum MHD_HTTP_StatusCode sc, size_t buffer_size, const char *buffer, MHD_FreeCallback free_cb, void *free_cb_cls) + +Create a response object with a callback that can be used to free resources after the response has been sent to the client. + +@table @var +@item sc +HTTP status code for the response; + +@item size +size of the data portion of the response; + +@item buffer +the body to return, must contain at least @var{size} bytes of data; +the application must ensure that data in @var{buffer} remains valid +at least until the response was sent; + +@item free_cb +function to call to release application data associated with +the response (usually @var{buffer}) after transmitting the +response is complete. For example, if @var{buffer} is the +result of @code{mmap()} the callback may invoke +@code{munmap()}. Similarly, if @var{buffer} was part of an +allocation on the heap, the callback may simply call +@code{free()}. You may pass @code{NULL} to indicate that +no cleanup function is needed; however, in that case it +might be simpler to use @code{MHD_response_from_buffer_static()}. + +@item free_cb_cls +additional argument to pass to the @var{free_cb}. +A common value to pass is @var{buffer}. +@end table + +Return @code{NULL} on error (i.e. invalid arguments, out of memory). +@end deftypefun + +@anchor{MHD_FreeCallback} +@deftypefn {Function Pointer} void (*MHD_FreeCallback) (void *cls) + +Functions of this type are invoked by MHD whenever it wants to give +the application a chance to free resources. + +@table @var +@item cls +custom value provided by the application together with the +actual function pointer; should identify the resources to be released +@end table +@end deftypefn + +When releasing resources is unnecessary, applications can instead +use the simplified @code{MHD_response_from_buffer_static()} API +that simply omits the @var{free_cb} and @var{free_cb_cls} arguments. + +@anchor{MHD_response_from_buffer_static} +@deftypefun {struct MHD_Response *} MHD_response_from_buffer_static (enum MHD_HTTP_StatusCode sc, size_t buffer_size, const char *buffer) +Create a response object without the need to free resources after the response has been sent to the client. + +@table @var +@item sc +HTTP status code for the response. + +@item size +size of the data portion of the response; + +@item buffer +the body to return, must contain at least @var{size} bytes of data; +the application must ensure that data in @var{buffer} remains valid +at least until the response was sent; can be NULL if @var{size} is zero, +but in this case it might be simpler to use @code{MHD_response_from_empty()}. +@end table + +Return @code{NULL} on error (i.e. invalid arguments, out of memory). +@end deftypefun + +@anchor{MHD_response_from_buffer_copy} +@deftypefun {struct MHD_Response *} MHD_response_from_buffer_copy (enum MHD_HTTP_StatusCode sc, size_t buffer_size, const char buffer[buffer_size]) + +Create a response object from an ephemeral @var{buffer}. The data +in the @var{buffer} will be copied into internal storage of MHD. + +@table @var +@item sc +HTTP status code for the response. + +@item size +size of the data portion of the response; + +@item buffer +the body to return, must contain at least @var{size} bytes of data; +the @var{buffer} can become invalid immediately after the +call to @code{MHD_response_from_buffer_copy()} returns as MHD +will make a copy of the data contained in it. +@end table + +Return @code{NULL} on error (i.e. invalid arguments, out of memory). +@end deftypefun + +@anchor{MHD_response_from_empty} +@deftypefun {struct MHD_Response *} MHD_response_from_empty (enum MHD_HTTP_StatusCode sc) +Create an response with an empty body. + +@table @var +@item sc +HTTP status code for the response. A common value would be @code{MHD_HTTP_NO_CONTENT}. +@end table + +Return @code{NULL} on error (i.e. invalid arguments, out of memory). +@end deftypefun + +Finally, in rare cases, the response data may not be available in a +continuous block in memory and it might be more efficient to not copy +the data into a continous area just for the network transfer (or +encryption). In this case, applications can initialize an array of +@code{struct MHD_IoVec} data structures and use +@code{MHD_response_from_iovec()} to point MHD to the various fragments +of the body and enable (if supported) the kernel (or NIC) to assemble +the final response dynamcially from the fragments in +memory.@footnote{See the @code{writev()} POSIX call for an example of +the type of scatter input operationg system interface that MHD might +use to implement this.} + +@cindex{iovec} +@cindex{scatter write} +@cindex{writev} +@anchor{MHD_response_from_iovec} +@deftypefun {struct MHD_Response *} MHD_response_from_iovec (enum MHD_HTTP_StatusCode sc, unsigned int iov_count, const struct MHD_IoVec iov[iov_count], MHD_FreeCallback free_cb, void *free_cb_cls) + +Create a response object from an array of memory buffers. +@table @var +@item sc +HTTP status code for the response. + +@item iov_count +the number of elements in @var{iov}; + +@item iov +the array for response data buffers of length @var{iov_count}, an internal copy of the @var{iov} will be made; however, note that the data pointed to by the @var{iov} is @strong{not} copied and must be preserved unchanged at the given locations until the response is no longer in use and the @var{free_cb} is called; + +@item free_cb +the callback to call to free resources associated with @var{iov}; +You may pass @code{NULL} to indicate that no cleanup function is needed. + +@item free_cb_cls +additional argument to pass to the @var{free_cb}. +@end table + +Return @code{NULL} on error (i.e. invalid arguments, out of memory). +@end deftypefun + +@anchor{MHD_IoVec} +@deftp {C Struct} MHD_IoVec +Input/output vector type. Informations MHD about a fragment of +data in memory for assembly as part of an HTTP response body. +@table @var +@item @code{const void *} iov_base +Pointer to the memory region for I/O. +@item @code{size_t} iov_len +The size (in bytes) of the memory region pointed to by @var{iov_base}. +@end table +@end deftp + + +@subsection Responses from file descriptors +@cindex sendfile() + +@anchor{MHD_response_from_fd} +@deftypefun {struct MHD_Response *} MHD_response_from_fd (enum MHD_HTTP_StatusCode sc, int fd, uint_fast64_t offset, uint_fast64_t size) +Create a response object based on a file descriptor @var{fd} from +which the body is supposed to be read. + +@table @var +@item sc +HTTP status code for the response. + +@item fd +file descriptor referring to a file on disk with the +data; MHD will @code{close()} the file descriptor when +the response is destroyed; @var{fd} should be in @emph{blocking} mode; +@var{fd} must be an actual file descriptor (not a pipe or socket) +since MHD might use @code{sendfile()} or @code{seek()} on it; + +@item offset +offset to start reading from in the file; +readings file beyond 2 GiB may be not supported by some +operationg systems or MHD builds. +@xref{MHD_LIB_INFO_FIXED_HAS_LARGE_FILE}. + +@item size +size size of the data portion of the response; +sizes larger than 2 GiB may be not supported by +some operating systems or MHD builds. +@xref{MHD_LIB_INFO_FIXED_HAS_LARGE_FILE}. +@end table + +Returns @code{NULL} on error (i.e. invalid arguments, out of memory). +The @var{fd} is closed on error. +@end deftypefun + +@cindex{splice} +@anchor{MHD_response_from_pipe} +@deftypefun {struct MHD_Response *} MHD_response_from_pipe (enum MHD_HTTP_StatusCode sc, int fd) + +Create a response object where the response body is created by reading from +the provided pipe. +@c FIXME: will it also work for sockets? Is this using splice()? Clarify! + +@table @var +@item sc +HTTP status code for the response. + +@item fd +file descriptor of the read-end of a pipe; will be +closed when response is destroyed. +The descriptor should be in blocking-IO mode. +@end table + +Returns @code{NULL} on error (i.e. out of memory). +@c FIXME: closes fd on error? +@end deftypefun + + +@subsection Responses from dynamic generators + +This API is useful for applications that dynamically create the +response body, possibly even with significant delays between +chunks. + +@c FIXME: this comment seems wrong, see above for from_pipe()! +@c This is also the only API that applications can use to +@c return responses for which they do not know the length up-front. + +@cindex dynamic responses +@cindex generation + +@anchor{MHD_response_from_callback} +@deftypefun {struct MHD_Response *} MHD_response_from_callback (enum MHD_HTTP_StatusCode sc, uint_fast64_t size, MHD_DynamicContentCreator dyn_cont, void *dyn_cont_cls, MHD_FreeCallback dyn_cont_fc) + +Create a response object with a body that will be yielded over +time by the @code{dyn_cont} callback. + +@table @var +@item sc +HTTP status code for the response. + +@item size +size of the body of the response, applications should pass +@code{MHD_SIZE_UNKNOWN} if the size of the body is not yet known; + +@item dyn_cont +callback that MHD will use to obtain the response body + +@item dyn_cont_cls +extra argument that MHD will pass to @var{dyn_cont} and +@var{dyn_cont_fc} + +@item dyn_cont_fc +callback that MHD will call to allow the application to +free resources associated with @var{dyn_cont_cls}. +@end table + +Return @code{NULL} on error (i.e. invalid arguments, out of memory). +@end deftypefun + +The interesting work for dynamic response generation happens in the +dynamic content creation callback, which must be a function of +type @code{MHD_DynamicContentCreator}. + +@anchor{MHD_DynamicContentCreator} +@deftypefn {Function Pointer} {struct MHD_DynamicContentCreatorAction *} (*MHD_DynamicContentCreator) (void *dyn_cont_cls, struct MHD_DynamicContentCreatorContext *ctx, uint_fast64_t pos, void *buf, size_t max) + +@table @var +@item dyn_cont_cls +closure argument that was associated with the callback + +@item ctx +the context to produce the action to return; +the pointer is only valid until the callback returns; +equivalent to the @var{request} argument given to +functions of type @code{MHD_RequestCallback}; + +@item pos +position in the datastream to access; +note that if a @code{struct MHD_Response} is re-used, +it is possible for the same dynamic content creator to +be queried multiple times for the same data; +however, if a @code{struct MHD_Response} is not re-used, +libmicrohttpd guarantees that @var{pos} will be +the sum of all data sizes previously yielded by this callback + +@item buf +buffer where the application may write data that should be +included in the body at offset @var{pos}; @var{buf} has +@var{max} bytes available; + +@item max +maximum number of bytes the application may copy to @var{buf}; +if the size of the content of the response is known then the +size of the buffer is never larger than amount of data left +@end table + +Most importantly, the callback must also return a +@code{struct MHD_DynamicContentCreatorAction} which determines +the next step in creating the body. Applications may +return @code{NULL} in which case response generation will +be aborted and MHD will @code{close()} the connection. +@end deftypefn + +@cindex dynamic content creator action + +@anchor{MHD_DynamicContentCreatorAction} +@deftp {C Struct} MHD_DynamicContentCreatorAction +Special type of action that must be returned by a +@code{MHD_DynamicContentCreator}. +@end deftp + +Various possibilities exist for applications to create +an @code{struct MHD_DynamicContentCreatorAction} (DCC action). Note +that at most one @code{struct MHD_DynamicContentCreatorAction} +can be created per @var{ctx}. + +We begin with DCC actions that end the process of +dynamic response generation: + +@anchor{MHD_DCC_action_abort} +@deftypefun {struct MHD_DynamicContentCreatorAction *} MHD_DCC_action_abort (struct MHD_DynamicContentCreatorContext *ctx) + +Aborts handling the request by closing the connection. This +is actually simply a macro that is equivalent to just @code{NULL}, +except that it also suggests to the compiler that it it should +not emit a warning for not using @var{ctx}. + +@end deftypefun + +@anchor{MHD_DCC_action_finish} +@deftypefun {struct MHD_DynamicContentCreatorAction *} MHD_DCC_action_finish (struct MHD_DynamicContentCreatorContext *ctx) + +Create a "finished" action that signals MHD that the dynamic content creation +is finished. Note that this will cause MHD to @code{close()} the connection +if the amount of data yielded by the content creation logic is less than +the @var{size} promised to @code{MHD_response_from_callback()}. + +@table @var +@item ctx +context that was given to the @code{MHD_DynamicContentCreator} for +which a @code{struct MHD_DynamicContentCreatorAction} should be generated. +@end table + +@code{NULL} is returned in case of any error. +@end deftypefun + + +HTTP has not only headers, but also the lesser-known concept of +@emph{footers}. Applications can specify footers (for example, +to append a checksum after dynamic content creation) using +@code{MHD_DCC_action_finish_with_footer()}. + +@anchor{MHD_DCC_action_finish_with_footer} +@deftypefun {struct MHD_DynamicContentCreatorAction *} MHD_DCC_action_finish_with_footer (struct MHD_DynamicContentCreatorContext *ctx, size_t num_footers, const struct MHD_NameValueCStr *footers) + +Create a "finished" action that signals MHD that the dynamic content creation +is finished. Note that this will cause MHD to @code{close()} the connection +if the amount of data yielded by the content creation logic is less than +the @var{size} promised to @code{MHD_response_from_callback()}. + +@table @var +@item ctx +context that was given to the @code{MHD_DynamicContentCreator} for +which a @code{struct MHD_DynamicContentCreatorAction} should be generated; + +@item num_footers +length of the @var{footers} array; + +@item footers +array of @var{num_footers} HTTP footers to return. +@end table + +@code{NULL} is returned in case of any error. +@end deftypefun + +The @var{footers} are provided as key-value pairs of 0-terminated C strings +in a @code{struct MHD_NameValueCStr}. In this context, both members must +not be @code{NULL}. + +@anchor{MHD_NameValueCStr} +@deftp {C Struct} MHD_NameValueCStr name value +Name with value pair as C strings. +@table @var +@item @code{const char *} name +The name or key of the field. Must never be @code{NULL}. +@item @code{const char *} value +The value to be returned under the name or key. +In some cases, @var{value} is allowed to be absent, +which is indicated by a @code{NULL} pointer. +@end table +@end deftp + +@cindex long-polling + +Applications may not want to finish generating a response, but also +may not (yet) have more data to return to the client. In this case, +applications must @emph{suspend} response generation. This is done +using @code{MHD_DCC_action_suspend()}. + +@anchor{MHD_DCC_action_suspend} +@deftypefun {struct MHD_DynamicContentCreatorAction *} MHD_DCC_action_suspend (struct MHD_DynamicContentCreatorContext *ctx) + +Creates a DCC action that suspends response generation. The connection +is not closed! MHD merely waits for the application to resume response +generation via a call to @code{MHD_request_resume()}. This is +especially useful for long-polling where response generation is not +computationally bound. This is common in cases where client and server +need to wait (possibly for an extended period of time) on some +external event to happen before the server can generate a response. + +@table @var +@item ctx +context that was given to the @code{MHD_DynamicContentCreator} for +which a @code{struct MHD_DynamicContentCreatorAction} should be generated; +@end table + +@code{NULL} is returned in case of any error. +@end deftypefun + +After dynamic content creation was suspended with +@code{MHD_DCC_action_suspend()}, applications @strong{must} +(eventually) call @code{MHD_request_resume()} to continue +processing the client's request. + +Finally, we consider DCC actions that can be used to signal MHD data to be +returned in the MHD body. + +@anchor{MHD_DCC_action_continue} +@deftypefun {struct MHD_DynamicContentCreatorAction *} MHD_DCC_action_continue (struct MHD_DynamicContentCreatorContext *ctx, size_t data_size) + +Creates an action that indicates that a chunk of @var{data_size} bytes +was provided in the @var{buf} that MHD provided to the +@code{MHD_DynamicContentCreator} callback +and that MHD should continue to call the content generator for more +(as soon as MHD has more buffer space available). + +@table @var +@item ctx +context that was given to the @code{MHD_DynamicContentCreator} for +which a @code{struct MHD_DynamicContentCreatorAction} should be generated; + +@item data_size +number of bytes that were written by the application into @var{buf}; +must be non-zero; +@end table + +@code{NULL} is returned in case of any error. +@end deftypefun + +A small variation of the above API can be used to associate +a chunk-extension (see RFC 9112, 7.1) with the chunk: + +@deftypefun {struct MHD_DynamicContentCreatorAction *} MHD_DCC_action_continue_ce (struct MHD_DynamicContentCreatorContext *ctx, size_t data_size, const char *chunk_ext) + +Creates an action that indicates that a chunk of @var{data_size} bytes +was provided in the @var{buf} that MHD provided to the +@code{MHD_DynamicContentCreator} callback +and that MHD should continue to call the content generator for more +(as soon as MHD has more buffer space available). +Furthermore, the chunk of data that was returned is optionally +associated with a chunk-extension (@var{ce}) that MHD should +include in the transmission if possible. + +@table @var +@item ctx +context that was given to the @code{MHD_DynamicContentCreator} for +which a @code{struct MHD_DynamicContentCreatorAction} should be generated; + +@item data_size +number of bytes that were written by the application into @var{buf}; +must be non-zero; + +@item chunk_ext +optional pointer to a chunk extension string; +can be @code{NULL} to not use chunk extension, +ignored if chunked encoding is not used by MHD +(say because the client is using HTTP/1.0 and +the connection is only used for a single request). +@end table + +@code{NULL} is returned in case of any error. +@end deftypefun + +While writing new data that an application may dynamically generate +directly into MHD's @var{buf} is usually ideal, copying existing +data over into the buffer provided by MHD may not be ideal. +Applications can also instruct MHD to include data from +locations in the application's memory, and in fact it is +possible to @emph{mix} both strategies using +@code{MHD_DCC_action_continue_zc()}: + +@anchor{MHD_DCC_action_continue_zc} +@deftypefun {struct MHD_DynamicContentCreatorAction *} MHD_DCC_action_continue_zc (struct MHD_DynamicContentCreatorContext *ctx, size_t data_size, const struct MHD_DynContentZCIoVec *iov_data, const char *chunk_ext) + +Yields a chunk of body data to MHD with (optional) chunk-extension. +The data is provided in the MHD buffer and/or in the zero-copy @var{iov_data}. + +If data is provided both in the MHD buffer and @var{ivo_data} then +data in the MHD buffer is sent first, followed by the @var{iov_data}. +The total size of the data in the buffer and in @var{iov_data} @strong{must} +be non-zero. + +@table @var +@item ctx +context that was given to the @code{MHD_DynamicContentCreator} for +which a @code{struct MHD_DynamicContentCreatorAction} should be generated; + +@item data_size +the amount of the data placed to the provided MHD buffer (@var{buf}), +cannot be larger than provided buffer size, +must be non-zero if @var{iov_data} is @code{NULL} or has no data; + +@item iov_data +optional pointer to a vector of data fragments to send, +must not be NULL and have non-zero bytes of data if @var{data_size} +is zero; + +@item chunk_ext +optional pointer to a chunk extension string; +can be @code{NULL} to not use chunk extension, +ignored if chunked encoding is not used by MHD +(say because the client is using HTTP/1.0 and +the connection is only used for a single request). +@end table + +It is an error if the total response body size is known and the +amount of data yielded in total by the dynamic content creation logic +exceeds that amount. In this case, this function will fail and +return @code{NULL}. + +@end deftypefun + +The @code{struct MHD_DynContentZCIoVec} adds an application +cleanup callback to an array of @code{struct MHD_IoVec}s: + +@cindex iovec +@cindex writev +@cindex scatter write + +@anchor{MHD_DynContentZCIoVec} +@deftp {C Struct} MHD_DynContentZCIoVec +Structure to pass various memory buffers to MHD together with +a callback for cleaning up after MHD is done using the data. +@table @var +@item @code{size_t} iov_count +The length of the @var{iov} array; + +@item @code{const struct MHD_ioVec *} iov +Pointer to an array of length @var{iov_count} identifying data chunks +to return as part of the body; + +@item @code{MHD_FreeCallback} iov_fcb +Function to call to free resources associated with @var{iov}. +Can be @code{NULL} if releasing these resources is not necessary +after finishing the response generation; + +@item @code{void *} iov_fcb_cls +Parameter to pass to @var{iov_fcb}. +@end table + +@end deftp + + +@node libmicrohttpd-response headers +@section Adding headers to a response +@cindex header +@cindex Connection +@cindex Date +@cindex Content-Length +@cindex Transfer-Encoding + +After creating a response, but @emph{before} using it to create an +@code{struct MHD_Action}, applications may add custom HTTP headers +to a response. Note that MHD will automatically set some common +HTTP headers, in particular ``Content-Length'', ``Transfer-Encoding'', +``Date`` and ``Connection''. + +@code{MHD_response_add_header()} prevents applications from setting a +``Transfer-Encoding'' header to values other than ``identity'' or +``chunked'' as other transfer encodings are not supported by MHD. Note +that usually MHD will pick the correct transfer encoding +automatically; however, applications can use the header to force a +particular behavior. + +@code{MHD_response_add_header()} prevents applications from setting a +``Connection'' header to values other than ``close'' or +``keep-alive''. Note that usually MHD will pick a sane value +automatically; however, applications can use the header to force a +particular behavior. + +@code{MHD_response_add_header()} also prevents applications from setting a +``Content-Length'' header unless special options are set for the +response (@xref{libmicrohttpd2-response options,,response options}) as +MHD will automatically set a correct ``Content-Length'' header if it +is possible and allowed by the HTTP protocol. + +@anchor{MHD_response_add_header} +@deftypefun {enum MHD_StatusCode} MHD_response_add_header (struct MHD_Response *response, const char *name, const char *value) + +Add a header line to the response. + +@table @var +@item response +which response to add a header for, @code{NULL} is tolerated; + +@item name +the name of the header to add; +an internal copy of the string will be made; +must not contain newlines, carriage returns or +tabulator characters; + +@item value +the value of the header to add; +an internal copy of the string will be made; +must not contain newlines, carriage returns or +tabulator characters. +@end table + +On success @code{MHD_SC_OK} is returned. +@end deftypefun + +@cindex HTTP2 +@cindex predefined HTTP header +@cindex header + +HTTP2 introduced @emph{predefined} (standard) HTTP headers. For such +headers, it is (slightly) more efficient to set the headers using +values from the @code{enum MHD_PredefinedHeader} instead of specifying +the name as a string.@footnote{The main reason being that HTTP2 can +encode these headers using a number instead of a string, and by having +the application directly provide the numeric value MHD does not have +to map the string to the number.} + +@deftypefun {enum MHD_StatusCode} MHD_response_add_predef_header (struct MHD_Response *response, enum MHD_PredefinedHeader stk, const char *content) +Adds a header line to the response. + +@table @var +@item response +which response to add a header for, @code{NULL} is tolerated; + +@item stk +code of the predefined header; + +@item content +the value of the header to add + an internal copy of the string will be made. +@end table + +Notice that the content must not contain newlines, carriage returns or +tabulator characters. On success @code{MHD_SC_OK} is returned. +@end deftypefun + +@anchor{MHD_PredefinedHeader} +@deftp {Enumeration} MHD_PredefinedHeader + +Predefined list of canonical HTTP headers, useful for HTTP2 +header packing (HPACK). + +@c FIXME: the table seems rather incomplete (also in libmicrohttpd2.h), +@c and we should probably generate it via GANA (like HTTP status codes) +@table @code +@item MHD_PREDEF_ACCEPT_CHARSET +15: ``Accept-Charset`` +@item MHD_PREDEF_ACCEPT_LANGUAGE +17: ``Accept-Language`` +@end table +@end deftp + +MHD provides a convenience function to map @code{enum MHD_PredefinedHeader} +values to the human readable names: + +@deftypefun {const struct MHD_String *} MHD_predef_header_to_string (enum MHD_PredefinedHeader stk) +Get textual representation of the predefined header. + +@table @var +@item stk +code of the predefined header; +@end table + +@c FIXME: shouldn't it then be a StringNullable!??!? +Returns a pointer to the text version, or @code{NULL} if +@var{stk} is not known. +@end deftypefun + + +@node libmicrohttpd2-response options +@section Setting response options +@cindex option + +This section is about setting response options. In principle, setting +response options works like setting other options in +MHD. @xref{libmicrohttpd2-doptions,,Configuring your HTTP daemon}. + +MHD response options are represented using a @code{struct +MHD_ResponseOptionAndValue}. However, applications should never be +concerned with the internals of this data structure, and only use the +provided API functions and macros explained in this chapter to +construct these options. + +MHD offers three main ways to set options for a @code{struct MHD_Response}: + +@itemize +@item @code{MHD_response_set_options()} sets an array of options, +@item @code{MHD_response_set_option()} sets an individual option, and +@item @code{MHD_RESPONSE_SET_OPTIONS()} sets a list of options. +@end itemize + +All three approaches can be combined for the same response +to set various options. We will now look at each of them. + +@code{MHD_response_set_options()} is useful if the application needs +complex code to first initialize a set of options, or if it has a +static data buffer with all of the options (say in ROM). It is also +the function use to implement the other styles. + +@deftypefun {struct MHD_StatusCode} MHD_response_set_options (struct MHD_Response *response, const struct MHD_ResponseOptionAndValue *options, size_t options_max_num) + +@table @var +@item response +the response to configure + +@item options +array of options to set, either @code{MHD_D_OPTION_TERIMINATE()}-terminated or +limited by @var{options_max_num} (whatever comes first). + +@item options_max_num +maximum number of options to process from the @var{options} array, +or @code{MHD_OPTIONS_ARRAY_MAX_SIZE} to process all options from +@var{options} until the @code{MHD_D_OPTION_TERMINATE()}-terminator. + +@end table + +Returns @code{MHD_SC_OK} on success, otherwise the error code of +the first option that could not be set. +@end deftypefun + +To set only a single option, MHD defines a simple convenience API with +@code{MHD_response_set_option()}. This is useful if there is only one +option to be set, or if error handling for that specific option is +somehow special (like not failing when setting this particular option +failed). + +@deftypefun {struct MHD_StatusCode} MHD_response_set_option (struct MHD_Response *response, const struct MHD_ResponseOptionAndValue *option) + +@table @var +@item response +the response to configure + +@item option +the option to set + +@end table + +Returns @code{MHD_SC_OK} on success, otherwise the error code from +trying to set the @var{option}. +@end deftypefun + + +An easy way to set a bunch of options without having to worry +about explicitly allocating an array or checking each return +value is to use @code{MHD_RESPONSE_SET_OPTIONS()}. + +@anchor{MHD_RESPONSE_SET_OPTIONS} +@deftypefun {struct MHD_StatusCode} MHD_RESPONSE_SET_OPTIONS (struct MHD_Response *response, ...) + +@table @var +@item response +the response to configure + +@item ... +variable-length list of @code{MHD_ResponseOptionAndValue} options +to set; does @emph{not} need to be terminated via +@code{MHD_D_OPTION_TERMINATE()} as such a terminator is added +automatically. + +@end table + +Returns @code{MHD_SC_OK} on success, otherwise the error code of +the first option that could not be set. +@end deftypefun + +The remaining sections of this section discuss the various +response options available to applications today. + +@include manual/response_options.inc + + +@node libmicrohttpd-upgrade +@section Creating a response for protocol upgrades +@cindex WebSockets +@cindex HTTP Upgrade +@cindex HTTP2 +@cindex RFC2817 + +With RFC 2817 a mechanism to switch protocols within HTTP was +introduced. Here, a client sends a request with a ``Connection: +Upgrade'' header. The server responds with a ``101 Switching +Protocols'' response header, after which the two parties begin to +speak a different (non-HTTP) protocol over the TCP connection. + +This mechanism is used for upgrading HTTP 1.1 connections to HTTP2 or +HTTPS, as well as for implementing WebSockets. Which protocol +upgrade is performed is negotiated between server and client in +additional headers, in particular the ``Upgrade'' header. + +MHD supports switching protocols using this mechanism +by returning a special @code{MHD_action_upgrade()} action +from the @ref{MHD_RequestCallback,,@code{MHD_RequestCallback}}. + +Note that support for upgrading connections is an @emph{optional} +feature that could be left out especially in embedded builds. Use +@ref{MHD_LIB_INFO_FIXED_HAS_UPGRADE,,@code{MHD_LIB_INFO_FIXED_HAS_UPGRADE}} +to check if the library supports it. Furthermore, connection upgrades +can be disabled for a daemon using +@code{MHD_D_OPTION_DISALLOW_UPGRADE()} for some potential minor +performance benefit. Thus, you may want to make sure the feature is +actually properly enabled. + +@anchor{MHD_action_upgrade} +@deftypefun {const struct MHD_Action *} MHD_action_upgrade (struct MHD_Request *request, const char *upgrade_hdr_value, MHD_UpgradeHandler upgrade_handler, void *upgrade_handler_cls, size_t num_headers, const struct MHD_NameValueCStr *headers) + +Create a action object that can be used for 101 Upgrade +responses, for example to implement WebSockets. After sending the +response, control over the data stream is given to the callback (which +can then, for example, start some bi-directional communication). +The callback will @emph{only} be called after the response header +was successfully passed to the OS; if there are communication errors +before, the usual MHD connection error handling code will be performed. + +When creating this type of response, the "Connection: Upgrade" +header will be set automatically for you. + + +@table @var +@item request +the request to create action for; + +@item upgrade_hdr_value +the value of the (mandatory) "Upgrade:" header, must not be @code{NULL}; + +@item upgrade_handler +function to call with the "upgraded" socket; + +@item upgrade_handler_cls +closure for @var{upgrade_handler}; + +@item num_headers +number of elements in the @var{headers} array, +must be zero if @var{headers} is @code{NULL}; + +@item headers +optional pointer to an array of additional HTTP headers to return in +the response (the strings will be copied and do not need to be +preserved by the application after this function returns); +can be @code{NULL} if @var{num_headers} is zero; + +@end table + +@code{NULL} is returned on error (i.e. invalid arguments, out of memory). +@end deftypefun + +The @var{upgrade_handler} argument has the following type: + +@anchor{MHD_UpgradeHandler} +@deftypefn {Function Pointer} void (*MHD_UpgradeHandler) (void *cls, struct MHD_Request *request, struct MHD_UpgradeHandle *urh) + +Applications must implement functions of this type which be called +once MHD has transmitted the header of the response to the connection +that is being upgraded. At this point, the application is expected to +take over the connection represented by @var{urh} and use @var{urh} to speak +the non-HTTP protocol to which the connection was upgraded with the client. + +The application must call @code{MHD_upgraded_send()}, +@code{MHD_upgraded_recv()} and eventually @code{MHD_upgraded_close()} +to interact with the client. @code{MHD_upgraded_close()} must be +called before destroying the daemon. + +"Upgraded" connection will not time out, but are still counted for daemon +global connections limit and for per-IP limit (if set). + +Except when in "thread-per-connection" mode, implementations of this +function should never block (as it will be called from within the main +event loop). + +@table @var +@item cls +matches the @code{upgrade_handler_cls} that was given to @code{MHD_action_upgrade()}; + +@item request +identifies the request of the connection that is being upgraded; + +@item urh +handle to interact with the client. +@c FIXME: C comment talks about MHD_upgrade_operation(), seems outdated! +@end table + +@end deftypefn + +@c FIXME: Evgeny: this is correct, right? +When upgrading a connection, applications using an external event loop may +use the connection @ref{libmicrohttpd-requests-info,,request +introspection API} to obtain the socket underlying the HTTP request +and then add that socket to their own event loop to decide when to +call @code{MHD_upgraded_recv()} and @code{MHD_upgraded_send()}. + +@anchor{MHD_upgraded_recv} +@deftypefun {enum MHD_StatusCode} MHD_upgraded_recv (struct MHD_UpgradeHandle *urh, size_t recv_buf_size, void *recv_buf, size_t *received_size, uint_fast64_t max_wait_millisec) + +Receive data on the HTTP-Upgraded connection. + +The function will return if one of the following happens: +@itemize +@item Any amount of data has been received, +@item The specified timeout was reached, or +@item a network error occured. +@end itemize + +@table @var +@item urh +identifies the HTTP-upgraded connection handle + +@item recv_buf_size +size of the @var{recv_buf} + +@item recv_buf +application buffer where MHD should place received data + +@item received_size +pointer where to return the number of bytes received +@c FIXME: header lacks [out], English not so good + +@item max_wait_millisec +the maximum wait time for the data, non-blocking operation if set to zero, +wait indefinitely if set larger or equal to @code{MHD_WAIT_INDEFINITELY}; +the function may return earlier if waiting is interrupted for some reason. +@end table +Returns: +@table @code +@item MHD_SC_OK +if any data was received (check the @var{received_size}) or +remote shut down send side (indicated by @var{received_size} +set to zero); + +@item MHD_SC_UPGRADED_NET_TIMEOUT +if no data was received but and timeout was reached; + +@item MHD_SC_UPGRADED_NET_CONN_CLOSED +if the network connection has been closed, +@c FIXME: should the application still call MHD_upgraded_close()? If so, we should say so explicitly! + +@item MHD_SC_UPGRADED_NET_CONN_BROKEN +if a broken network connection has been detected, + +@item MHD_SC_UPGRADED_TLS_ERROR +if a TLS error occured (only possible with TLS connections), + +@item MHD_SC_UPGRADED_NET_HARD_ERROR +if any other network or sockets unrecoverable error occured, + +@item MHD_SC_UPGRADED_HANDLE_INVALID +if @var{urh} is invalid, + +@item MHD_SC_UPGRADED_WAITING_NOT_SUPPORTED +if timed wait is not supported by this MHD build or platform +@end table +@end deftypefun + +@cindex upgraded handle + +After the upgrade, the application must use the +@code{struct MHD_UpgradedHandle} to continue the +interaction with the client. + +@anchor{MHD_UpgradedHandle} +@deftp {C Struct} MHD_UpgradedHandle +Handle for response that has been "upgraded" (say to a WebSocket). +@end deftp + +Using the handle, the application primarily has +three ways to interact with the client: +@itemize +@item send data, +@item receive data, or +@item close the connection. +@end itemize + +@anchor{MHD_upgraded_send} +@deftypefun {enum MHD_StatusCode} MHD_upgraded_send (struct MHD_UpgradeHandle *urh, size_t send_buf_size, const void *send_buf, size_t *sent_size, uint_fast64_t max_wait_millisec, enum MHD_Bool more_data_to_come) + +Sends data on an HTTP-Upgraded connection. + +The function will return if one of the following happens: +@itemize +@item All provided data has been sent, +@c FIXME: Truly *all*? So always blocking? Not ideal! Discuss! +@item The timeout was reached, or +@item a network error occurs +@end itemize + + +@table @var +@item urh +identifies the upgraded connection to transmit data on + +@item send_buf_size +the number of bytes of data in the @var{send_buf} + +@item send_buf +the buffer with the data to send + +@item sent_size +the pointer where MHD will return the number of bytes of data actually sent + +@item max_wait_millisec +the maximum wait time for the data, non-blocking operation if set to zero, +wait indefinitely if larger or equal to @code{MHD_WAIT_INDEFINITELY} + +@item more_data_to_come +should be set to @code{MHD_YES} if the provided data in the +@var{send_buf} is part of a larger data package, like an incomplete +message or part of a data stream (and not the final part), and thus +more data is expected to be sent soon over the same connection; set to +@code{MHD_NO} if the data in the @var{send_buf} is the complete +message or the final part of the message (or file) and it should be +pushed to the network (and to the client) as soon as possible; +basically controls network buffering (see Nagle's algorithm and +TCP PUSH). +@end table + +Returns: +@table @code +@item MHD_SC_OK +if any data was sent (check the @var{sent_size}); + +@item MHD_SC_UPGRADED_NET_TIMEOUT +if no data was sent and the timeout was reached; + +@item MHD_SC_UPGRADED_NET_CONN_CLOSED +if the network connection has been closed, +@c FIXME: should the application still call MHD_upgraded_close()? If so, we should say so explicitly! + +@item MHD_SC_UPGRADED_NET_CONN_BROKEN +if a broken network connection has been detected, + +@item MHD_SC_UPGRADED_TLS_ERROR +if a TLS error occured (only possible with TLS connections), + +@item MHD_SC_UPGRADED_NET_HARD_ERROR +if any other network or sockets unrecoverable error occured, + +@item MHD_SC_UPGRADED_HANDLE_INVALID +if @var{urh} is invalid, + +@item MHD_SC_UPGRADED_WAITING_NOT_SUPPORTED +if timed wait is not supported by this MHD build or platform +@end table + +@end deftypefun + + +@anchor{MHD_upgraded_close} +@deftypefun {enum MHD_StatusCode} MHD_upgraded_close (struct MHD_UpgradeHandle *urh) +Close HTTP-Upgraded connection handle. + +The handle cannot be used after successful return from this function. + +The function cannot fail if called correctly (the daemon is not destroyed +and the upgraded connection has not been closed previously). + +@table @var +@item urh +identifies the upgraded connection to close +@end table +Returns @code{MHD_SC_OK} on success, otherwise an error code. +@end deftypefun diff --git a/doc/manual/select.inc b/doc/manual/select.inc @@ -0,0 +1,56 @@ + +@deftypefun enum MHD_Result MHD_get_fdset (struct MHD_Daemon *daemon, fd_set * read_fd_set, fd_set * write_fd_set, fd_set * except_fd_set, int *max_fd) +Obtain the @code{select()} sets for this daemon. The daemon's socket +is added to @var{read_fd_set}. The list of currently existent +connections is scanned and their file descriptors added to the correct +set. + +When calling this function, FD_SETSIZE is assumed to be platform's +default. If you changed FD_SETSIZE for your application, +you should use @code{MHD_get_fdset2()} instead. + +This function should only be called in when MHD is configured to use +external select with @code{select()} or with @code{epoll()}. In +the latter case, it will only add the single @code{epoll()} file +descriptor used by MHD to the sets. + +After the call completed successfully: the variable referenced by +@var{max_fd} references the file descriptor with highest integer +identifier. The variable must be set to zero before invoking this +function. + +Return @code{MHD_YES} on success, @code{MHD_NO} if: the arguments are +invalid (example: @code{NULL} pointers); this daemon was not started with +the right options for this call. +@end deftypefun + + +@deftypefun enum MHD_Result MHD_get_fdset2 (struct MHD_Daemon *daemon, fd_set * read_fd_set, fd_set * write_fd_set, fd_set * except_fd_set, int *max_fd, unsigned int fd_setsize) +Like @code{MHD_get_fdset()}, except that you can manually specify the value of FD_SETSIZE used by your application. +@end deftypefun + + +@deftypefun enum MHD_Result MHD_get_timeout (struct MHD_Daemon *daemon, unsigned long long *timeout) +@cindex timeout +Obtain timeout value for select for this daemon (only needed if +connection timeout is used). The returned value is how many +milliseconds @code{select} should at most block, not the timeout value +set for connections. This function must not be called if the +@code{MHD_USE_THREAD_PER_CONNECTION} mode is in use (since then it is +not meaningful to ask for a timeout, after all, there is concurrenct +activity). The function must also not be called by user-code if +@code{MHD_USE_INTERNAL_POLLING_THREAD} is in use. In the latter case, the +behavior is undefined. + +@table @var +@item daemon +which daemon to obtain the timeout from. +@item timeout +will be set to the timeout (in milliseconds). +@end table + +Return @code{MHD_YES} on success, @code{MHD_NO} if timeouts are not used +(or no connections exist that would necessitate the use of a timeout +right now). +@end deftypefun + diff --git a/doc/manual/structs.inc b/doc/manual/structs.inc @@ -0,0 +1,137 @@ + + +@deftp {C Struct} MHD_Connection +Connection to an HTTP client. Since HTTP2, multiple +sessions can be multiplexed over the same connection. +@end deftp + +@deftp {C Struct} MHD_Session +Since HTTP2, multiple sessions can run over the +same connection. In HTTP/1.x, there is a 1:1 +relationship between sessions and connections. +Since HTTP/1.1, multiple requests can be run +over the same session. +@end deftp + +@deftp {C Struct} MHD_Request +Handle for an HTTP request. +MHD will only show one request per session +to the application at any given time. +@end deftp + +@deftp {C Struct} MHD_Action +Next action to perform when handling a request. +@end deftp + +@deftp {C Struct} MHD_UploadAction +Action that processes data uploaded by a client. +@end deftp + +@deftp {C Struct} MHD_DynamicContentCreatorAction +Action that is used to dynamically create content. +@end deftp + +@deftp {C Struct} MHD_Response +Handle for a response. +@end deftp + +@deftp {C Struct} MHD_UpgradedHandle +Handle for response that has been "upgraded" +(say to a WebSocket). +@end deftp + +@deftp {C Struct} MHD_PostProcessor +@cindex POST method +Handle for @code{POST} processing. +@end deftp + +@deftp {C Struct} MHD_AuthDigestInfo +@cindex Authentication +Represents information about a digest authorization +client header. Includes the cryptographic algorithm, +information about the user name, nonce and other +optional data from the digest authentication request. +@end deftp + +@deftp {C Struct} MHD_AuthDigestUsernameInfo +@cindex Authentication +Represents information about a digest authorization +client header. Includes the cryptographic algorithm, +information about the user name. +@end deftp + +@deftp {C Struct} MHD_AuthBasicCreds +@cindex Authentication +Represents information from a basic authorization +client header. Includes the username and password. +@end deftp + + +@deftp {C Struct} MHD_NameAndValueCStr +Represents key-value pair, consisting of a +to vanilla 0-terminated C-strings without +explicit length field. +@end deftp + +@deftp {C Struct} MHD_NameAndValue +Represents key-value pair, consisting of a +(non-NULL) string key and a (nullable) string +value. Used commonly to represent HTTP headers. +@end deftp + +@deftp {C Struct} MHD_NameAndValueKind +Adds a "kind" field to the @code{MHD_NameAndValue} +to specify the origin of the key-value pair. +@end deftp + +@deftp {C Struct} MHD_PostField +Information about data uploaded as part of an +HTTP "POST" action. Includes the name of the +field, value of the field (possibly NULL), the +filename (possibly NULL), the Mime content-type +(possibly NULL) and the transfer encoding +(possibly NULL). +@end deftp + +@deftp {C Struct} MHD_IoVec +An element of an array of memory buffers. +@end deftp + +@deftp {C Union} MHD_DynContentZCIoVec +Data structure with an array of +@code{MHD_IoVec} IO vectors and a callback +to free associated resources when the +IO vectors are no longer needed. +@end deftp + +@deftp {C Union} MHD_DaemonInfoFixedData +Information about an MHD daemon that will not change. +@end deftp + +@deftp {C Union} MHD_DaemonInfoDynamicData +Information about an MHD daemon that may change. +@end deftp + +@deftp {C Union} MHD_ConnectionInfoFixedData +Information about an MHD connection that will not change. +@end deftp + +@deftp {C Union} MHD_ConnectionInfoDynamicData +Information about an MHD connection that may change. +@end deftp + +@deftp {C Union} MHD_StreamInfoFixedData +Information about an MHD stream that will not change. +@end deftp + +@deftp {C Union} MHD_StreamInfoDynamicData +Information about an MHD stream that may change. +@end deftp + +@deftp {C Union} MHD_RequestInfoFixedData +Information about an MHD request that will not change. +@end deftp + +@deftp {C Union} MHD_RequestInfoDynamicData +Information about an MHD request that may change. +@end deftp diff --git a/doc/manual/utility.inc b/doc/manual/utility.inc @@ -0,0 +1,167 @@ +@menu +* microhttpd-add connection:: Passing externally accepted connections +* microhttpd-util feature:: Test supported MHD features +* microhttpd-util unescape:: Unescape strings +@end menu + + +@c ------------------------------------------------------------ +@node microhttpd-add connection +@section Passing externally accepted connections + + + +@deftypefun void MHD_add_connection (struct MHD_Daemon *daemon, int client_socket, const struct sockaddr *addr, socklen_t addrlen) +Add another client connection to the set of connections +managed by MHD. This API is usually not needed (since +MHD will accept inbound connections on the server socket). +Use this API in special cases, for example if your HTTP +server is behind NAT and needs to connect out to the +HTTP client, or if you are building a proxy. + +If you use this API in conjunction with a internal select or a thread +pool, you must set the option @code{MHD_USE_ITC} to +ensure that the freshly added connection is immediately processed by +MHD. + +The given client socket will be managed (and closed!) by MHD after +this call and must no longer be used directly by the application +afterwards. + +@table @var +@item daemon +daemon that manages the connection +@item client_socket +socket to manage (MHD will expect to receive an HTTP request from this socket next). +@item addr +IP address of the client +@item addrlen +number of bytes in addr +@end table + +This function will return @code{MHD_YES} on success, +@code{MHD_NO} if this daemon could +not handle the connection (i.e. malloc failed, etc). +The socket will be closed in any case; 'errno' is set +to indicate further details about the error. +@end deftypefun + + + +@c ------------------------------------------------------------ +@node microhttpd-util feature +@section Testing for supported MHD features + + +@deftp {Enumeration} MHD_FEATURE +Values of this enum are used to specify what +information about a daemon is desired. +@table @code +@item MHD_FEATURE_MESSAGES +Get whether messages are supported. If supported then in debug +mode messages can be printed to stderr or to external logger. + +@item MHD_FEATURE_SSL +Get whether HTTPS is supported. If supported then flag +MHD_USE_SSL and options MHD_OPTION_HTTPS_MEM_KEY, +MHD_OPTION_HTTPS_MEM_CERT, MHD_OPTION_HTTPS_MEM_TRUST, +MHD_OPTION_HTTPS_MEM_DHPARAMS, MHD_OPTION_HTTPS_CRED_TYPE, +MHD_OPTION_HTTPS_PRIORITIES can be used. + +@item MHD_FEATURE_HTTPS_CERT_CALLBACK +Get whether option #MHD_OPTION_HTTPS_CERT_CALLBACK is +supported. + +@item MHD_FEATURE_IPv6 +Get whether IPv6 is supported. If supported then flag +MHD_USE_IPv6 can be used. + +@item MHD_FEATURE_IPv6_ONLY +Get whether IPv6 without IPv4 is supported. If not supported +then IPv4 is always enabled in IPv6 sockets and +flag MHD_USE_DUAL_STACK if always used when MHD_USE_IPv6 is +specified. + +@item MHD_FEATURE_POLL +Get whether @code{poll()} is supported. If supported then flag +MHD_USE_POLL can be used. + +@item MHD_FEATURE_EPOLL +Get whether @code{epoll()} is supported. If supported then Flags +MHD_USE_EPOLL and +MHD_USE_EPOLL_INTERNAL_THREAD can be used. + +@item MHD_FEATURE_SHUTDOWN_LISTEN_SOCKET +Get whether shutdown on listen socket to signal other +threads is supported. If not supported flag +MHD_USE_ITC is automatically forced. + +@item MHD_FEATURE_SOCKETPAIR +Get whether a @code{socketpair()} is used internally instead of +a @code{pipe()} to signal other threads. + +@item MHD_FEATURE_TCP_FASTOPEN +Get whether TCP Fast Open is supported. If supported then +flag MHD_USE_TCP_FASTOPEN and option +MHD_OPTION_TCP_FASTOPEN_QUEUE_SIZE can be used. + +@item MHD_FEATURE_BASIC_AUTH +Get whether HTTP Basic authorization is supported. If supported +then functions @code{MHD_basic_auth_get_username_password()} and +@code{MHD_queue_basic_auth_fail_response()} can be used. + +@item MHD_FEATURE_DIGEST_AUTH +Get whether HTTP Digest authorization is supported. If +supported then options MHD_OPTION_DIGEST_AUTH_RANDOM, +MHD_OPTION_NONCE_NC_SIZE and functions @code{MHD_digest_auth_check()}, +can be used. + +@item MHD_FEATURE_POSTPROCESSOR +Get whether postprocessor is supported. If supported then +functions @code{MHD_create_post_processor()}, +@code{MHD_post_process()}, @code{MHD_destroy_post_processor()} +can be used. + +@item MHD_FEATURE_SENDFILE +Get whether @code{sendfile()} is supported. + +@end table +@end deftp + + + +@deftypefun {int} MHD_is_feature_supported (enum MHD_FEATURE feature) +Get information about supported MHD features. Indicate that MHD was +compiled with or without support for particular feature. Some features +require additional support by the kernel. However, kernel support is not +checked by this function. + +@table @var +@item feature +type of requested information +@end table + +Returns @code{MHD_YES} if the feature is supported, +and @code{MHD_NO} if not. +@end deftypefun + + +@c ------------------------------------------------------------ +@node microhttpd-util unescape +@section Unescape strings + +@deftypefun {size_t} MHD_http_unescape (char *val) +Process escape sequences ('%HH') Updates val in place; the result +should be UTF-8 encoded and cannot be larger than the input. The +result must also still be 0-terminated. + +@table @var +@item val +value to unescape (modified in the process), must be +a 0-terminated UTF-8 string. +@end table + +Returns length of the resulting val (@code{strlen(val)} may be +shorter afterwards due to elimination of escape sequences). + +@end deftypefun diff --git a/doc/run-gendocs.sh b/doc/run-gendocs.sh