fixed multiple glitches for building on non-posix platforms
This commit is contained in:
@ -299,6 +299,7 @@ static int dns_open (qse_httpd_t* httpd, qse_httpd_dns_t* dns)
|
||||
|
||||
dns->handle[0] = QSE_INVALID_SCKHND;
|
||||
dns->handle[1] = QSE_INVALID_SCKHND;
|
||||
dns->handle[2] = QSE_INVALID_SCKHND;
|
||||
|
||||
dc = (dns_ctx_t*) qse_httpd_callocmem (httpd, QSE_SIZEOF(dns_ctx_t));
|
||||
if (dc == NULL) goto oops;
|
||||
|
@ -2,7 +2,12 @@
|
||||
|
||||
static void* mod_open (qse_httpd_t* httpd, const qse_char_t* sysname)
|
||||
{
|
||||
#if defined(USE_LTDL)
|
||||
#if defined(QSE_ENABLE_STATIC_MODULE)
|
||||
|
||||
qse_httpd_seterrnum (httpd, QSE_HTTPD_ENOIMPL);
|
||||
return QSE_NULL;
|
||||
|
||||
#elif defined(USE_LTDL)
|
||||
void* h;
|
||||
qse_mchar_t* modpath;
|
||||
|
||||
@ -33,7 +38,7 @@ static void* mod_open (qse_httpd_t* httpd, const qse_char_t* sysname)
|
||||
HMODULE h;
|
||||
|
||||
h = LoadLibrary (sysname);
|
||||
if (!h) qse_httpd_seterrnum (httpd, syserr_to_errnum(GetLastError());
|
||||
if (!h) qse_httpd_seterrnum (httpd, syserr_to_errnum(GetLastError()));
|
||||
|
||||
QSE_ASSERT (QSE_SIZEOF(h) <= QSE_SIZEOF(void*));
|
||||
return h;
|
||||
@ -113,7 +118,10 @@ static void* mod_open (qse_httpd_t* httpd, const qse_char_t* sysname)
|
||||
|
||||
static void mod_close (qse_httpd_t* httpd, void* handle)
|
||||
{
|
||||
#if defined(USE_LTDL)
|
||||
#if defined(QSE_ENABLE_STATIC_MODULE)
|
||||
/* this won't be called at all when modules are linked into
|
||||
* the main library. */
|
||||
#elif defined(USE_LTDL)
|
||||
lt_dlclose (handle);
|
||||
#elif defined(_WIN32)
|
||||
FreeLibrary ((HMODULE)handle);
|
||||
@ -142,7 +150,13 @@ static void* mod_symbol (qse_httpd_t* httpd, void* handle, const qse_char_t* nam
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(USE_LTDL)
|
||||
|
||||
#if defined(QSE_ENABLE_STATIC_MODULE)
|
||||
/* this won't be called at all when modules are linked into
|
||||
* the main library. */
|
||||
s = QSE_NULL;
|
||||
|
||||
#elif defined(USE_LTDL)
|
||||
s = lt_dlsym (handle, mname);
|
||||
if (s == QSE_NULL) qse_httpd_seterrnum (httpd, syserr_to_errnum(errno));
|
||||
#elif defined(_WIN32)
|
||||
|
@ -378,7 +378,7 @@ static void tmr_urs_tmout_handle (qse_tmr_t* tmr, const qse_ntime_t* now, void*
|
||||
tmout_event.handler = tmr_urs_tmout_handle;
|
||||
tmout_event.updater = tmr_urs_tmout_update;
|
||||
|
||||
if (sendto (req->urs_socket, req->pkt, req->pktlen, 0, (struct sockaddr*)&req->urs_skad, req->urs_skadlen) != req->pktlen)
|
||||
if (sendto (req->urs_socket, (void*)req->pkt, req->pktlen, 0, (struct sockaddr*)&req->urs_skad, req->urs_skadlen) != req->pktlen)
|
||||
{
|
||||
/* error. fall thru */
|
||||
qse_httpd_seterrnum (dc->httpd, SKERR_TO_ERRNUM());
|
||||
@ -537,7 +537,7 @@ static int urs_send (qse_httpd_t* httpd, qse_httpd_urs_t* urs, const qse_mchar_t
|
||||
}
|
||||
*/
|
||||
|
||||
if (sendto (req->urs_socket, req->pkt, req->pktlen, 0, (struct sockaddr*)&req->urs_skad, req->urs_skadlen) != req->pktlen)
|
||||
if (sendto (req->urs_socket, (void*)req->pkt, req->pktlen, 0, (struct sockaddr*)&req->urs_skad, req->urs_skadlen) != req->pktlen)
|
||||
{
|
||||
qse_httpd_seterrnum (httpd, SKERR_TO_ERRNUM());
|
||||
printf ("URS SENDTO FAILURE........................\n"); /* TODO: logging */
|
||||
|
@ -51,6 +51,8 @@
|
||||
# define USE_LTDL
|
||||
# endif
|
||||
|
||||
# undef AF_UNIX
|
||||
|
||||
#elif defined(__OS2__)
|
||||
# include <types.h>
|
||||
# include <sys/socket.h>
|
||||
@ -64,8 +66,11 @@
|
||||
# endif
|
||||
# define INCL_DOSERRORS
|
||||
# define INCL_DOSFILEMGR
|
||||
# define INCL_DOSMODULEMGR
|
||||
# include <os2.h>
|
||||
|
||||
# undef AF_UNIX
|
||||
|
||||
#elif defined(__DOS__)
|
||||
/* TODO */
|
||||
# include <errno.h>
|
||||
@ -168,7 +173,7 @@ static qse_httpd_errnum_t skerr_to_errnum (DWORD e)
|
||||
case WSAEINTR:
|
||||
return QSE_HTTPD_EINTR;
|
||||
|
||||
case WASEWOULDBLOCK:
|
||||
case WSAEWOULDBLOCK:
|
||||
return QSE_HTTPD_EAGAIN;
|
||||
|
||||
case WSAECONNREFUSED:
|
||||
@ -826,7 +831,7 @@ static qse_sck_hnd_t open_client_socket (qse_httpd_t* httpd, int domain, int typ
|
||||
#endif
|
||||
*/
|
||||
|
||||
#if defined(AF_INET6) && defined(IPV6_V6ONLY)
|
||||
#if defined(AF_INET6) && defined(IPPROTO_IPV6) && defined(IPV6_V6ONLY)
|
||||
if (domain == AF_INET6)
|
||||
{
|
||||
flag = 1;
|
||||
|
@ -783,7 +783,7 @@ static int activate_servers (qse_httpd_t* httpd)
|
||||
/*
|
||||
httpd->opt.rcb.log (httpd, 0, QSE_T("cannot activate %s"), buf);
|
||||
*/
|
||||
#if 0
|
||||
#if 1
|
||||
qse_printf(QSE_T("cannot activate [%s]\n"), buf);
|
||||
#endif
|
||||
continue;
|
||||
@ -797,7 +797,7 @@ qse_printf(QSE_T("cannot activate [%s]\n"), buf);
|
||||
/*
|
||||
httpd->opt.rcb.log (httpd, 0, QSE_T("cannot activate %s - "), buf);
|
||||
*/
|
||||
#if 0
|
||||
#if 1
|
||||
qse_printf(QSE_T("cannot add handle [%s]\n"), buf);
|
||||
#endif
|
||||
|
||||
@ -1686,6 +1686,7 @@ int qse_httpd_loop (qse_httpd_t* httpd)
|
||||
}
|
||||
if (httpd->server.nactive <= 0)
|
||||
{
|
||||
printf ("no active servers...\n");
|
||||
if (httpd->dnsactive) deactivate_dns (httpd);
|
||||
if (httpd->ursactive) deactivate_urs (httpd);
|
||||
httpd->opt.scb.mux.close (httpd, httpd->mux);
|
||||
@ -1694,6 +1695,7 @@ int qse_httpd_loop (qse_httpd_t* httpd)
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf ("entering loop... ...\n");
|
||||
xret = 0;
|
||||
|
||||
while (!httpd->stopreq)
|
||||
@ -1702,6 +1704,7 @@ int qse_httpd_loop (qse_httpd_t* httpd)
|
||||
count = httpd->opt.scb.mux.poll (httpd, httpd->mux, &tmout);
|
||||
if (count <= -1)
|
||||
{
|
||||
printf ("mux errorr ... ...\n");
|
||||
if (httpd->errnum != QSE_HTTPD_EINTR)
|
||||
{
|
||||
xret = -1;
|
||||
|
Reference in New Issue
Block a user