Rev 4365 | Rev 4436 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4365 | Rev 4366 | ||
---|---|---|---|
Line 712... | Line 712... | ||
712 | 712 | ||
Line 713... | Line 713... | ||
713 | .tcp: |
713 | .tcp: |
Line -... | Line 714... | ||
- | 714 | ||
- | 715 | call TCP_usrclosed |
|
- | 716 | ||
- | 717 | test eax, eax |
|
- | 718 | jz @f |
|
714 | 719 | call TCP_output ; If connection is not closed yet, send the FIN |
|
Line 715... | Line 720... | ||
715 | call TCP_usrclosed |
720 | @@: |
716 | 721 | ||
Line 2194... | Line 2199... | ||
2194 | ; |
2199 | ; |
2195 | ; SOCKET_process_end |
2200 | ; SOCKET_process_end |
2196 | ; |
2201 | ; |
2197 | ; Kernel calls this function when a certain process ends |
2202 | ; Kernel calls this function when a certain process ends |
2198 | ; This function will check if the process had any open sockets |
2203 | ; This function will check if the process had any open sockets |
2199 | ; And update them accordingly |
2204 | ; And update them accordingly (clean up) |
2200 | ; |
2205 | ; |
2201 | ; IN: edx = pid |
2206 | ; IN: edx = pid |
2202 | ; OUT: / |
2207 | ; OUT: / |
2203 | ; |
2208 | ; |
2204 | ;------------------------------------------------------ |
2209 | ;------------------------------------------------------ |
Line 2240... | Line 2245... | ||
2240 | jne .free |
2245 | jne .free |
Line 2241... | Line 2246... | ||
2241 | 2246 | ||
2242 | cmp [eax + SOCKET.Protocol], IP_PROTO_TCP |
2247 | cmp [eax + SOCKET.Protocol], IP_PROTO_TCP |
Line 2243... | Line 2248... | ||
2243 | jne .free |
2248 | jne .free |
2244 | 2249 | ||
Line 2245... | Line 2250... | ||
2245 | call TCP_close |
2250 | call TCP_disconnect |
2246 | jmp .closed |
2251 | jmp .closed |
Line 2345... | Line 2350... | ||
2345 | DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_is_disconnected: %x\n", eax |
2350 | DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_is_disconnected: %x\n", eax |
Line 2346... | Line 2351... | ||
2346 | 2351 | ||
2347 | and [eax + SOCKET.state], not (SS_ISCONNECTING + SS_ISCONNECTED + SS_ISDISCONNECTING) |
2352 | and [eax + SOCKET.state], not (SS_ISCONNECTING + SS_ISCONNECTED + SS_ISDISCONNECTING) |
Line 2348... | Line -... | ||
2348 | or [eax + SOCKET.state], SS_CANTRCVMORE + SS_CANTSENDMORE |
- | |
2349 | - | ||
2350 | cmp [eax + SOCKET.Protocol], IP_PROTO_TCP |
- | |
2351 | je .tcp |
- | |
2352 | - | ||
Line 2353... | Line 2353... | ||
2353 | cmp [eax + SOCKET.Protocol], IP_PROTO_UDP |
2353 | or [eax + SOCKET.state], SS_CANTRCVMORE + SS_CANTSENDMORE |
Line 2354... | Line -... | ||
2354 | je .udp |
- | |
2355 | - | ||
2356 | jmp SOCKET_notify |
- | |
2357 | - | ||
2358 | .tcp: |
- | |
2359 | .udp: |
- | |
Line 2360... | Line 2354... | ||
2360 | mov [eax + UDP_SOCKET.LocalPort], 0 ; UDP and TCP structs store localport at the same offset |
2354 | |
2361 | mov [eax + UDP_SOCKET.RemotePort], 0 |
2355 | |
2362 | 2356 | jmp SOCKET_notify |