libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] options in array for daemon start


From: Marco Maggi
Subject: [libmicrohttpd] options in array for daemon start
Date: Thu, 03 Dec 2009 09:38:45 +0100

Ciao,

  I am writing an MHD binding for a language which makes use
of an FFI;  the current API to start  and configure a daemon
is  difficult  to  use  because  the FFI  does  not  support
interfacing with variadic functions.

  I  wonder  if   it  is  possible  to  add   an  option  to
"MHD_start_daemon()"  which causes  the options  to  be read
from a  C array, somewhat like  cURL's "curl_formadd()" does
with the CURLFORM_ARRAY option.  It should be something like:

typedef struct MHD_option_item {
  enum MHD_OPTION       key;
  intptr_t              val;
} MHD_option_item;

MHD_option_item ops[3] = {
  { MHD_OPTION_CONNECTION_LIMIT, 100 },
  { MHD_OPTION_CONNECTION_TIMEOUT, 10 },
  { MHD_OPTION_END, 0 }
};

d = MHD_start_daemon(0, 8080, NULL, NULL, dh, NULL,
                     MHD_OPTION_ARRAY, ops,
                     MHD_OPTION_END);

TIA
-- 
Marco Maggi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]