Subversion Repositories Kolibri OS

Rev

Rev 4158 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4158 Rev 4160
Line 29... Line 29...
29
        dd      I_END+0x1000    ; required memory
29
        dd      I_END+0x1000    ; required memory
30
        dd      I_END+0x1000    ; esp
30
        dd      I_END+0x1000    ; esp
31
        dd      params          ; I_PARAM
31
        dd      params          ; I_PARAM
32
        dd      0x0             ; I_Path
32
        dd      0x0             ; I_Path
Line 33... Line 33...
33
 
33
 
34
include '../../macros.inc'
34
include '../../../../macros.inc'
35
include '../../proc32.inc'
35
include '../../../../proc32.inc'
36
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
36
include '../../../../dll.inc'
37
include '../../dll.inc'
37
include '../../../../debug-fdo.inc'
38
include '../../debug-fdo.inc'
38
include '../../box_lib/trunk/box_lib.mac'
Line 39... Line 39...
39
include '../../develop/libraries/http/http.inc'
39
include '../../http/http.inc'
40
 
40
 
41
virtual at 0
41
virtual at 0
Line 53... Line 53...
53
 
53
 
54
; check parameters
54
; check parameters
55
        cmp     byte[params], 0         ; no parameters ?
55
        cmp     byte[params], 0         ; no parameters ?
Line -... Line 56...
-
 
56
        je      reset_events            ; load the GUI
-
 
57
 
56
        je      reset_events            ; load the GUI
58
        inc     [silently]
Line 57... Line 59...
57
 
59
 
Line 58... Line 60...
58
download:
60
download:
Line 67... Line 69...
67
  .loop:
69
  .loop:
68
        invoke  HTTP_process, [identifier]
70
        invoke  HTTP_process, [identifier]
69
        test    eax, eax
71
        test    eax, eax
70
        jnz     .loop
72
        jnz     .loop
Line -... Line 73...
-
 
73
 
-
 
74
        test    [silently], 0xff
-
 
75
        jnz     save
71
 
76
 
72
reset_events:
77
reset_events:
Line 73... Line 78...
73
        DEBUGF  1, "resetting events\n"
78
        DEBUGF  1, "resetting events\n"
74
 
79
 
Line 141... Line 146...
141
        lea     ebx, [ebp + http_msg.data]
146
        lea     ebx, [ebp + http_msg.data]
142
        add     ebx, [ebp + http_msg.header_length]
147
        add     ebx, [ebp + http_msg.header_length]
143
        mov     [final_buffer], ebx
148
        mov     [final_buffer], ebx
144
        mcall   70, fileinfo
149
        mcall   70, fileinfo
Line 145... Line 150...
145
 
150
 
146
  .done:
-
 
147
 
151
        test    [silently], 0xff
Line 148... Line 152...
148
; TODO: if called from command line, then exit
152
        jnz     exit
149
 
153
 
150
        mov     ecx, [sc.work_text]
154
        mov     ecx, [sc.work_text]
Line 151... Line 155...
151
        or      ecx, 0x80000000
155
        or      ecx, 0x80000000
Line 152... Line 156...
152
        mcall   4, <10, 93>, , download_complete
156
        mcall   4, <10, 93>, , download_complete
153
 
157
 
154
        ret
158
        jmp     still
Line 202... Line 206...
202
library lib_http,       'http.obj', \
206
library lib_http,       'http.obj', \
203
        box_lib,        'box_lib.obj'
207
        box_lib,        'box_lib.obj'
Line 204... Line 208...
204
 
208
 
205
import  lib_http, \
209
import  lib_http, \
206
        HTTP_get                , 'get' , \
-
 
207
        find_header_field       , 'find_header_field' , \
210
        HTTP_get                , 'get' , \
Line 208... Line 211...
208
        HTTP_process            , 'process'
211
        HTTP_process            , 'process'
209
 
212
 
210
import  box_lib, \
213
import  box_lib, \
Line 229... Line 232...
229
include_debug_strings
232
include_debug_strings
Line 230... Line 233...
230
 
233
 
Line 231... Line 234...
231
;---------------------------------------------------------------------
234
;---------------------------------------------------------------------
232
 
235
 
233
type_pls        db 'URL:', 0
236
type_pls        db 'URL:', 0
234
button_text     db 'DOWNLOAD     STOP     RESAVE', 0
237
button_text     db 'DOWNLOAD     STOP      SAVE', 0
-
 
238
download_complete db 'File saved as /rd/1/.download', 0
Line 235... Line 239...
235
download_complete db 'File saved as /rd/1/.download', 0
239
title           db 'HTTP Downloader', 0
236
title           db 'HTTP Downloader', 0
240
silently        db 0
237
 
241
 
238
;---------------------------------------------------------------------
242
;---------------------------------------------------------------------