263,7 → 263,7 |
.number = ($ - .table) / 4 - 1 |
|
s_error: |
DEBUGF 2,"SOCKET: error\n" |
DEBUGF DEBUG_NETWORK_ERROR, "SOCKET: error\n" |
mov dword [esp+32], -1 |
|
ret |
281,7 → 281,7 |
align 4 |
SOCKET_open: |
|
DEBUGF 2,"SOCKET_open: domain=%u type=%u protocol=%x ", ecx, edx, esi |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_open: domain=%u type=%u protocol=%x ", ecx, edx, esi |
|
push ecx edx esi |
call SOCKET_alloc |
289,7 → 289,7 |
jz s_error |
|
mov [esp+32], edi ; return socketnumber |
DEBUGF 2,"socknum=%u\n", edi |
DEBUGF DEBUG_NETWORK_VERBOSE, "socknum=%u\n", edi |
|
; push edx |
; and edx, SO_NONBLOCK |
321,7 → 321,7 |
je .pppoe |
|
.no_ppp: |
DEBUGF 2,"Unknown socket family/protocol\n" |
DEBUGF DEBUG_NETWORK_ERROR, "SOCKET_open: Unknown socket family/protocol\n" |
ret |
|
align 4 |
394,7 → 394,7 |
align 4 |
SOCKET_bind: |
|
DEBUGF 2,"SOCKET_bind: socknum=%u sockaddr=%x length=%u\n", ecx, edx, esi |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_bind: socknum=%u sockaddr=%x length=%u\n", ecx, edx, esi |
|
call SOCKET_num_to_ptr |
jz s_error |
444,7 → 444,7 |
call SOCKET_check_port |
jz s_error ; ZF is set by socket_check_port, on error |
|
DEBUGF 1,"SOCKET_bind: local ip=%u.%u.%u.%u\n",\ |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_bind: local ip=%u.%u.%u.%u\n",\ |
[eax + IP_SOCKET.LocalIP + 0]:1,[eax + IP_SOCKET.LocalIP + 1]:1,\ |
[eax + IP_SOCKET.LocalIP + 2]:1,[eax + IP_SOCKET.LocalIP + 3]:1 |
|
467,7 → 467,7 |
align 4 |
SOCKET_connect: |
|
DEBUGF 2,"SOCKET_connect: socknum=%u sockaddr=%x length=%u\n", ecx, edx, esi |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_connect: socknum=%u sockaddr=%x length=%u\n", ecx, edx, esi |
|
call SOCKET_num_to_ptr |
jz s_error |
616,7 → 616,7 |
align 4 |
SOCKET_listen: |
|
DEBUGF 2,"SOCKET_listen: socknum=%u backlog=%u\n", ecx, edx |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_listen: socknum=%u backlog=%u\n", ecx, edx |
|
call SOCKET_num_to_ptr |
jz s_error |
668,7 → 668,7 |
align 4 |
SOCKET_accept: |
|
DEBUGF 2,"SOCKET_accept: socknum=%u sockaddr=%x length=%u\n", ecx, edx, esi |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_accept: socknum=%u sockaddr=%x length=%u\n", ecx, edx, esi |
|
call SOCKET_num_to_ptr |
jz s_error |
718,7 → 718,7 |
align 4 |
SOCKET_close: |
|
DEBUGF 2,"SOCKET_close: socknum=%u\n", ecx |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_close: socknum=%u\n", ecx |
|
call SOCKET_num_to_ptr |
jz s_error |
767,18 → 767,21 |
align 4 |
SOCKET_receive: |
|
DEBUGF 2,"SOCKET_receive: socknum=%u bufaddr=%x buflength=%u flags=%x\n", ecx, edx, esi, edi |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_receive: socknum=%u bufaddr=%x buflength=%u flags=%x\n", ecx, edx, esi, edi |
|
call SOCKET_num_to_ptr |
jz s_error |
|
jmp [eax + SOCKET.rcv_proc] |
call [eax + SOCKET.rcv_proc] |
|
mov [esp+32], eax |
ret |
|
|
align 4 |
SOCKET_receive_dgram: |
|
DEBUGF 1,"SOCKET_receive: DGRAM\n" |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_receive: DGRAM\n" |
|
mov ebx, esi |
mov edi, edx ; addr to buffer |
787,15 → 790,15 |
get_from_queue (eax + SOCKET_QUEUE_LOCATION), SOCKET_QUEUE_SIZE, sizeof.socket_queue_entry, .block ; destroys esi and ecx |
|
mov ecx, [esi + socket_queue_entry.data_size] |
DEBUGF 1,"SOCKET_receive: %u bytes data\n", ecx |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_receive: %u bytes data\n", ecx |
|
cmp ecx, ebx |
ja .too_small |
|
push ecx |
push [esi + socket_queue_entry.buf_ptr] ; save the buffer addr so we can clear it later |
mov esi, [esi + socket_queue_entry.data_ptr] |
DEBUGF 1,"SOCKET_receive: Source buffer=%x real addr=%x\n", [esp], esi |
mov [esp+32+4], ecx ; return number of bytes copied |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_receive: Source buffer=%x real addr=%x\n", [esp], esi |
|
; copy the data |
shr ecx, 1 |
812,16 → 815,20 |
.nd: |
|
call kernel_free ; remove the packet |
pop eax |
|
ret |
|
.too_small: |
|
DEBUGF 2,"SOCKET_receive: Buffer too small\n" |
jmp s_error |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_receive: Buffer too small\n" |
.fail: |
mov eax, -1 |
ret |
|
.block: |
test [eax + SOCKET.options], SO_NONBLOCK |
jnz s_error |
jnz .fail |
|
call SOCKET_block |
jmp .loop |
846,7 → 853,7 |
align 4 |
SOCKET_receive_stream: |
|
DEBUGF 1,"SOCKET_receive: STREAM\n" |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_receive: STREAM\n" |
|
mov ebx, edi |
mov ecx, esi |
866,12 → 873,11 |
call SOCKET_ring_read |
call SOCKET_ring_free |
|
mov [esp+32], ecx ; return number of bytes copied |
mov eax, ecx ; return number of bytes copied |
ret |
|
.peek: |
mov ecx, [eax + STREAM_SOCKET.rcv + RING_BUFFER.size] |
mov [esp+32], ecx ; return number of bytes available |
mov eax, [eax + STREAM_SOCKET.rcv + RING_BUFFER.size] |
ret |
|
.block: |
882,11 → 888,18 |
jmp .loop |
|
.return0: |
xor ecx, ecx |
mov [esp+32], ecx |
test [eax + SOCKET.options], SS_CANTRCVMORE |
jz .ok |
|
xor eax, eax |
dec eax |
ret |
|
.ok: |
xor eax, eax |
ret |
|
|
;----------------------------------------------------------------- |
; |
; SOCKET_send |
902,7 → 915,7 |
align 4 |
SOCKET_send: |
|
DEBUGF 2,"SOCKET_send: socknum=%u data ptr=%x length=%u flags=%x\n", ecx, edx, esi, edi |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_send: socknum=%u data ptr=%x length=%u flags=%x\n", ecx, edx, esi, edi |
|
call SOCKET_num_to_ptr |
jz s_error |
916,7 → 929,7 |
align 4 |
SOCKET_send_udp: |
|
DEBUGF 1,"SOCKET_send: UDP\n" |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_send: UDP\n" |
|
mov [esp+32], ecx |
call UDP_output |
928,7 → 941,7 |
align 4 |
SOCKET_send_tcp: |
|
DEBUGF 1,"SOCKET_send: TCP\n" |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_send: TCP\n" |
|
push eax |
add eax, STREAM_SOCKET.snd |
944,7 → 957,7 |
align 4 |
SOCKET_send_ip: |
|
DEBUGF 1,"SOCKET_send: IPv4\n" |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_send: IPv4\n" |
|
mov [esp+32], ecx |
call IPv4_output_raw |
956,7 → 969,7 |
align 4 |
SOCKET_send_icmp: |
|
DEBUGF 1,"SOCKET_send: ICMP\n" |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_send: ICMP\n" |
|
mov [esp+32], ecx |
call ICMP_output_raw |
968,7 → 981,7 |
align 4 |
SOCKET_send_pppoe: |
|
DEBUGF 1,"SOCKET_send: PPPoE\n" |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_send: PPPoE\n" |
|
mov [esp+32], ecx |
mov ebx, [eax + SOCKET.device] |
998,7 → 1011,7 |
align 4 |
SOCKET_send_local_: |
|
DEBUGF 1,"SOCKET_send: LOCAL\n" |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_send: LOCAL\n" |
|
; get the other side's socket and check if it still exists |
mov eax, [eax + SOCKET.device] |
1037,7 → 1050,7 |
align 4 |
SOCKET_get_opt: |
|
DEBUGF 2,"SOCKET_get_opt\n" |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_get_opt\n" |
|
call SOCKET_num_to_ptr |
jz s_error |
1087,7 → 1100,7 |
align 4 |
SOCKET_set_opt: |
|
DEBUGF 2,"SOCKET_set_opt\n" |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_set_opt\n" |
|
call SOCKET_num_to_ptr |
jz s_error |
1116,7 → 1129,7 |
jz s_error |
mov [eax + SOCKET.device], edx |
|
DEBUGF 1,"SOCKET_set_opt: Bound socket %x to device %x\n",eax, edx |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_set_opt: Bound socket %x to device %x\n",eax, edx |
|
mov dword [esp+32], 0 ; success! |
ret |
1158,7 → 1171,7 |
align 4 |
SOCKET_pair: |
|
DEBUGF 2,"SOCKET_pair\n" |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_pair\n" |
|
call SOCKET_alloc |
jz s_error |
1217,7 → 1230,7 |
align 4 |
SOCKET_debug: |
|
DEBUGF 1,"SOCKET_debug\n" |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_debug\n" |
|
mov edi, edx |
|
1266,7 → 1279,7 |
align 4 |
SOCKET_find_port: |
|
DEBUGF 2,"SOCKET_find_port\n" |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_find_port\n" |
|
push ebx esi ecx |
|
1327,7 → 1340,7 |
align 4 |
SOCKET_check_port: |
|
DEBUGF 2,"SOCKET_check_port: " |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_check_port: " |
|
mov ecx, [eax + SOCKET.Protocol] |
mov edx, [eax + IP_SOCKET.LocalIP] |
1347,11 → 1360,11 |
cmp [esi + UDP_SOCKET.LocalPort], bx |
jne .next_socket |
|
DEBUGF 2,"local port %x already in use\n", bx ; FIXME: find a way to print big endian values with debugf |
DEBUGF DEBUG_NETWORK_VERBOSE, "local port %x already in use\n", bx ; FIXME: find a way to print big endian values with debugf |
ret |
|
.port_ok: |
DEBUGF 2,"local port %x is free\n", bx ; FIXME: find a way to print big endian values with debugf |
DEBUGF DEBUG_NETWORK_VERBOSE, "local port %x is free\n", bx ; FIXME: find a way to print big endian values with debugf |
mov [eax + UDP_SOCKET.LocalPort], bx |
or bx, bx ; clear the zero-flag |
ret |
1378,7 → 1391,7 |
align 4 |
SOCKET_input: |
|
DEBUGF 2,"SOCKET_input: socket=%x, data=%x size=%u\n", eax, esi, ecx |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_input: socket=%x, data=%x size=%u\n", eax, esi, ecx |
|
mov [esp+4], ecx |
push esi |
1386,7 → 1399,7 |
|
add_to_queue (eax + SOCKET_QUEUE_LOCATION), SOCKET_QUEUE_SIZE, sizeof.socket_queue_entry, SOCKET_input.full |
|
DEBUGF 1,"SOCKET_input: success\n" |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_input: success\n" |
add esp, sizeof.socket_queue_entry |
|
pusha |
1397,7 → 1410,7 |
jmp SOCKET_notify |
|
.full: |
DEBUGF 2,"SOCKET_input: socket %x is full!\n", eax |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_input: socket %x is full!\n", eax |
|
pusha |
lea ecx, [eax + SOCKET.mutex] |
1424,7 → 1437,7 |
stdcall create_ring_buffer, SOCKET_MAXDATA, PG_SW |
pop edx |
|
DEBUGF 1,"SOCKET_ring_created: %x\n", eax |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_ring_created: %x\n", eax |
|
pusha |
lea ecx, [esi + RING_BUFFER.mutex] |
1458,7 → 1471,7 |
align 4 |
SOCKET_ring_write: |
|
DEBUGF 1,"SOCKET_ring_write: ringbuff=%x ptr=%x size=%u\n", eax, esi, ecx |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_ring_write: ringbuff=%x ptr=%x size=%u\n", eax, esi, ecx |
|
; lock mutex |
pusha |
1474,7 → 1487,7 |
mov ecx, edi |
.copy: |
mov edi, [eax + RING_BUFFER.write_ptr] |
DEBUGF 2,"SOCKET_ring_write: %u bytes from %x to %x\n", ecx, esi, edi |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_ring_write: %u bytes from %x to %x\n", ecx, esi, edi |
|
; update write ptr |
push edi |
1532,7 → 1545,7 |
align 4 |
SOCKET_ring_read: |
|
DEBUGF 1,"SOCKET_ring_read: ringbuff=%x ptr=%x size=%u offset=%x\n", eax, edi, ecx, edx |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_ring_read: ringbuff=%x ptr=%x size=%u offset=%x\n", eax, edi, ecx, edx |
|
pusha |
lea ecx, [eax + RING_BUFFER.mutex] |
1555,7 → 1568,7 |
ja .less_data |
|
.copy: |
DEBUGF 2,"SOCKET_ring_read: %u bytes from %x to %x\n", ecx, esi, edi |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_ring_read: %u bytes from %x to %x\n", ecx, esi, edi |
push ecx |
shr ecx, 1 |
jnc .nb |
1578,7 → 1591,7 |
call mutex_unlock ; TODO: check what registers this function actually destroys |
popa |
|
DEBUGF 1,"SOCKET_ring_read: no data at all!\n" |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_ring_read: no data at all!\n" |
xor ecx, ecx |
ret |
|
1602,7 → 1615,7 |
align 4 |
SOCKET_ring_free: |
|
DEBUGF 1,"SOCKET_ring_free: %u bytes from ring %x\n", ecx, eax |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_ring_free: %u bytes from ring %x\n", ecx, eax |
|
push eax ecx |
lea ecx, [eax + RING_BUFFER.mutex] |
1627,7 → 1640,7 |
ret |
|
.error: ; we could free all available bytes, but that would be stupid, i guess.. |
DEBUGF 1,"SOCKET_ring_free: buffer=%x error!\n", eax |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_ring_free: buffer=%x error!\n", eax |
add [eax + RING_BUFFER.size], ecx |
|
push eax |
1652,7 → 1665,7 |
align 4 |
SOCKET_block: |
|
DEBUGF 1,"SOCKET_block: %x\n", eax |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_block: %x\n", eax |
|
pushf |
cli |
1667,7 → 1680,7 |
|
; Remember the thread ID so we can wake it up again |
mov edx, [edx + TASKDATA.pid] |
DEBUGF 1,"SOCKET_block: suspending thread: %u\n", edx |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_block: suspending thread: %u\n", edx |
mov [eax + SOCKET.TID], edx |
pop edx |
|
1674,7 → 1687,7 |
call change_task |
popf |
|
DEBUGF 1,"SOCKET_block: continueing\n" |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_block: continueing\n" |
|
ret |
|
1692,7 → 1705,7 |
align 4 |
SOCKET_notify: |
|
DEBUGF 1,"SOCKET_notify: %x\n", eax |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_notify: %x\n", eax |
|
call SOCKET_check |
jz .error |
1728,7 → 1741,7 |
shl ecx, 8 |
or [ecx + SLOT_BASE + APPDATA.event_mask], EVENT_NETWORK |
|
DEBUGF 1,"SOCKET_notify: Raised a network event!\n" |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_notify: Raised a network event!\n" |
|
jmp .done |
|
1756,7 → 1769,7 |
|
; Run the thread |
mov [esi + TASKDATA.state], 0 ; Running |
DEBUGF 1,"SOCKET_notify: Unblocked socket!\n" |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_notify: Unblocked socket!\n" |
|
.done: |
pop esi ecx eax |
1785,7 → 1798,7 |
push ebx |
|
stdcall kernel_alloc, SOCKETBUFFSIZE |
DEBUGF 1, "SOCKET_alloc: ptr=%x\n", eax |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_alloc: ptr=%x\n", eax |
or eax, eax |
jz .exit |
|
1821,7 → 1834,7 |
.last_socket: |
mov [last_socket_num], edi |
mov [eax + SOCKET.Number], edi |
DEBUGF 1, "SOCKET_alloc: number=%u\n", edi |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_alloc: number=%u\n", edi |
|
; Fill in PID |
mov ebx, [TASK_BASE] |
1878,7 → 1891,7 |
align 4 |
SOCKET_free: |
|
DEBUGF 1, "SOCKET_free: %x\n", eax |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_free: %x\n", eax |
|
call SOCKET_check |
jz .error |
1906,7 → 1919,7 |
mov ebx, [eax + SOCKET.NextPtr] |
mov eax, [eax + SOCKET.PrevPtr] |
|
DEBUGF 1, "SOCKET_free: linking socket %x to socket %x\n", eax, ebx |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_free: linking socket %x to socket %x\n", eax, ebx |
|
test eax, eax |
jz @f |
1921,7 → 1934,7 |
call kernel_free |
pop ebx |
|
DEBUGF 1, "SOCKET_free: success!\n" |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_free: success!\n" |
|
.error: |
ret |
1939,7 → 1952,7 |
align 4 |
SOCKET_fork: |
|
DEBUGF 1,"SOCKET_fork: %x\n", ebx |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_fork: %x\n", ebx |
|
; Exit if backlog queue is full |
mov eax, [ebx + SOCKET_QUEUE_LOCATION + queue.size] |
1971,7 → 1984,7 |
.fail2: |
add esp, 4+4+4 |
.fail: |
DEBUGF 1,"SOCKET_fork: failed\n" |
DEBUGF DEBUG_NETWORK_ERROR, "SOCKET_fork: failed\n" |
xor eax, eax |
ret |
|
1990,7 → 2003,7 |
align 4 |
SOCKET_num_to_ptr: |
|
DEBUGF 1,"SOCKET_num_to_ptr: num=%u ", ecx |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_num_to_ptr: num=%u ", ecx |
|
mov eax, net_sockets |
|
2003,11 → 2016,11 |
|
test eax, eax |
|
DEBUGF 1,"ptr=%x\n", eax |
DEBUGF DEBUG_NETWORK_VERBOSE, "ptr=%x\n", eax |
ret |
|
.error: |
DEBUGF 1,"not found\n", eax |
DEBUGF DEBUG_NETWORK_ERROR, "SOCKET_nuto_ptr: not found\n", eax |
ret |
|
|
2025,7 → 2038,7 |
align 4 |
SOCKET_ptr_to_num: |
|
DEBUGF 1,"SOCKET_ptr_to_num: ptr=%x ", eax |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_ptr_to_num: ptr=%x ", eax |
|
call SOCKET_check |
jz .error |
2032,11 → 2045,11 |
|
mov eax, [eax + SOCKET.Number] |
|
DEBUGF 1,"num=%u\n", eax |
DEBUGF DEBUG_NETWORK_VERBOSE, "num=%u\n", eax |
ret |
|
.error: |
DEBUGF 1,"not found\n", eax |
DEBUGF DEBUG_NETWORK_ERROR, "SOCKET_ptr_to_num: not found\n", eax |
ret |
|
|
2054,7 → 2067,7 |
align 4 |
SOCKET_check: |
|
DEBUGF 1,"SOCKET_check: %x\n", eax |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_check: %x\n", eax |
|
push ebx |
mov ebx, net_sockets |
2088,7 → 2101,7 |
align 4 |
SOCKET_check_owner: |
|
DEBUGF 1,"SOCKET_check_owner: %x\n", eax |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_check_owner: %x\n", eax |
|
push ebx |
mov ebx, [TASK_BASE] |
2116,7 → 2129,7 |
align 4 |
SOCKET_process_end: |
|
DEBUGF 1, "SOCKET_process_end: %x\n", edx |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_process_end: %x\n", edx |
|
push ebx |
mov ebx, net_sockets |
2130,7 → 2143,7 |
cmp [ebx + SOCKET.PID], edx |
jne .next_socket |
|
DEBUGF 1, "SOCKET_process_end: killing socket %x\n", ebx |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_process_end: killing socket %x\n", ebx |
|
mov [ebx + SOCKET.PID], 0 |
mov eax, ebx |
2160,7 → 2173,7 |
align 4 |
SOCKET_is_connecting: |
|
DEBUGF 1,"SOCKET_is_connecting: %x\n", eax |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_is_connecting: %x\n", eax |
|
and [eax + SOCKET.options], not (SS_ISCONNECTED + SS_ISDISCONNECTING + SS_ISCONFIRMING) |
or [eax + SOCKET.options], SS_ISCONNECTING |
2181,7 → 2194,7 |
align 4 |
SOCKET_is_connected: |
|
DEBUGF 1,"SOCKET_is_connected: %x\n", eax |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_is_connected: %x\n", eax |
|
and [eax + SOCKET.options], not (SS_ISCONNECTING + SS_ISDISCONNECTING + SS_ISCONFIRMING) |
or [eax + SOCKET.options], SS_ISCONNECTED |
2203,7 → 2216,7 |
align 4 |
SOCKET_is_disconnecting: |
|
DEBUGF 1,"SOCKET_is_disconnecting: %x\n", eax |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_is_disconnecting: %x\n", eax |
|
and [eax + SOCKET.options], not (SS_ISCONNECTING) |
or [eax + SOCKET.options], SS_ISDISCONNECTING + SS_CANTRCVMORE + SS_CANTSENDMORE |
2224,7 → 2237,7 |
align 4 |
SOCKET_is_disconnected: |
|
DEBUGF 1,"SOCKET_is_disconnected: %x\n", eax |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_is_disconnected: %x\n", eax |
|
and [eax + SOCKET.options], not (SS_ISCONNECTING + SS_ISCONNECTED + SS_ISDISCONNECTING) |
or [eax + SOCKET.options], SS_CANTRCVMORE + SS_CANTSENDMORE |
2257,10 → 2270,12 |
align 4 |
SOCKET_cant_recv_more: |
|
DEBUGF 1,"SOCKET_cant_recv_more: %x\n", eax |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_cant_recv_more: %x\n", eax |
|
or [eax + SOCKET.options], SS_CANTRCVMORE |
|
call SOCKET_notify |
|
ret |
|
|
2277,8 → 2292,11 |
align 4 |
SOCKET_cant_send_more: |
|
DEBUGF 1,"SOCKET_cant_send_more: %x\n", eax |
DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_cant_send_more: %x\n", eax |
|
or [eax + SOCKET.options], SS_CANTSENDMORE |
mov [eax + SOCKET.snd_proc], s_error |
|
call SOCKET_notify |
|
ret |