libmicrohttpd2

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

utility.inc (1670B)


      1 @menu
      2 * microhttpd-add connection::   Passing externally accepted connections
      3 @c * microhttpd-util feature::     Test supported MHD features
      4 @c * microhttpd-util unescape::    Unescape strings
      5 @end menu
      6 
      7 
      8 @c ------------------------------------------------------------
      9 @node microhttpd-add connection
     10 @section Passing externally accepted connections
     11 
     12 
     13 @anchor{MHD_daemon_add_connection}
     14 @deftypefun void MHD_daemon_add_connection (struct MHD_Daemon *daemon, MHD_Socket client_socket, size_t addrlen, const struct sockaddr *addr, void *connection_cntx)
     15 Add another client connection to the set of connections
     16 managed by MHD.  This API is usually not needed (since
     17 MHD will accept inbound connections on the server socket).
     18 Use this API in special cases, for example if your HTTP
     19 server is behind NAT and needs to connect out to the
     20 HTTP client, or if you are building a proxy.
     21 
     22 The given client socket will be managed (and closed!) by MHD after
     23 this call and must no longer be used directly by the application
     24 afterwards.
     25 
     26 The client socket will be closed by MHD even if error returned.
     27  
     28 @table @var
     29 @item daemon
     30 daemon that manages the connection
     31 @item client_socket
     32 socket to manage (MHD will expect to receive an HTTP request from this socket next).
     33 @item addrlen
     34 number of bytes in @var{addr}
     35 @item addr
     36 IP address of the client
     37 @item connection_cntx meta data the application wants to
     38  *        associate with the new connection object
     39 @end table
     40 
     41 This function will return @code{MHD_SC_OK} on success,
     42 or an code indicating an error if this daemon could
     43 not handle the connection (i.e. malloc failed, etc).
     44 The socket will be closed in any case.
     45 @end deftypefun
     46 
     47