1 (* Copyright 2001, 2002 b8_bavard, b8_fee_carabine, INRIA *)
3 This file is part of mldonkey.
5 mldonkey is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 mldonkey is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with mldonkey; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 - directory download...
25 - remove download list is not working
26 - normal mynick: Search unknown names by ip ?
27 - blink users if they have messages
28 - there is no method to clear message memory atm
32 "mr" | "raw" -> verbose_msg_raw := true
33 "mct" -> verbose_msg_clienttags := true
34 "ms" -> verbose_msg_servers := true
35 "verb" -> verbose := true
36 "sm" -> incr verbose_sources
37 "file" -> Unix32.verbose := true
38 "gui" -> GuiProto.verbose_gui_decoding := true
39 "no-login" -> verbose_no_login := true
40 "do" -> verbose_download := true
41 "up" -> verbose_upload := true
42 "unk" -> verbose_unknown_messages := true
43 "ov" -> verbose_overnet := true
44 "loc" -> verbose_location := true
45 "share" -> verbose_share := true
46 "md4" -> verbose_md4 := true
47 "connect" -> verbose_connect := true
48 "udp" -> verbose_udp := true
49 "ultra" | "super" -> verbose_supernode := true
50 "swarming" -> verbose_swarming := true
51 "hc" -> Http_client.verbose := true
52 "hs" -> Http_server.verbose := true
53 "act" -> verbose_activity := true
54 "bw" -> incr BasicSocket.verbose_bandwidth
55 "unexp" -> verbose_unexpected_messages := true
58 mc : debug client messages
59 mr|raw : debug raw messages
60 mct : debug emule clients tags
61 ms : debug server messages
62 sm : debug source management
65 no-login : disable login messages
66 file : debug file handling
67 do : some download warnings
68 up : some upload warnings
69 unk : unknown messages
71 loc : debug source research/master servers
74 connect : debug connections
76 ultra|super : debug supernode
77 swarming : debug swarming
78 hc : http_client messages
79 hs : http_server messages
82 unexp : debug unexpected messages
87 server_server
: server
CommonServer.server_impl
;
88 server_connection_control
: CommonTypes.connection_control
;
89 mutable server_connection_time
: float;
90 mutable server_name
: string;
91 mutable server_addr
: Ip.addr
;
92 mutable server_ip
: Ip.t
;
93 mutable server_port
: int;
94 mutable server_supports
: dc_hub_supports
option;
95 mutable server_hub_state
: dc_hub_state
;
96 mutable server_info
: string;
97 mutable server_sock
: tcp_connection
;
98 mutable server_autoconnect
: bool;
99 mutable server_last_nick
: string;
100 mutable server_search
: search
option;
101 mutable server_search_timeout
: int;
102 mutable server_users
: user list
;
103 mutable server_topic
: string;
104 mutable server_messages
: (int * string * room_message
) list
;
105 mutable server_read_messages
: int;
110 result_result : result CommonResult.result_impl;
111 result_name : string;
113 mutable result_sources : (user * string) list;
118 user_user
: user
CommonUser.user_impl
;
119 mutable user_nick
: string;
120 mutable user_ip
: Ip.addr
; (* $IpUser *)
121 mutable user_servers
: server list
;
122 mutable user_clients
: client list
;
123 mutable user_link
: string;
124 mutable user_uploaded
: int64
;
125 mutable user_downloaded
: int64
;
126 mutable user_myinfo
: dc_myinfo
;
127 mutable user_data
: float;
128 mutable user_type
: dc_usertype
;
129 mutable user_state
: dc_userstate
;
130 mutable user_messages
: (int * string * room_message
) list
;
131 mutable user_read_messages
: int;
135 file_file
: file
CommonFile.file_impl
;
136 mutable file_unchecked_tiger_root
: string;
137 mutable file_directory
: string;
138 mutable file_name
: string;
139 (*mutable file_tiger_array : TigerTree.t array;*)
140 mutable file_clients
: client list
;
141 mutable file_search
: (CommonTypes.search
* float) option; (* search , time *)
142 mutable file_autosearch_count
: int;
145 and dc_shared_file
= {
146 mutable dc_shared_fullname
: string;
147 mutable dc_shared_codedname
: string;
148 mutable dc_shared_searchname
: string;
149 mutable dc_shared_size
: int64
;
150 mutable dc_shared_tiger_list
: TigerTree.t list
;
151 mutable dc_shared_tiger_root
: string;
152 (*mutable dc_shared_tiger_array : TigerTree.t array;*)
153 mutable dc_shared_pos
: int64
;
154 mutable dc_shared_chunks
: int;
157 and client
= { (* remember DcGlobals.new_copy_client if add anything *)
158 client_client
: client
CommonClient.client_impl
;
159 mutable client_name
: string option;
160 mutable client_addr
: (Ip.t
* int) option;
161 mutable client_sock
: tcp_connection
;
162 mutable client_supports
: dc_client_supports
option;
163 mutable client_lock
: string;
164 mutable client_file
: file
option;
165 mutable client_state
: dc_clientstate
;
166 mutable client_error
: dc_client_error
; (* last error message *)
167 mutable client_error_count
: int; (* error message count *)
168 mutable client_preread_bytes_left
: int;
169 mutable client_pos
: int64
;
170 mutable client_endpos
: int64
;
171 mutable client_receiving
: int64
;
172 mutable client_user
: user
option;
173 mutable client_connection_control
: connection_control
;
174 client_connect_time
: int;
175 mutable client_downloaded
: int64
;
176 mutable client_uploaded
: int64
;
179 and dc_result
= { (* rst of the info (filename & size) are on Commonresults.result_info *)
185 and dc_direction
= Upload
of int | Download
of int
187 and dc_connection_style
= (* dc_direction is what client wants/needs to do *)
188 | ClientActive
of dc_direction
189 | MeActive
of dc_direction
191 (* Client to client procedure: S=Server M=Me C=Client
192 Me in Active mode - Client in Active/Passive mode: Me want to download
193 FROM______________________________________TO__USER_STATE________________CLIENT_STATE______________
194 UserIdle (No client yet)
195 UserActiveMeInitiating DcDownloadWaiting file
196 M ConnectToMe -> S . .
197 C MyNick -> M UserIdle DcConnectionStyle MeActive Upload 0
199 M MyNick|Lock|Supports|Direction|Key -> C . .
200 C Supports|Direction -> M . If direction conflict loss
201 DcConnectionStyle MeActive Download 65535
202 C | Key -> M . If direction conflict loss
203 Wait client commands for uploading
207 C Filelength/AdcSnd -> M .
208 M Send (if not ADC) -> C .
210 Me in Passive mode - Client in Active: Me want to download
211 FROM______________________________________TO__USER_STATE________________CLIENT_STATE______________
212 UserIdle (No client yet)
213 UserActiveUserInitiating DcDownloadWaiting file
214 M RevConnectToMe -> S . .
215 S ConnectToMe -> M . DcConnectionStyle ClientActive Upload 0
216 M MyNick|Lock -> C . .
217 C MyNick -> M UserIdle DcConnectionStyle ClientActive Upload 0
218 C |Lock|Supports|Direction -> M . If direction conflict loss
219 DcConnectionStyle ClientActive Download 65535
220 C |Key -> M . If direction conflict loss
221 Wait client commands for uploading
222 M Supports -> C . DcConnectionStyle ClientActive Upload level
223 M |Direction|Key -> C . DcDownload file
225 C Filelength/AdcSnd -> M .
226 M Send ((if not ADC) -> C .
228 Me in Active/Passive mode - Client in Active: Client wants to download
229 FROM______________________________________TO__USER_STATE________________CLIENT_STATE______________
230 UserIdle (No client yet)
231 S ConnectToMe -> M . DcConnectionStyle ClientActive Upload 0
232 M MyNick|Lock -> C . .
233 C MyNick -> M UserIdle DcConnectionStyle ClientActive Download 0
234 C |Lock|Supports|Direction -> M . .
236 M Supports -> C . DcConnectionStyle ClientActive Download level
237 M |Direction|Key -> C . .
238 C Get/AdcGet -> M . If filelist loading
242 M Filelength/AdcSnd -> C . .
243 C Send (if not ADC) -> M . DcUpload/DcUploadList
246 Me in Active mode - Client in Passive: Client wants to download
247 FROM______________________________________TO__USER_STATE________________CLIENT_STATE______________
248 UserIdle (No client yet)
249 S RevConnectToMe -> M UserPassiveUserInitiating (No client yet)
250 M ConnectToMe -> S . (No client yet)
251 C MyNick -> M . DcConnectionStyle MeActive Download 0
253 M MyNick|Lock|Supports -> C . DcConnectionStyle MeActive Download 0
254 M |Direction|Key -> C . .
255 C Supports|Direction|Key -> M . .
256 C Get/AdcGet -> M . If filelist loading
260 M Filelength/AdcSnd -> C . .
261 C Send (if not ADC) -> M . DcUpload/DcUploadList
266 | DcIdle
(* client is doing nothing *)
267 | DcDownloadWaiting
of file
(* client is waiting for downloading slot *)
268 | DcDownloadConnecting
of (file
* float) (* client has passed from waiting state to initializing state *)
269 | DcDownloadListWaiting
(* client is waiting a slot for list downloading *)
270 | DcDownloadListConnecting
of (int * bool * float)(* client has passed waiting state to initializing state, *)
271 (* int = $Direction level , bool = firewalled state , timeout *)
272 | DcConnectionStyle
of (dc_connection_style
) (* how the initialization is processed with clients *)
273 | DcDownload
of file
(* we are downloading a file from client, switched on $Get *)
274 | DcDownloadList
of Unix32.t
(* we are downloading a file list from client *)
275 | DcUploadStarting
of (dc_shared_file
* int64
* int64
) (* we are starting to upload file to client *)
276 | DcUpload
of (dc_shared_file
* Unix32.t
* int64
* int64
) (* we are uploading a file to client *)
277 | DcUploadListStarting
of string (* we are starting to upload file with file name *)
278 | DcUploadList
of Unix32.t
(* we are uploading file list to client *)
279 | DcUploadDoneWaitingForMore
(* upload is complete and we are waiting for more *)
281 and dc_userstate
= (* used for determining states with users/clients *)
283 | TryingToSendFirstContact
284 | UserActiveMeInitiating
(* We have sent ConnectToMe to active client *)
285 | UserActiveUserInitiating
(* We have sent RevConnect *)
286 | UserPassiveUserInitiating
of float (* User has sent RevConnect and we have answered, time of reveiving *)
288 and dc_client_error
=
294 | ConnectionResetByPeer
296 | UserDontReplyOnTime
298 (* Type for keeping and manipulation hublist *)
300 mutable dc_name
: string;
301 mutable dc_ip
: Ip.addr
;
302 mutable dc_port
: int;
303 mutable dc_info
: string;
304 mutable dc_nusers
: int;
312 (* Type for $Supports usage with hubs *)
313 and dc_hub_supports
= {
325 (* Type for $Supports usage with clients *)
326 and dc_client_supports
= {
337 gettestzblock
: bool;
342 | ClientSupports
of dc_client_supports
343 | HubSupports
of dc_hub_supports
358 mutable dest
: string;
359 mutable nick
: string;
360 mutable description
: string;
361 mutable client_brand
: string;
362 mutable version
: string;
364 mutable hubs
: int * int * int;
366 mutable open_upload_slot
: int;
367 mutable conn_speed
: string;
369 mutable email
: string;
370 mutable sharesize
: int64
;
371 mutable bwlimit
: int;
374 and dc_mylistnode
= (* type for mylist parsing *)
375 | MylistDirectory
of (string * dc_mylistnode list
ref)
376 | MylistFile
of (string * string) (* filename * size *)
379 (* | NameShared of string list (* shared filename - path from root *) *)
380 | NameSpecial
of string (* rootless filename - filelists, future extensions *)
381 | NameTTH
of string (* TTH/ *)
384 | AdcFile
of adc_name
385 (* | AdcTthl of string (* tth *) *)
386 | AdcList
of string * bool (* path * recursive *)
390 shared_dirname
: string;
391 mutable shared_files
: dc_shared_file list
;
392 mutable shared_dirs
: (string * dc_shared_tree
) list
;