aboutsummaryrefslogtreecommitdiff
path: root/doc/microhttpd.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/microhttpd.texi')
-rw-r--r--doc/microhttpd.texi183
1 files changed, 112 insertions, 71 deletions
diff --git a/doc/microhttpd.texi b/doc/microhttpd.texi
index 71c814f0..66b728aa 100644
--- a/doc/microhttpd.texi
+++ b/doc/microhttpd.texi
@@ -113,7 +113,7 @@ GNU libmicrohttpd is a GNU package.
113* microhttpd-responses:: Building responses to requests. 113* microhttpd-responses:: Building responses to requests.
114* microhttpd-dauth:: Utilizing Authentication. 114* microhttpd-dauth:: Utilizing Authentication.
115* microhttpd-post:: Adding a @code{POST} processor. 115* microhttpd-post:: Adding a @code{POST} processor.
116* microhttpd-info:: Obtaining status information. 116* microhttpd-info:: Obtaining and modifying status information.
117 117
118Appendices 118Appendices
119 119
@@ -706,73 +706,6 @@ own private copy of the data for processing.
706@end deftp 706@end deftp
707 707
708 708
709@deftp {Enumeration} MHD_ConnectionInfoType
710Values of this enum are used to specify what information about a
711connection is desired.
712
713@table @code
714
715@item MHD_CONNECTION_INFO_CIPHER_ALGO
716What cipher algorithm is being used (HTTPS connections only).
717Takes no extra arguments.
718NULL is returned for non-HTTPS connections.
719
720@item MHD_CONNECTION_INFO_PROTOCOL,
721Takes no extra arguments. Allows finding out the TLS/SSL protocol used
722(HTTPS connections only).
723NULL is returned for non-HTTPS connections.
724
725@item MHD_CONNECTION_INFO_CLIENT_ADDRESS
726Returns information about the address of the client. Returns
727essentially a @code{struct sockaddr **} (since the API returns
728a @code{union MHD_ConnectionInfo *} and that union contains
729a @code{struct sockaddr *}).
730
731@item MHD_CONNECTION_INFO_GNUTLS_SESSION,
732Takes no extra arguments. Allows access to the underlying GNUtls session,
733including access to the underlying GNUtls client certificate
734(HTTPS connections only). Takes no extra arguments.
735NULL is returned for non-HTTPS connections.
736
737@item MHD_CONNECTION_INFO_GNUTLS_CLIENT_CERT,
738Dysfunctional (never implemented, deprecated). Use
739MHD_CONNECTION_INFO_GNUTLS_SESSION to get the @code{gnutls_session_t}
740and then call @code{gnutls_certificate_get_peers()}.
741
742@item MHD_CONNECTION_INFO_DAEMON
743Returns information about @code{struct MHD_Daemon} which manages
744this connection.
745
746@end table
747@end deftp
748
749
750
751
752@deftp {Enumeration} MHD_DaemonInfoType
753Values of this enum are used to specify what
754information about a daemon is desired.
755@table @code
756@item MHD_DAEMON_INFO_KEY_SIZE
757Request information about the key size for a particular cipher
758algorithm. The cipher algorithm should be passed as an extra argument
759(of type 'enum MHD_GNUTLS_CipherAlgorithm').
760
761@item MHD_DAEMON_INFO_MAC_KEY_SIZE
762Request information about the key size for a particular cipher
763algorithm. The cipher algorithm should be passed as an extra argument
764(of type 'enum MHD_GNUTLS_HashAlgorithm').
765
766@item MHD_DAEMON_INFO_LISTEN_FD
767@cindex listen
768Request the file-descriptor number that MHD is using to listen to the
769server socket. This can be useful if no port
770was specified and a client needs to learn what port
771is actually being used by MHD.
772No extra arguments should be passed.
773
774@end table
775@end deftp
776 709
777 710
778@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 711@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -1394,8 +1327,6 @@ Return @mynull{} on error (i.e. invalid arguments, out of memory).
1394@deftypefun {struct MHD_Response *} MHD_create_response_from_fd (uint64_t size, int fd) 1327@deftypefun {struct MHD_Response *} MHD_create_response_from_fd (uint64_t size, int fd)
1395Create a response object. The response object can be extended with 1328Create a response object. The response object can be extended with
1396header information and then it can be used any number of times. 1329header information and then it can be used any number of times.
1397Function is deprecated, use @code{MHD_create_response_from_fd_at_offset}
1398instead (with an offset of zero).
1399 1330
1400@table @var 1331@table @var
1401@item size 1332@item size
@@ -1942,12 +1873,13 @@ of this function.
1942 1873
1943@c ------------------------------------------------------------ 1874@c ------------------------------------------------------------
1944@node microhttpd-info 1875@node microhttpd-info
1945@chapter Obtaining status information. 1876@chapter Obtaining and modifying status information.
1946 1877
1947 1878
1948@menu 1879@menu
1949* microhttpd-info daemon:: State information about an MHD daemon 1880* microhttpd-info daemon:: State information about an MHD daemon
1950* microhttpd-info conn:: State information about a connection 1881* microhttpd-info conn:: State information about a connection
1882* microhttpd-option conn:: Modify per-connection options
1951@end menu 1883@end menu
1952 1884
1953 1885
@@ -1977,6 +1909,34 @@ in case the desired information is not available or
1977applicable. 1909applicable.
1978@end deftypefun 1910@end deftypefun
1979 1911
1912
1913@deftp {Enumeration} MHD_DaemonInfoType
1914Values of this enum are used to specify what
1915information about a daemon is desired.
1916@table @code
1917@item MHD_DAEMON_INFO_KEY_SIZE
1918Request information about the key size for a particular cipher
1919algorithm. The cipher algorithm should be passed as an extra argument
1920(of type 'enum MHD_GNUTLS_CipherAlgorithm').
1921
1922@item MHD_DAEMON_INFO_MAC_KEY_SIZE
1923Request information about the key size for a particular cipher
1924algorithm. The cipher algorithm should be passed as an extra argument
1925(of type 'enum MHD_GNUTLS_HashAlgorithm').
1926
1927@item MHD_DAEMON_INFO_LISTEN_FD
1928@cindex listen
1929Request the file-descriptor number that MHD is using to listen to the
1930server socket. This can be useful if no port
1931was specified and a client needs to learn what port
1932is actually being used by MHD.
1933No extra arguments should be passed.
1934
1935@end table
1936@end deftp
1937
1938
1939
1980@c ------------------------------------------------------------ 1940@c ------------------------------------------------------------
1981@node microhttpd-info conn 1941@node microhttpd-info conn
1982@section Obtaining state information about a connection 1942@section Obtaining state information about a connection
@@ -2003,6 +1963,87 @@ in case the desired information is not available or
2003applicable. 1963applicable.
2004@end deftypefun 1964@end deftypefun
2005 1965
1966@deftp {Enumeration} MHD_ConnectionInfoType
1967Values of this enum are used to specify what information about a
1968connection is desired.
1969
1970@table @code
1971
1972@item MHD_CONNECTION_INFO_CIPHER_ALGO
1973What cipher algorithm is being used (HTTPS connections only).
1974Takes no extra arguments.
1975NULL is returned for non-HTTPS connections.
1976
1977@item MHD_CONNECTION_INFO_PROTOCOL,
1978Takes no extra arguments. Allows finding out the TLS/SSL protocol used
1979(HTTPS connections only).
1980NULL is returned for non-HTTPS connections.
1981
1982@item MHD_CONNECTION_INFO_CLIENT_ADDRESS
1983Returns information about the address of the client. Returns
1984essentially a @code{struct sockaddr **} (since the API returns
1985a @code{union MHD_ConnectionInfo *} and that union contains
1986a @code{struct sockaddr *}).
1987
1988@item MHD_CONNECTION_INFO_GNUTLS_SESSION,
1989Takes no extra arguments. Allows access to the underlying GNUtls session,
1990including access to the underlying GNUtls client certificate
1991(HTTPS connections only). Takes no extra arguments.
1992NULL is returned for non-HTTPS connections.
1993
1994@item MHD_CONNECTION_INFO_GNUTLS_CLIENT_CERT,
1995Dysfunctional (never implemented, deprecated). Use
1996MHD_CONNECTION_INFO_GNUTLS_SESSION to get the @code{gnutls_session_t}
1997and then call @code{gnutls_certificate_get_peers()}.
1998
1999@item MHD_CONNECTION_INFO_DAEMON
2000Returns information about @code{struct MHD_Daemon} which manages
2001this connection.
2002
2003@end table
2004@end deftp
2005
2006
2007
2008@c ------------------------------------------------------------
2009@node microhttpd-option conn
2010@section Setting custom options for an individual connection
2011@cindex timeout
2012
2013
2014
2015@deftypefun {int} MHD_set_connection_option (struct MHD_Connection *daemon, enum MHD_CONNECTION_OPTION option, ...)
2016Set a custom option for the given connection.
2017
2018@table @var
2019@item connection
2020the connection for which an option should be set or modified;
2021
2022@item option
2023option to set
2024
2025@item ...
2026additional arguments for the option (depending on option)
2027@end table
2028
2029Returns @code{MHD_YES} on success, @code{MHD_NO} for errors
2030(i.e. option argument invalid or option unknown).
2031@end deftypefun
2032
2033
2034@deftp {Enumeration} MHD_CONNECTION_OPTION
2035Values of this enum are used to specify which option for a
2036connection should be changed.
2037
2038@table @code
2039
2040@item MHD_CONNECTION_OPTION_TIMEOUT
2041Set a custom timeout for the given connection. Specified
2042as the number of seconds, given as an @code{unsigned int}. Use
2043zero for no timeout.
2044
2045@end table
2046@end deftp
2006 2047
2007 2048
2008@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2049@c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++