From 8f5a0a393366a0862679829fa515c341d1f77ee4 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 16 Oct 2012 09:29:28 +0000 Subject: [PATCH] fixed wrong declaration of a stat buffer --- qse/lib/net/httpd-std.c | 9 +++++---- qse/samples/net/httpd02.c | 6 ++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/qse/lib/net/httpd-std.c b/qse/lib/net/httpd-std.c index adfd0608..73b56a01 100644 --- a/qse/lib/net/httpd-std.c +++ b/qse/lib/net/httpd-std.c @@ -1046,16 +1046,17 @@ static int mux_writable (qse_httpd_t* httpd, qse_ubi_t handle, qse_ntoff_t msec) static int stat_file ( - qse_httpd_t* httpd, const qse_mchar_t* path, qse_httpd_stat_t* hst, int regonly) + qse_httpd_t* httpd, const qse_mchar_t* path, + qse_httpd_stat_t* hst, int regonly) { - struct stat st; + qse_stat_t st; /* TODO: lstat? or stat? */ if (QSE_STAT (path, &st) <= -1) - { + { qse_httpd_seterrnum (httpd, syserr_to_errnum(errno)); return -1; - } + } /* stating for a file. it should be a regular file. * i don't allow other file types. */ diff --git a/qse/samples/net/httpd02.c b/qse/samples/net/httpd02.c index 8b37dadc..6b5a897c 100644 --- a/qse/samples/net/httpd02.c +++ b/qse/samples/net/httpd02.c @@ -160,6 +160,12 @@ static qse_httpd_server_t* attach_server ( /* override it with a new callback for chaining */ server_xtn_inner->cbstd = cbstd; server_xtn_inner->idxstd = idxstd; /* override index file list */ + + /* don't care about failure */ + server_xtn_inner->cfg[QSE_HTTPD_SERVER_XTN_CFG_DIRCSS] = + qse_mbsdup (QSE_MT(""), qse_httpd_getmmgr(httpd)); + server_xtn_inner->cfg[QSE_HTTPD_SERVER_XTN_CFG_ERRORCSS] = + qse_mbsdup (QSE_MT(""), qse_httpd_getmmgr(httpd)); return server; }