fixed wrong declaration of a stat buffer

This commit is contained in:
hyung-hwan 2012-10-16 09:29:28 +00:00
parent c6530a1c13
commit 8f5a0a3933
2 changed files with 11 additions and 4 deletions

View File

@ -1046,16 +1046,17 @@ static int mux_writable (qse_httpd_t* httpd, qse_ubi_t handle, qse_ntoff_t msec)
static int stat_file ( 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? */ /* TODO: lstat? or stat? */
if (QSE_STAT (path, &st) <= -1) if (QSE_STAT (path, &st) <= -1)
{ {
qse_httpd_seterrnum (httpd, syserr_to_errnum(errno)); qse_httpd_seterrnum (httpd, syserr_to_errnum(errno));
return -1; return -1;
} }
/* stating for a file. it should be a regular file. /* stating for a file. it should be a regular file.
* i don't allow other file types. */ * i don't allow other file types. */

View File

@ -160,6 +160,12 @@ static qse_httpd_server_t* attach_server (
/* override it with a new callback for chaining */ /* override it with a new callback for chaining */
server_xtn_inner->cbstd = cbstd; server_xtn_inner->cbstd = cbstd;
server_xtn_inner->idxstd = idxstd; /* override index file list */ 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("<style type='text/css'>body { background-color:#d0e4fe; font-size: 0.9em; } div.header { font-weight: bold; margin-bottom: 5px; } div.footer { border-top: 1px solid #99AABB; text-align: right; } table { font-size: 0.9em; } td { white-space: nowrap; } td.size { text-align: right; }</style>"), qse_httpd_getmmgr(httpd));
server_xtn_inner->cfg[QSE_HTTPD_SERVER_XTN_CFG_ERRORCSS] =
qse_mbsdup (QSE_MT("<style type='text/css'>body { background-color:#d0e4fe; font-size: 0.9em; } div.header { font-weight: bold; margin-bottom: 5px; } div.footer { border-top: 1px solid #99AABB; text-align: right; }</style>"), qse_httpd_getmmgr(httpd));
return server; return server;
} }