Subversion Repositories Kolibri OS

Rev

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

Rev 3618 Rev 3687
Line 123... Line 123...
123
        push    hostname; hostname
123
        push    hostname; hostname
124
        call    [getaddrinfo]
124
        call    [getaddrinfo]
125
        pop     esi
125
        pop     esi
126
; test for error
126
; test for error
127
        test    eax, eax
127
        test    eax, eax
128
        jnz     fail
128
        jnz     dns_error
Line 129... Line 129...
129
 
129
 
130
        call    [con_cls]
130
        call    [con_cls]
131
        push    str3
131
        push    str3
132
        call    [con_write_asciiz]
132
        call    [con_write_asciiz]
Line 154... Line 154...
154
        push    str9
154
        push    str9
155
        call    [con_write_asciiz]
155
        call    [con_write_asciiz]
Line 156... Line 156...
156
 
156
 
157
        mcall   socket, AF_INET4, SOCK_STREAM, 0
157
        mcall   socket, AF_INET4, SOCK_STREAM, 0
158
        cmp     eax, -1
158
        cmp     eax, -1
159
        jz      fail2
159
        jz      socket_err
Line 160... Line 160...
160
        mov     [socketnum], eax
160
        mov     [socketnum], eax
Line 161... Line 161...
161
 
161
 
Line 197... Line 197...
197
        add     esi, 3                  ; a command is always 3 bytes
197
        add     esi, 3                  ; a command is always 3 bytes
198
        jmp     .scan_cmd
198
        jmp     .scan_cmd
199
  .no_cmd:
199
  .no_cmd:
Line 200... Line 200...
200
 
200
 
201
        cmp     esi, buffer_ptr
201
        cmp     esi, buffer_ptr
Line 202... Line 202...
202
        je      .print_loop
202
        je      .print
Line 203... Line 203...
203
 
203
 
204
    DEBUGF  1, 'TELNET: sending data\n'
204
    DEBUGF  1, 'TELNET: sending data\n'
205
 
205
 
206
        push    esi edi
206
        push    esi edi
Line 207... Line 207...
207
        sub     esi, buffer_ptr
207
        sub     esi, buffer_ptr
208
        mcall   send, [socketnum], buffer_ptr, , 0
-
 
209
        pop     edi esi
208
        mcall   send, [socketnum], buffer_ptr, , 0
210
 
209
        pop     edi esi
Line 211... Line -...
211
  .print_loop:
-
 
212
    DEBUGF  1, 'TELNET: printloop\n'
-
 
213
        cmp     esi, edi
-
 
214
        jae     mainloop
-
 
215
 
-
 
216
        cmp     byte [esi], 0x1b        ; escape character
-
 
217
        jne     .print_byte
-
 
218
        inc     esi
-
 
219
 
-
 
220
        cmp     word [esi], 0x485b      ; move cursor to beginning
-
 
221
        jne     @f
-
 
222
        inc     esi
210
 
223
        inc     esi
-
 
224
 
211
  .print:
225
    DEBUGF  1, 'TELNET: resetting cursor \n'
-
 
226
 
212
        cmp     esi, edi
227
        push    0
213
        jae     mainloop
228
        push    0
214
 
229
        call    [con_set_cursor_pos]
215
        push    esi
230
        jmp     .print_loop
216
        call    [con_write_asciiz]
231
 
-
 
232
  @@:
-
 
233
        inc     esi
-
 
234
        inc     esi
-
 
235
        jmp     .print_loop
-
 
236
 
-
 
237
  .print_byte:
217
 
Line 238... Line 218...
238
        push    dword 1
218
  .loop:
-
 
219
        lodsb
239
        push    esi                     ; next string to print
220
        test    al, al
240
        inc     esi
221
        jz      .print
Line 241... Line 222...
241
        call    [con_write_string]
222
        jmp     .loop
Line 242... Line 223...
242
        jmp     .print_loop
223
 
-
 
224
 
243
 
225
socket_err:
244
 
226
        DEBUGF  1, "TELNET: socket error %d", ebx
Line 245... Line 227...
245
fail2:
227
        push    str6