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 struct server_xtn_t
{ {
int tproxy; int tproxy;
int nodir; /* no directory listing */
qse_httpd_server_cbstd_t* orgcbstd; qse_httpd_server_cbstd_t* orgcbstd;
}; };
@ -85,19 +86,16 @@ static int makersrc (
} }
else else
{ {
#if 0
if (server_xtn->orgcbstd->makersrc (httpd, client, req, rsrc) <= -1) return -1; 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) if (server_xtn->orgcbstd->freersrc)
server_xtn->orgcbstd->freersrc (httpd, client, req, rsrc); server_xtn->orgcbstd->freersrc (httpd, client, req, rsrc);
rsrc->type = QSE_HTTPD_RSRC_ERROR; rsrc->type = QSE_HTTPD_RSRC_ERR;
rsrc->u.error.code = 403; rsrc->u.err.code = 403;
} }
return 0; 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); signal (SIGPIPE, SIG_IGN);
#endif #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); qse_httpd_setoption (httpd, QSE_HTTPD_CGIERRTONUL);

View File

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

View File

@ -354,6 +354,7 @@ struct del_op_t
{ {
#if defined(_WIN32) #if defined(_WIN32)
/* nothing */ /* nothing */
int __dummy; /* just a placeholder */
#elif defined(__OS2__) #elif defined(__OS2__)
qse_mchar_t* path; qse_mchar_t* path;
#elif defined(__DOS__) #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); qse_ubi_t infd = qse_fio_gethandleasubi (in_fd.ptr);
#if !defined(_LP64) && (QSE_SIZEOF_VOID_P<8) && defined(HAVE_SENDFILE64) #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 #else
return sendfile (out_fd, infd.i, offset, count); return sendfile (out_fd, infd.i, offset, count);
#endif #endif
@ -1060,7 +1060,7 @@ static int stat_file (
qse_btime_t bt; qse_btime_t bt;
qse_ntime_t nt; qse_ntime_t nt;
#if 0 #if 0
HDIR h; HDIR h;
ULONG count; ULONG count;
@ -1078,7 +1078,8 @@ static int stat_file (
if (rc != NO_ERROR) return -1; if (rc != NO_ERROR) return -1;
DosFindClose (h); DosFindClose (h);
#endif #endif
rc = DosQueryPathInfo (path, FIL_STANDARDL, &ffb, QSE_SIZEOF(ffb)); rc = DosQueryPathInfo (path, FIL_STANDARDL, &ffb, QSE_SIZEOF(ffb));
if (rc != NO_ERROR) return -1; if (rc != NO_ERROR) return -1;
@ -1120,6 +1121,7 @@ static int stat_file (
qse_stat_t 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));
@ -1160,6 +1162,10 @@ static int stat_file (
static int file_stat ( static int file_stat (
qse_httpd_t* httpd, const qse_mchar_t* path, qse_httpd_stat_t* hst) 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); return stat_file (httpd, path, hst, 1);
} }
@ -1610,7 +1616,8 @@ if (qse_htre_getcontentlen(req) > 0)
else else
{ {
task = qse_httpd_entaskrsrc (httpd, client, QSE_NULL, &rsrc, req); 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; if (task == QSE_NULL) goto oops;
} }
@ -2016,7 +2023,7 @@ auth_ok:
if (xpath == QSE_NULL) return -1; if (xpath == QSE_NULL) return -1;
qse_printf (QSE_T(">>> check if [%hs] is a directory\n"), xpath); 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); qse_printf (QSE_T(">>> [%hs] is a directory\n"), xpath);
/* it is a directory */ /* it is a directory */

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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