Check-in [5deb74c177]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Adapted to the latest API changes in FreshLibDev.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:5deb74c177a0a2c74720ef13f06892b8f5b08011
User & Date: johnfound 2014-03-17 16:42:53
Context
2014-07-16
09:08
Fixed a bug in the "sockets.asm". Fixed the uConfig arguments change in FreshLib. check-in: da7a22ae97 user: lhmnai0 tags: trunk
2014-03-17
16:43
Create new branch named "HelpServer" check-in: 1fef166cab user: johnfound tags: HelpServer
16:42
Adapted to the latest API changes in FreshLibDev. check-in: 5deb74c177 user: johnfound tags: trunk
2013-01-12
20:43
Changed the use of uConfig library, because of changed API. Latest FreshLibDev have to be use for compilation. check-in: 047343ff0e user: JohnFound tags: trunk
Changes

Changes to phWeb/phWeb.

cannot compute difference between binary files

Changes to phWeb/phWeb.asm.

1
2
3
4

5
6
7
8
9
10
11
..
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

71
72
73
74
75
76
77
..
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
...
123
124
125
126
127
128
129
130
131
132
133
134
135
include "%lib%/freshlib.inc"
@BinaryType console

options.DebugMode = 0


include "%lib%/freshlib.asm"

include 'sockets.asm'
include 'requests.asm'
include 'static.asm'

................................................................................
        FinalizeAll
        stdcall TerminateAll, 0

; ================== Loading config file ===================

; procedure load and parse configuration data
proc LoadConfiguration
.config TConfig
begin
        pushad

        lea     esi, [.config]

        stdcall CfgLoad, esi, cDefaultConfig
        jc      .error_open_file

        stdcall CfgGetInt, esi, 'Binding:BindPort'
        jnc     .save_port
        mov     eax, 8080
.save_port:
        mov     [cfgBindPort], eax

        stdcall CfgGetInt, esi, 'Binding:BindIP'
        jnc     .save_addr
        mov     eax, $7f000001
.save_addr:
        mov     [cfgBindIp], eax

        stdcall CfgGetRecord, esi, 'WebSite:DocumentRoot'

        jnc     .save_root
        stdcall StrNew
        stdcall StrCharCat, '.'
.save_root:
        mov     [cfgRoot], eax
        stdcall StrClipSpacesR, [cfgRoot]
        stdcall StrClipSpacesL, [cfgRoot]
................................................................................
        mov     ecx, eax
        stdcall StrPtr, [cfgRoot]
        cmp     byte [eax+ecx-1], DIR_SLASH
        je      .root_ok
        stdcall StrCharCat, [cfgRoot], DIR_SLASH
.root_ok:

        stdcall CfgClean, esi

        popad
        return

.error_open_file:
        mov     dword [cfgBindIp], $7f000001
        mov     dword [cfgBindPort], 8080
        stdcall StrNew
        stdcall StrCharCat, '.'+$100*DIR_SLASH
        mov     [cfgRoot], eax
        popad
        return
endp


; ------------------------------------------------------------

................................................................................
cCRLF           text  13, 10, 0

cDefaultConfig  text  './phWeb.conf'  ; default config file. The command line option can override this.
cDefaultRoot    text  "./"
cDefaultFile    text  "index.html"




@AllImportSection
@AllDataSection





|
>







 







<



<
<
<
<
<
|
<
<
<


|
<
<
<


<
>







 







<
<
<
<
<
<
<
<
<
<
<







 








<
<
<
<
<
1
2
3
4
5
6
7
8
9
10
11
12
..
43
44
45
46
47
48
49

50
51
52





53



54
55
56



57
58

59
60
61
62
63
64
65
66
..
69
70
71
72
73
74
75











76
77
78
79
80
81
82
...
101
102
103
104
105
106
107
108





include "%lib%/freshlib.inc"
@BinaryType console

options.DebugMode = 1
options.ShowSizes = 1

include "%lib%/freshlib.asm"

include 'sockets.asm'
include 'requests.asm'
include 'static.asm'

................................................................................
        FinalizeAll
        stdcall TerminateAll, 0

; ================== Loading config file ===================

; procedure load and parse configuration data
proc LoadConfiguration

begin
        pushad






        stdcall CfgGetInt, cDefaultConfig, 'Binding.BindPort', 8080



        mov     [cfgBindPort], eax

        stdcall CfgGetInt, cDefaultConfig, 'Binding.BindIP', $7f000001



        mov     [cfgBindIp], eax


        stdcall CfgGetStr, cDefaultConfig, 'WebSite.DocumentRoot'
        jnc     .save_root
        stdcall StrNew
        stdcall StrCharCat, '.'
.save_root:
        mov     [cfgRoot], eax
        stdcall StrClipSpacesR, [cfgRoot]
        stdcall StrClipSpacesL, [cfgRoot]
................................................................................
        mov     ecx, eax
        stdcall StrPtr, [cfgRoot]
        cmp     byte [eax+ecx-1], DIR_SLASH
        je      .root_ok
        stdcall StrCharCat, [cfgRoot], DIR_SLASH
.root_ok:












        popad
        return
endp


; ------------------------------------------------------------

................................................................................
cCRLF           text  13, 10, 0

cDefaultConfig  text  './phWeb.conf'  ; default config file. The command line option can override this.
cDefaultRoot    text  "./"
cDefaultFile    text  "index.html"








Changes to phWeb/phWeb.conf.

1
2
3
4
5
6
Binding:
  BindIP=$7f000001
  BindPort=7000

WebSite:
  DocumentRoot=./www
<
|
|

<
|

1
2
3

4

Binding.BindIP   = $7f000001
Binding.BindPort = 7000


WebSite.DocumentRoot = "./www"

Changes to phWeb/phWeb.exe.

cannot compute difference between binary files