fixed a bug due to QSE_FIO_MBSPATH

added more watcom targets
This commit is contained in:
hyung-hwan 2012-12-09 01:31:55 +00:00
parent 828de9af20
commit 1d947c202f
30 changed files with 2382 additions and 148 deletions

View File

@ -48,6 +48,7 @@ typedef struct server_xtn_t server_xtn_t;
struct server_xtn_t
{
int tproxy;
int nodir; /* no directory listing */
qse_httpd_server_cbstd_t* orgcbstd;
};
@ -85,19 +86,16 @@ static int makersrc (
}
else
{
#if 0
if (server_xtn->orgcbstd->makersrc (httpd, client, req, rsrc) <= -1) return -1;
if (rsrc->type == QSE_HTTPD_RSRC_DIR)
if (server_xtn->nodir && rsrc->type == QSE_HTTPD_RSRC_DIR)
{
/* no directory listing - */
/* prohibit no directory listing */
if (server_xtn->orgcbstd->freersrc)
server_xtn->orgcbstd->freersrc (httpd, client, req, rsrc);
rsrc->type = QSE_HTTPD_RSRC_ERROR;
rsrc->u.error.code = 403;
rsrc->type = QSE_HTTPD_RSRC_ERR;
rsrc->u.err.code = 403;
}
return 0;
#endif
return server_xtn->orgcbstd->makersrc (httpd, client, req, rsrc);
}
}
@ -217,7 +215,7 @@ static int httpd_main (int argc, qse_char_t* argv[])
signal (SIGPIPE, SIG_IGN);
#endif
qse_httpd_setname (httpd, QSE_MT("httpd02/qse 1.0"));
qse_httpd_setname (httpd, QSE_MT("qsehttpd 1.0"));
qse_httpd_setoption (httpd, QSE_HTTPD_CGIERRTONUL);

View File

@ -403,7 +403,7 @@ int qse_fio_init (
if (flags & QSE_FIO_MBSPATH)
{
handle = CreateFileA (
path, desired_access, share_mode,
(const qse_mchar_t*)path, desired_access, share_mode,
QSE_NULL, /* set noinherit by setting no secattr */
creation_disposition, flag_and_attr, 0
);
@ -892,7 +892,10 @@ int qse_fio_init (
#if defined(QSE_CHAR_IS_MCHAR)
/* nothing to do */
#else
if (path_mb != path_mb_buf) QSE_MMGR_FREE (mmgr, path_mb);
if (path_mb != path_mb_buf && path_mb != path)
{
QSE_MMGR_FREE (mmgr, path_mb);
}
#endif
if (handle == -1)
{
@ -1361,7 +1364,7 @@ static int get_devname_from_handle (
}
getmappedfilename = (getmappedfilename_t)
GetProcAddress (psapi, QSE_T("GetMappedFileName"));
GetProcAddress (psapi, QSE_MT("GetMappedFileName"));
if (!getmappedfilename)
{
fio->errnum = syserr_to_errnum (GetLastError());

View File

@ -354,6 +354,7 @@ struct del_op_t
{
#if defined(_WIN32)
/* nothing */
int __dummy; /* just a placeholder */
#elif defined(__OS2__)
qse_mchar_t* path;
#elif defined(__DOS__)

View File

@ -253,7 +253,7 @@ static qse_ssize_t __send_file (
qse_ubi_t infd = qse_fio_gethandleasubi (in_fd.ptr);
#if !defined(_LP64) && (QSE_SIZEOF_VOID_P<8) && defined(HAVE_SENDFILE64)
return sendfile64 (out_f_fdd, infd.i, offset, count);
return sendfile64 (out_fd, infd.i, offset, count);
#else
return sendfile (out_fd, infd.i, offset, count);
#endif
@ -1060,7 +1060,7 @@ static int stat_file (
qse_btime_t bt;
qse_ntime_t nt;
#if 0
#if 0
HDIR h;
ULONG count;
@ -1078,7 +1078,8 @@ static int stat_file (
if (rc != NO_ERROR) return -1;
DosFindClose (h);
#endif
#endif
rc = DosQueryPathInfo (path, FIL_STANDARDL, &ffb, QSE_SIZEOF(ffb));
if (rc != NO_ERROR) return -1;
@ -1120,6 +1121,7 @@ static int stat_file (
qse_stat_t st;
/* TODO: lstat? or stat? */
if (QSE_STAT (path, &st) <= -1)
{
qse_httpd_seterrnum (httpd, syserr_to_errnum(errno));
@ -1160,6 +1162,10 @@ static int stat_file (
static int file_stat (
qse_httpd_t* httpd, const qse_mchar_t* path, qse_httpd_stat_t* hst)
{
/* this callback is not required to be a general stat function
* for a file. it is mainly used to get a file size and timestamps
* of a regular file. so it should fail for a non-regular file.
* note that 1 passes 1 to stat_file for it */
return stat_file (httpd, path, hst, 1);
}
@ -1610,7 +1616,8 @@ if (qse_htre_getcontentlen(req) > 0)
else
{
task = qse_httpd_entaskrsrc (httpd, client, QSE_NULL, &rsrc, req);
if (server_xtn->cfg2.s.cbstd->freersrc) server_xtn->cfg2.s.cbstd->freersrc (httpd, client, req, &rsrc);
if (server_xtn->cfg2.s.cbstd->freersrc)
server_xtn->cfg2.s.cbstd->freersrc (httpd, client, req, &rsrc);
}
if (task == QSE_NULL) goto oops;
}
@ -2016,7 +2023,7 @@ auth_ok:
if (xpath == QSE_NULL) return -1;
qse_printf (QSE_T(">>> check if [%hs] is a directory\n"), xpath);
if (httpd->scb->file.stat (httpd, xpath, &st) >= 0 && st.isdir)
if (stat_file (httpd, xpath, &st, 0) >= 0 && st.isdir)
{
qse_printf (QSE_T(">>> [%hs] is a directory\n"), xpath);
/* it is a directory */

View File

@ -12,7 +12,7 @@ EXE
3
WString
5
dw2eo
dw2e9
1
0
1

View File

@ -12,7 +12,7 @@ EXE
3
WString
5
dw2eo
dw2e9
1
0
1

View File

@ -12,7 +12,7 @@ LIB
3
WString
5
d_2so
d_2s9
1
0
1

View File

@ -12,7 +12,7 @@ LIB
3
WString
5
d_2so
d_2s9
1
0
1

View File

@ -12,7 +12,7 @@ LIB
3
WString
5
d_2so
d_2s9
1
0
1

View File

@ -12,7 +12,7 @@ CWDLL
3
WString
5
dx2do
dx2d9
1
0
1

View File

@ -12,7 +12,7 @@ CWDLL
3
WString
5
dx2do
dx2d9
1
0
1

View File

@ -12,7 +12,7 @@ CWDLL
3
WString
5
dx2do
dx2d9
1
0
1

View File

@ -12,7 +12,7 @@ OEXE
3
WString
5
oc2eo
oc2e9
1
0
1

View File

@ -12,7 +12,7 @@ OEXE
3
WString
5
oc2eo
oc2e9
1
0
1

View File

@ -12,7 +12,7 @@ OEXE
3
WString
5
oc2eo
oc2e9
1
0
1

View File

@ -12,7 +12,7 @@ ODLL
3
WString
5
o_2do
o_2d9
1
0
1

View File

@ -12,7 +12,7 @@ LIB
3
WString
5
o_2so
o_2s9
1
0
1

View File

@ -12,7 +12,7 @@ ODLL
3
WString
5
o_2do
o_2d9
1
0
1

View File

@ -12,7 +12,7 @@ LIB
3
WString
5
o_2so
o_2s9
1
0
1

View File

@ -12,7 +12,7 @@ ODLL
3
WString
5
o_2do
o_2d9
1
0
1

View File

@ -12,7 +12,7 @@ ODLL
3
WString
5
o_2do
o_2d9
1
0
1

View File

@ -12,7 +12,7 @@ ODLL
3
WString
5
o_2do
o_2d9
1
0
1

View File

@ -0,0 +1,145 @@
40
targetIdent
0
MProject
1
MComponent
0
2
WString
4
NEXE
3
WString
5
nc2e9
1
0
1
4
MCommand
0
5
MCommand
0
6
MItem
10
qseawk.exe
7
WString
4
NEXE
8
WVList
2
9
MVState
10
WString
7
WINLINK
11
WString
28
?????Library directories(;):
1
12
WString
27
../../lib/cmn ../../lib/awk
0
13
MVState
14
WString
7
WINLINK
15
WString
18
?????Libraries(,):
1
16
WString
20
qsecmn qseawk ws2_32
0
17
WVList
0
-1
1
1
0
18
WPickList
2
19
MItem
3
*.c
20
WString
4
COBJ
21
WVList
2
22
MVState
23
WString
3
WCC
24
WString
25
n????Include directories:
1
25
WString
53
"$(%watcom)/h;$(%watcom)/h/nt;../../../../../include"
0
26
MVState
27
WString
3
WCC
28
WString
23
?????Macro definitions:
1
29
WString
15
QSE_BUILD_DEBUG
0
30
WVList
0
-1
1
1
0
31
MItem
28
../../../../../cmd/awk/awk.c
32
WString
4
COBJ
33
WVList
0
34
WVList
0
19
1
1
0

View File

@ -0,0 +1,325 @@
40
targetIdent
0
MProject
1
MComponent
0
2
WString
4
NDLL
3
WString
5
n_2d9
1
0
1
4
MCommand
0
5
MCommand
0
6
MItem
10
qseawk.dll
7
WString
4
NDLL
8
WVList
2
9
MVState
10
WString
5
WLINK
11
WString
28
?????Library directories(;):
1
12
WString
13
../../lib/cmn
0
13
MVState
14
WString
5
WLINK
15
WString
18
?????Libraries(,):
1
16
WString
6
qsecmn
0
17
WVList
0
-1
1
1
0
18
WPickList
12
19
MItem
3
*.c
20
WString
4
COBJ
21
WVList
2
22
MVState
23
WString
3
WCC
24
WString
25
n????Include directories:
1
25
WString
53
"$(%watcom)/h;$(%watcom)/h/nt;../../../../../include"
0
26
MVState
27
WString
3
WCC
28
WString
23
?????Macro definitions:
1
29
WString
15
QSE_BUILD_DEBUG
0
30
WVList
0
-1
1
1
0
31
MItem
28
../../../../../lib/awk/awk.c
32
WString
4
COBJ
33
WVList
0
34
WVList
0
19
1
1
0
35
MItem
28
../../../../../lib/awk/err.c
36
WString
4
COBJ
37
WVList
0
38
WVList
0
19
1
1
0
39
MItem
28
../../../../../lib/awk/fnc.c
40
WString
4
COBJ
41
WVList
0
42
WVList
0
19
1
1
0
43
MItem
29
../../../../../lib/awk/misc.c
44
WString
4
COBJ
45
WVList
0
46
WVList
0
19
1
1
0
47
MItem
30
../../../../../lib/awk/parse.c
48
WString
4
COBJ
49
WVList
0
50
WVList
0
19
1
1
0
51
MItem
28
../../../../../lib/awk/rec.c
52
WString
4
COBJ
53
WVList
0
54
WVList
0
19
1
1
0
55
MItem
28
../../../../../lib/awk/rio.c
56
WString
4
COBJ
57
WVList
0
58
WVList
0
19
1
1
0
59
MItem
28
../../../../../lib/awk/run.c
60
WString
4
COBJ
61
WVList
0
62
WVList
0
19
1
1
0
63
MItem
28
../../../../../lib/awk/std.c
64
WString
4
COBJ
65
WVList
0
66
WVList
0
19
1
1
0
67
MItem
29
../../../../../lib/awk/tree.c
68
WString
4
COBJ
69
WVList
0
70
WVList
0
19
1
1
0
71
MItem
28
../../../../../lib/awk/val.c
72
WString
4
COBJ
73
WVList
0
74
WVList
0
19
1
1
0

File diff suppressed because it is too large Load Diff

View File

@ -4,8 +4,8 @@ projectIdent
VpeMain
1
WRect
530
80
0
0
9310
9640
2
@ -16,7 +16,7 @@ MCommand
4
MCommand
0
21
24
5
WFileName
30
@ -102,11 +102,23 @@ WFileName
30
debug/os2/cmd/net/qsehttpd.tgt
26
WVList
21
WFileName
30
debug/win32/lib/cmn/qsecmn.tgt
27
VComponent
WFileName
30
debug/win32/lib/awk/qseawk.tgt
28
WFileName
30
debug/win32/cmd/awk/qseawk.tgt
29
WVList
24
30
VComponent
31
WRect
1060
2480
@ -114,34 +126,18 @@ WRect
4200
1
0
29
32
WFileName
30
release/os2/lib/cmn/qsecmn.tgt
0
1
30
VComponent
31
WRect
80
1213
5690
4200
1
0
32
WFileName
30
release/os2/lib/sed/qsesed.tgt
0
0
33
VComponent
34
WRect
2090
1360
80
1200
5690
4200
1
@ -149,28 +145,44 @@ WRect
35
WFileName
30
release/os2/cmd/sed/qsesed.tgt
release/os2/lib/sed/qsesed.tgt
0
0
1
36
VComponent
37
WRect
2090
1360
5690
4200
1
0
38
WFileName
30
release/os2/cmd/sed/qsesed.tgt
0
1
39
VComponent
40
WRect
2810
320
5690
4200
1
0
38
41
WFileName
28
debug/os2/lib/cmn/qsecmn.tgt
0
0
39
42
VComponent
40
43
WRect
1030
2320
@ -178,15 +190,15 @@ WRect
4200
1
0
41
44
WFileName
28
debug/os2/lib/sed/qsesed.tgt
0
3
42
45
VComponent
43
46
WRect
400
280
@ -194,31 +206,31 @@ WRect
4200
1
0
44
47
WFileName
28
debug/os2/lib/awk/qseawk.tgt
0
0
45
48
VComponent
46
49
WRect
320
373
360
5690
4200
1
0
47
50
WFileName
28
debug/os2/cmd/awk/qseawk.tgt
0
1
48
51
VComponent
49
52
WRect
2660
0
@ -226,42 +238,26 @@ WRect
4200
1
0
50
53
WFileName
30
debug/dos32/lib/cmn/qsecmn.tgt
0
2
51
VComponent
52
WRect
2920
1253
5690
4200
1
0
53
WFileName
30
debug/dos32/lib/awk/qseawk.tgt
0
0
54
VComponent
55
WRect
0
160
2920
1240
5690
4200
1
0
0
56
WFileName
30
debug/dos32/cmd/awk/qseawk.tgt
debug/dos32/lib/awk/qseawk.tgt
0
0
57
@ -269,7 +265,7 @@ VComponent
58
WRect
0
0
160
5690
4200
1
@ -277,15 +273,15 @@ WRect
59
WFileName
30
debug/dos32/lib/sed/qsesed.tgt
debug/dos32/cmd/awk/qseawk.tgt
0
0
5
60
VComponent
61
WRect
570
520
0
0
5690
4200
1
@ -293,28 +289,44 @@ WRect
62
WFileName
30
debug/dos32/cmd/sed/qsesed.tgt
debug/dos32/lib/sed/qsesed.tgt
0
1
5
63
VComponent
64
WRect
570
520
5690
4200
1
0
65
WFileName
30
debug/dos32/cmd/sed/qsesed.tgt
0
1
66
VComponent
67
WRect
0
0
5690
4200
1
0
0
65
68
WFileName
28
debug/os2/cmd/sed/qsesed.tgt
0
0
66
69
VComponent
67
70
WRect
2590
1040
@ -322,15 +334,15 @@ WRect
4200
1
0
68
71
WFileName
31
debug/dos32/mod/awk/awk-sys.tgt
0
0
69
72
VComponent
70
73
WRect
1120
200
@ -338,15 +350,15 @@ WRect
4200
1
0
71
74
WFileName
29
debug/os2/mod/awk/awk-sys.tgt
0
0
72
75
VComponent
73
76
WRect
460
3040
@ -354,63 +366,63 @@ WRect
4240
1
0
74
77
WFileName
29
debug/os2/mod/awk/awk-dir.tgt
0
0
75
VComponent
76
WRect
570
533
5690
4240
1
0
77
WFileName
31
debug/dos32/mod/awk/awk-dir.tgt
0
0
78
VComponent
79
WRect
200
173
5700
4320
570
520
5690
4240
1
0
80
WFileName
31
debug/dos32/mod/awk/awk-str.tgt
debug/dos32/mod/awk/awk-dir.tgt
0
0
81
VComponent
82
WRect
200
160
5700
4320
1
0
83
WFileName
31
debug/dos32/mod/awk/awk-str.tgt
0
0
84
VComponent
85
WRect
410
1360
5700
4320
1
0
83
86
WFileName
29
debug/os2/mod/awk/awk-str.tgt
0
0
84
87
VComponent
85
88
WRect
3050
120
@ -418,26 +430,74 @@ WRect
4240
1
0
86
89
WFileName
28
debug/os2/lib/net/qsenet.tgt
0
0
87
90
VComponent
88
91
WRect
290
280
5700
4253
4240
1
0
0
89
92
WFileName
30
debug/os2/cmd/net/qsehttpd.tgt
0
1
93
VComponent
94
WRect
270
240
5700
4280
0
87
0
95
WFileName
30
debug/win32/lib/cmn/qsecmn.tgt
0
0
96
VComponent
97
WRect
660
1040
5700
4280
0
0
98
WFileName
30
debug/win32/lib/awk/qseawk.tgt
0
0
99
VComponent
100
WRect
500
480
5700
4280
0
0
101
WFileName
30
debug/win32/cmd/awk/qseawk.tgt
0
0
99

View File

@ -12,7 +12,7 @@ OEXE
3
WString
5
oc2eo
oc2e9
1
0
1

View File

@ -12,7 +12,7 @@ LIB
3
WString
5
o_2so
o_2s9
1
0
1

View File

@ -12,7 +12,7 @@ LIB
3
WString
5
o_2so
o_2s9
1
0
1