Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 4142 → Rev 4143

/programs/network/ircc/socket.inc
3,6 → 3,7
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; Written by hidnplayr@kolibrios.org ;;
;; ;;
;; GNU GENERAL PUBLIC LICENSE ;;
;; Version 2, June 1991 ;;
12,13 → 13,13
 
socket_connect:
 
; cmp [status], STATUS_CONNECTED ; TODO
; je disconnect
 
; ignore if status is not "disconnected"
cmp [status], STATUS_DISCONNECTED
jne .nothing
jne .reconnect
 
if TIMESTAMP
call print_timestamp
end if
mov esi, str_connecting
call print_text2
mov esi, irc_server_name
63,12 → 64,14
cmp eax, -1
jz .fail_refused
 
.nothing:
ret
 
.fail:
mov [status], STATUS_DISCONNECTED
 
if TIMESTAMP
call print_timestamp
end if
mov esi, str_sockerr
call print_text2
 
77,6 → 80,9
.fail_dns:
mov [status], STATUS_DISCONNECTED
 
if TIMESTAMP
call print_timestamp
end if
mov esi, str_dnserr
call print_text2
 
85,13 → 91,28
.fail_refused:
mov [status], STATUS_DISCONNECTED
 
if TIMESTAMP
call print_timestamp
end if
mov esi, str_refused
call print_text2
 
ret
 
.reconnect:
 
if TIMESTAMP
call print_timestamp
end if
mov esi, str_reconnect
call print_text2
 
mov esi, quit_msg
call cmd_usr_quit.with_message
 
jmp socket_connect
 
 
socket_write_userinfo:
 
; create packet in packetbuf
180,26 → 201,12
inc [status]
 
.connected:
call read_incoming_data
call socket_receive
ret
 
 
disconnect:
socket_receive:
 
cmp [status], STATUS_DISCONNECTED
je .nothing
 
mcall close, [socketnum]
 
mov [status], STATUS_DISCONNECTED
 
.nothing:
ret
 
 
 
read_incoming_data:
 
pusha
 
; TODO: read more data if we receive one full packet