Rev 2552 | Rev 2569 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2552 | Rev 2560 | ||
---|---|---|---|
Line 54... | Line 54... | ||
54 | bool keep_on_going = 1; |
54 | bool keep_on_going = 1; |
55 | 55 | ||
56 | printf("Connection opened from %p\n", icall->in_phone_hash); |
56 | printf("Connection opened from %p\n", icall->in_phone_hash); |
57 | 57 | ||
58 | /* |
58 | /* |
- | 59 | * Initialize the table of open files. |
|
- | 60 | */ |
|
- | 61 | if (!vfs_conn_open_files_init()) { |
|
- | 62 | ipc_answer_fast(iid, ENOMEM, 0, 0); |
|
- | 63 | return; |
|
- | 64 | } |
|
- | 65 | ||
- | 66 | /* |
|
59 | * The connection was opened via the IPC_CONNECT_ME_TO call. |
67 | * The connection was opened via the IPC_CONNECT_ME_TO call. |
60 | * This call needs to be answered. |
68 | * This call needs to be answered. |
61 | */ |
69 | */ |
62 | ipc_answer_fast(iid, EOK, 0, 0); |
70 | ipc_answer_fast(iid, EOK, 0, 0); |
63 | 71 | ||
64 | /* |
72 | /* |
65 | * Here we enter the main connection fibril loop. |
73 | * Here we enter the main connection fibril loop. |
66 | * The logic behind this loop and the protocol is that we'd like to keep |
74 | * The logic behind this loop and the protocol is that we'd like to keep |
67 | * each connection open for a while before we close it. The benefit of |
75 | * each connection open until the client hangs up. When the client hangs |
68 | * this is that the client doesn't have to establish a new connection |
76 | * up, we will free its VFS state. The act of hanging up the connection |
69 | * upon each request. On the other hand, the client must be ready to |
77 | * by the client is equivalent to client termination because we cannot |
70 | * re-establish a connection if we hang it up due to reaching of maximum |
78 | * distinguish one from the other. On the other hand, the client can |
71 | * number of requests per connection or due to the client timing out. |
79 | * hang up arbitrarily if it has no open files and reestablish the |
- | 80 | * connection later. |
|
72 | */ |
81 | */ |
73 | - | ||
74 | while (keep_on_going) { |
82 | while (keep_on_going) { |
75 | ipc_callid_t callid; |
83 | ipc_callid_t callid; |
76 | ipc_call_t call; |
84 | ipc_call_t call; |
77 | 85 | ||
78 | callid = async_get_call(&call); |
86 | callid = async_get_call(&call); |
Line 83... | Line 91... | ||
83 | case IPC_M_PHONE_HUNGUP: |
91 | case IPC_M_PHONE_HUNGUP: |
84 | keep_on_going = false; |
92 | keep_on_going = false; |
85 | break; |
93 | break; |
86 | case VFS_REGISTER: |
94 | case VFS_REGISTER: |
87 | vfs_register(callid, &call); |
95 | vfs_register(callid, &call); |
88 | keep_on_going = false; |
- | |
89 | break; |
96 | break; |
90 | case VFS_MOUNT: |
97 | case VFS_MOUNT: |
91 | case VFS_UNMOUNT: |
98 | case VFS_UNMOUNT: |
92 | case VFS_OPEN: |
99 | case VFS_OPEN: |
93 | case VFS_CREATE: |
100 | case VFS_CREATE: |