Subversion Repositories Kolibri OS

Rev

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

Rev 4729 Rev 4920
Line 4... Line 4...
4
; If a server decides it needs multiline output,
4
; If a server decides it needs multiline output,
5
; first lines will have a dash instead of space after numbers,
5
; first lines will have a dash instead of space after numbers,
6
; thus they are simply ignored in this simple command parser.
6
; thus they are simply ignored in this simple command parser.
Line 7... Line 7...
7
 
7
 
8
        cmp     dword[s], "150 "
8
        cmp     dword[s], "150 "
Line 9... Line 9...
9
        je      data_ok
9
        je      data_loop
10
 
10
 
Line 11... Line 11...
11
        cmp     dword[s], "220 "
11
        cmp     dword[s], "220 "
Line 98... Line 98...
98
  .fail:
98
  .fail:
99
        invoke  con_write_asciiz, str_unknown
99
        invoke  con_write_asciiz, str_unknown
100
        jmp     wait_for_servercommand
100
        jmp     wait_for_servercommand
Line 101... Line 101...
101
 
101
 
Line 102... Line 102...
102
 
102
 
Line 103... Line 103...
103
data_ok:
103
data_loop:
104
 
104
 
Line 116... Line 116...
116
        cmp     [operation], OPERATION_RETR
116
        cmp     [operation], OPERATION_RETR
117
        je      .retr
117
        je      .retr
Line 118... Line 118...
118
 
118
 
119
; not retreiving, just print to console
119
; not retreiving, just print to console
120
        invoke  con_write_asciiz, buffer_ptr2
120
        invoke  con_write_asciiz, buffer_ptr2
Line 121... Line 121...
121
        jmp     data_ok
121
        jmp     data_loop
122
 
122
 
123
; retreiving, save to file
123
; retreiving, save to file
124
  .retr:
124
  .retr:
125
        mov     [filestruct.ptr], buffer_ptr2
125
        mov     [filestruct.ptr], buffer_ptr2
126
        mov     [filestruct.size], eax
126
        mov     [filestruct.size], eax
127
        push    eax
127
        push    eax
128
        mcall   70, filestruct
128
        mcall   70, filestruct
129
        pop     eax
129
        pop     eax
Line 130... Line 130...
130
        add     [filestruct.offset], eax
130
        add     [filestruct.offset], eax
131
        jmp     data_ok
131
        jmp     data_loop
132
 
132
 
133
; storing, send all data
133
; storing, send all data
Line 147... Line 147...
147
        mcall   send, [datasocket], buffer_ptr2, , 0
147
        mcall   send, [datasocket], buffer_ptr2, , 0
Line 148... Line 148...
148
 
148
 
149
  .done:
149
  .done:
150
        invoke  con_write_asciiz, str_close
150
        invoke  con_write_asciiz, str_close
-
 
151
        mcall   close, [datasocket]
151
        mcall   close, [datasocket]
152
        mov     [operation], OPERATION_NONE
Line 152... Line -...
152
        jmp     wait_for_servercommand
-
 
153
 
153
        jmp     wait_for_servercommand
-
 
154
 
-
 
155
 
154
 
156
close_datacon:
155
 
157
        cmp     [operation], OPERATION_NONE
156
close_datacon:
158
        je      wait_for_usercommand