[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Mldonkey-commits] mldonkey config/Makefile.in distrib/ChangeLog s...
From: |
mldonkey-commits |
Subject: |
[Mldonkey-commits] mldonkey config/Makefile.in distrib/ChangeLog s... |
Date: |
Tue, 27 Jun 2006 21:17:30 +0000 |
CVSROOT: /sources/mldonkey
Module name: mldonkey
Changes by: spiralvoice <spiralvoice> 06/06/27 21:17:30
Modified files:
config : Makefile.in
distrib : ChangeLog
src/daemon/common: commonOptions.ml
src/daemon/driver: driverMain.ml
Removed files:
src/daemon/driver: driverLink.ml
tools : dp500.ml
Log message:
patch #5206
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/config/Makefile.in?cvsroot=mldonkey&r1=1.162&r2=1.163
http://cvs.savannah.gnu.org/viewcvs/mldonkey/distrib/ChangeLog?cvsroot=mldonkey&r1=1.905&r2=1.906
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonOptions.ml?cvsroot=mldonkey&r1=1.156&r2=1.157
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/driver/driverMain.ml?cvsroot=mldonkey&r1=1.114&r2=1.115
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/driver/driverLink.ml?cvsroot=mldonkey&r1=1.9&r2=0
http://cvs.savannah.gnu.org/viewcvs/mldonkey/tools/dp500.ml?cvsroot=mldonkey&r1=1.2&r2=0
Patches:
Index: config/Makefile.in
===================================================================
RCS file: /sources/mldonkey/mldonkey/config/Makefile.in,v
retrieving revision 1.162
retrieving revision 1.163
diff -u -b -r1.162 -r1.163
--- config/Makefile.in 27 Jun 2006 10:38:34 -0000 1.162
+++ config/Makefile.in 27 Jun 2006 21:17:29 -0000 1.163
@@ -543,7 +543,6 @@
$(DRIVER)/driverGraphics.ml \
$(DRIVER)/driverInteractive.ml \
$(DRIVER)/driverCommands.ml \
- $(DRIVER)/driverLink.ml \
$(DRIVER)/driverControlers.ml \
$(DRIVER)/driverInterface.ml \
$(DRIVER)/driverMain.ml
@@ -719,22 +718,6 @@
src/spider/analyser1/analyser1Main.ml \
src/daemon/common/commonMain.ml
-DP500_SRCS= \
- $(CDK_SRCS) $(LIB_SRCS) $(NET_SRCS) \
- $(MP3TAG_SRCS) \
- \
- $(COMMON)/commonTypes.ml \
- $(COMMON)/guiProto.ml \
- $(COMMON)/commonOptions.ml \
- $(COMMON)/commonMessages.ml \
- $(COMMON)/commonUserDb.ml \
- $(COMMON)/commonGlobals.ml \
- \
- src/daemon/driver/driverLink.ml \
- tools/dp500.ml \
- \
- src/daemon/common/commonMain.ml
-
BTVIEW_SRCS= \
$(CDK_SRCS) $(LIB_SRCS) $(NET_SRCS) \
$(MP3TAG_SRCS) \
@@ -1502,7 +1485,6 @@
EXPAND(ANALYSER1,analyser1,BIGARRAY)
EXPAND(BTVIEW,btview)
EXPAND(CLUSTER,cluster)
-EXPAND(DP500,dp500)
EXPAND(TESTRSS,testrss)
EXPAND(SVG_CONVERTER,svg_converter)
@@ -1611,8 +1593,8 @@
rm -f build/*.a build/*.cma build/*.cmxa
rm -f *_plugin
rm -f mldonkey mlgui mlnet.exe mlgui.exe mldonkeytop mldonkeytop.exe
- rm -f svg_converter svg_converter.byte mld_hash make_torrent
copysources get_range subconv dp500 testrss
- rm -f svg_converter.exe mld_hash.exe make_torrent.exe copysources.exe
get_range.exe subconv.exe dp500.exe testrss.exe
+ rm -f svg_converter svg_converter.byte mld_hash make_torrent
copysources get_range subconv testrss
+ rm -f svg_converter.exe mld_hash.exe make_torrent.exe copysources.exe
get_range.exe subconv.exe testrss.exe
(for i in $(SUBDIRS); do \
rm -f $$i/*.cm? $$i/*.o $$i/*.annot ; \
done)
@@ -1710,9 +1692,9 @@
$(LOCAL)/ocamlopt-$(REQUIRED_OCAML)/ocamlopt:
$(LOCAL)/ocamlopt-$(REQUIRED_OCAML)/Makefile
cd $(LOCAL)/ocamlopt-$(REQUIRED_OCAML); $(MAKE)
-utils: svg_converter mld_hash make_torrent copysources get_range subconv dp500
-utils.byte: mld_hash.byte make_torrent.byte copysources.byte get_range.byte
subconv.byte dp500.byte
-utils.static: svg_converter mld_hash.static make_torrent.static
copysources.static get_range.static subconv.static dp500.static
+utils: svg_converter mld_hash make_torrent copysources get_range subconv
+utils.byte: mld_hash.byte make_torrent.byte copysources.byte get_range.byte
subconv.byte
+utils.static: svg_converter mld_hash.static make_torrent.static
copysources.static get_range.static subconv.static
#######################################################################
Index: distrib/ChangeLog
===================================================================
RCS file: /sources/mldonkey/mldonkey/distrib/ChangeLog,v
retrieving revision 1.905
retrieving revision 1.906
diff -u -b -r1.905 -r1.906
--- distrib/ChangeLog 27 Jun 2006 20:25:50 -0000 1.905
+++ distrib/ChangeLog 27 Jun 2006 21:17:29 -0000 1.906
@@ -15,6 +15,7 @@
=========
2006/06/27
+5206: Remove Kiss DP500 support
5200: BT: Do not start downloads if no usable trackers are found in
file.torrent
MLDonkey only supports http:// style trackers, not udp:// or dht://
Deactivated http:// trackers are better marked in HTML,vd #num
Index: src/daemon/common/commonOptions.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonOptions.ml,v
retrieving revision 1.156
retrieving revision 1.157
diff -u -b -r1.156 -r1.157
--- src/daemon/common/commonOptions.ml 27 Jun 2006 10:38:35 -0000 1.156
+++ src/daemon/common/commonOptions.ml 27 Jun 2006 21:17:29 -0000 1.157
@@ -1341,22 +1341,6 @@
"The IP address used to bind the p2p clients"
Ip.option (Ip.of_inet_addr Unix.inet_addr_any)
-let dp500_pclink =
- define_expert_option current_section ["dp500_pclink"]
- "(experimental)" bool_option false
-
-let dp500_port =
- define_expert_option current_section ["dp500_port"]
- "(experimental)" int_option 8000
-
-let dp500_buffer =
- define_expert_option current_section ["dp500_buffer"]
- "(experimental)" int_option 2000000
-
-let dp500_directory =
- define_expert_option current_section ["dp500_directory"]
- "(experimental)" string_option "dp500"
-
let _ =
option_hook client_bind_addr (fun _ ->
TcpBufferedSocket.bind_address := Ip.to_inet_addr !!client_bind_addr
Index: src/daemon/driver/driverMain.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverMain.ml,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -b -r1.114 -r1.115
--- src/daemon/driver/driverMain.ml 27 Jun 2006 10:38:35 -0000 1.114
+++ src/daemon/driver/driverMain.ml 27 Jun 2006 21:17:30 -0000 1.115
@@ -34,18 +34,6 @@
open DriverInterface
-module Dp500 = DriverLink.DP500(struct
-
- module CommonTypes = CommonTypes
- module CommonFile = CommonFile
- module CommonOptions = CommonOptions
-
- let incoming_directory () =
- (CommonComplexOptions.incoming_files ()).shdir_dirname
- let files () = !!CommonComplexOptions.files
-
- end)
-
open Gettext (* open last as most modules redefine _s and _b *)
let _s x = _s "DriverMain" x
@@ -108,7 +96,6 @@
let start_interfaces () =
-
if !!http_port <> 0 then begin try
ignore (DriverControlers.create_http_handler ());
with e ->
@@ -119,8 +106,6 @@
ignore (find_port "telnet server" !!telnet_bind_addr
telnet_port DriverControlers.telnet_handler);
- Dp500.start ();
-
gui_server_sock := find_port "gui server" !!gui_bind_addr
gui_port gui_handler;
if !!gift_port <> 0 then
Index: src/daemon/driver/driverLink.ml
===================================================================
RCS file: src/daemon/driver/driverLink.ml
diff -N src/daemon/driver/driverLink.ml
--- src/daemon/driver/driverLink.ml 9 Jan 2006 00:25:58 -0000 1.9
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,552 +0,0 @@
-(* Copyright 2001, 2002 b8_bavard, b8_fee_carabine, INRIA *)
-(*
- This file is part of mldonkey.
-
- mldonkey is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- mldonkey is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with mldonkey; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*)
-
-open Printf2
-open CommonResult
-open CommonInteractive
-open CommonNetwork
-open CommonSearch
-(* open CommonTypes *)
-open CommonGlobals
-open GuiTypes
-(* open CommonComplexOptions *)
-(* open CommonFile *)
-open Options
-open BasicSocket
-open TcpBufferedSocket
-(* open DriverInteractive *)
-
-module DP500(M: sig
-
- module CommonTypes : sig
- type file
- end
-
- open CommonTypes
- module CommonFile : sig
-
- val file_best_name : file -> string
- val file_disk_name : file -> string
- val file_size : file -> int64
- val file_downloaded : file -> int64
- end
-
- module CommonOptions : sig
-
- val temp_directory : string Options.option_record
- val dp500_directory : string Options.option_record
- val allowed_ips : Ip.t list Options.option_record
- val dp500_buffer : int Options.option_record
- val dp500_pclink : bool Options.option_record
- val telnet_bind_addr : Ip.t Options.option_record
- val dp500_port : int Options.option_record
- end
-
- val incoming_directory : unit -> string
- val files : unit -> file list
-
- end) =
- struct
-
- open M
- open CommonFile
- open CommonOptions
-
-(* TODO: add all the functionnalities that the dp500 lacks:
- - shuffled directory (reply with random mp3 from directory)
- - shuffled tree (reply with random mp3 from tree)
- - search by subword (give a tree structure with the 26 letters per directory)
-*)
-
-(*************************************************************************)
-(* *)
-(* Global values *)
-(* *)
-(*************************************************************************)
-
-let verbose_dp500 = ref true
-let pclink_buf = ref ""
-let pclink_buf_len = ref 0
-
-let pclink_socks = ref []
-
-(* An horrible hack... The DP500 requires to have an extension of the
-file before playing it, so we add it after a @, but we then need
-to remove it when the file is received. *)
-
-let nregistered_files = ref 0
-let registered_files_of_diskname = Hashtbl.create 13
-let registered_files_of_num = Hashtbl.create 13
-
-let max_best_name_len = 100
-let max_disk_name_len = 80
-
-(*************************************************************************)
-(* *)
-(* pclink_reader *)
-(* *)
-(*************************************************************************)
-
-let pclink_reader telnet sock nread =
- let b = buf sock in
- if nread > 0 then
- let s =
- match !telnet with
- None ->
- if !verbose_dp500 then lprintf "dp500 forwarding...\n";
- let handler s nread =
- if nread > 0 then
- let b = buf s in
- if !verbose_dp500 then lprintf "Writing %d from pclink\n" b.len;
- AnyEndian.dump (String.sub b.buf b.pos b.len);
- write sock b.buf b.pos b.len;
- buf_used b b.len
- in
- let token = create_token unlimited_connection_manager in
- let s = connect token "pclink relay"
- (Ip.to_inet_addr Ip.localhost) 7000 (fun _ _ -> ())
- in
- set_reader s handler;
- set_closer s (fun _ r ->
- close sock r);
- telnet := Some s;
- s
-
- | Some s -> s
- in
- if !verbose_dp500 then lprintf "writing %d to pclink\n" b.len;
- AnyEndian.dump (String.sub b.buf b.pos b.len);
- write s b.buf b.pos b.len;
- buf_used b b.len
-
-(*************************************************************************)
-(* *)
-(* good_file *)
-(* *)
-(*************************************************************************)
-
-let good_file kind is_dir file =
- String.length file > 1 && file.[0] <> '.' &&
- (is_dir ||
- let ext = String.lowercase (Filename2.last_extension file) in
- if !verbose_dp500 then lprintf "Extension [%s]\n" ext;
- List.mem ext
- (match String.lowercase kind with
- "video" -> [ ".avi"; ".mpg"; ".mpeg"; ".ogm"; ".divx" ]
- | "audio" -> [ ".mp3"; ".ogg"; ".wma"; ".wav" ]
- | "picture" -> [ ".jpg"; ".jpeg"; ".jpe"; ".gif"; ".tiff"; ".png" ]
- | kind ->
- if !verbose_dp500 then lprintf "Unknown kind [%s]\n" kind;
- []))
-
-(*************************************************************************)
-(* *)
-(* need_correction *)
-(* *)
-(*************************************************************************)
-
-let need_correction best_name disk_name =
-
- (String.length best_name > max_best_name_len) ||
- (String.length disk_name > max_disk_name_len) ||
- ( let best_ext = Filename2.last_extension best_name in
- let disk_ext = Filename2.last_extension disk_name in
- String.lowercase best_ext <> String.lowercase disk_ext)
-
-(*************************************************************************)
-(* *)
-(* correct_length *)
-(* *)
-(*************************************************************************)
-
-let correct_length best_name =
- let len = String.length best_name in
- if len > max_best_name_len then
- (String.sub best_name 0 (max_best_name_len - 8)) ^ "..." ^
- (String.sub best_name (len-5) 5)
- else
- best_name
-
-
-(*************************************************************************)
-(* *)
-(* register_file *)
-(* *)
-(*************************************************************************)
-
-let register_file best_name disk_name =
-
- let disk_name =
- let len = String.length disk_name in
- if len > 2 && disk_name.[0] = '.' &&
- disk_name.[1] = '/' then
- String.sub disk_name 2 (len-2)
- else
- disk_name
- in
-
- if need_correction best_name disk_name then
- (best_name, disk_name)
- else
-
- let ext = Filename2.last_extension best_name in
-
- let n =
- try
- Hashtbl.find registered_files_of_diskname disk_name
- with _ ->
- let n = !nregistered_files in
- incr nregistered_files;
- Hashtbl.add registered_files_of_diskname disk_name n;
- Hashtbl.add registered_files_of_num n (best_name, disk_name);
- n
- in
- correct_length best_name, Printf.sprintf "address@hidden" n ext
-
-(*************************************************************************)
-(* *)
-(* correct_file *)
-(* *)
-(*************************************************************************)
-
-let correct_file file =
- let file =
- try
- let pos = String.index file '@' in
- let num = int_of_string (String.sub file 0 pos) in
- let ext = String.sub file (pos+1) (String.length file - pos - 1) in
-
- let (best_name, disk_name) = Hashtbl.find registered_files_of_num num in
- if Filename2.last_extension best_name = ext then
- disk_name else disk_name ^ ext
-
- (*
- let file = CommonFile.file_find num in
- if Filename2.last_extension (file_best_name file) = ext then
- file_disk_name file
- else
- file_disk_name file ^ ext
-*)
-
- with _ -> file in
- file
-
-(*************************************************************************)
-(* *)
-(* exec_command *)
-(* *)
-(*************************************************************************)
-
-let exec_command telnet line sock =
- try
- let (command, tail) = String2.cut_at line ' ' in
- if command = "LIST" then
- let (kind, tail) = String2.cut_at tail ' ' in
- match String2.split tail '|' with
- _ :: argument :: _ ->
-
- let list_directory base_directory argument =
-
- let files =
- try
- let directory = Filename.concat base_directory argument in
- Unix2.list_directory directory
- with e ->
- lprintf "Exception in LIST %s\n" (Printexc2.to_string e);
- []
- in
- base_directory, argument,
- List2.tail_map (fun file ->
- let abs_file = Filename.concat argument file in
- let full_file = Filename.concat base_directory abs_file in
- (file,file, full_file)) files
-
- in
-
- let mlnet_incoming_string = "MLNET INCOMING" in
- let mlnet_incoming_string_len = String.length mlnet_incoming_string
in
-
- let mlnet_temp_string = "MLNET TEMP" in
- let mlnet_temp_string_len = String.length mlnet_temp_string in
-
-
- let base_directory, argument, files = match kind with
- | "VIDEO" ->
-
- if argument = "" then begin
- if incoming_directory () <> "" then
- write_string sock (Printf.sprintf "%s|%s|1|\r\n"
- mlnet_incoming_string mlnet_incoming_string
- );
-
- if !!temp_directory <> "" then
- write_string sock (Printf.sprintf "%s|%s|1|\r\n"
- mlnet_temp_string mlnet_temp_string
- );
- end;
- if incoming_directory () <> "" &&
- String2.starts_with argument mlnet_incoming_string then
- list_directory (incoming_directory ())
- (String.sub argument mlnet_incoming_string_len
- (String.length argument - mlnet_incoming_string_len))
-
- else
- if !!temp_directory <> "" &&
- String2.starts_with argument mlnet_temp_string then
- !!temp_directory,
- (String.sub argument mlnet_temp_string_len
- (String.length argument - mlnet_temp_string_len)),
- let list = ref [] in
- List.iter (fun file ->
- let best_name = file_best_name file in
- let disk_name = file_disk_name file in
- lprintf "Adding %s\n" best_name;
- let file_size = Int64.to_float (file_size file) in
- let file_downloaded =
- Int64.to_float (file_downloaded file) in
-
- list := (
- Printf.sprintf "%2.1f%%/%4.1fM %s"
- (file_downloaded /. file_size *. 100. )
- (file_size /. 1048576.)
- best_name, Filename.basename disk_name, disk_name
-(* Printf.sprintf "address@hidden" (file_num file) ext *)) ::
- !list
- ) (files ());
- !list
- else
- list_directory
- (Filename.concat !!dp500_directory "video") argument
-
- | "AUDIO" ->
- list_directory
- (Filename.concat !!dp500_directory "audio") argument
-
- | "PICTURE" ->
- list_directory (Filename.concat !!dp500_directory "photos")
- argument
-
- | _ -> failwith "No such kind"
- in
-
- let files = List.sort (fun (s1,_,_) (s2,_,_) ->
- compare (String.lowercase s1) (String.lowercase s2)) files in
-
-
- List.iter (fun (best_name,file, full_file) ->
- lprintf "Check %s/%s\n" best_name full_file;
- let is_dir = Unix2.is_directory full_file in
- if good_file kind is_dir best_name then
- let line =
- if is_dir then
- Printf.sprintf "%s|%s|1|\r\n"
- best_name file
- else
- let (best_name, disk_name) = register_file best_name
full_file
- in
- Printf.sprintf "%s|%s|0|\r\n" best_name disk_name
- in
- if !verbose_dp500 then lprintf "Write [%s]\n" (String.escaped
line);
- write_string sock line;
- ) files;
- close_after_write sock
- | _ -> failwith "Unable to parse LIST command"
- else
- if command = "SIZE" then
- let file, tail = String2.cut_at tail '|' in
- let file = correct_file file in
- if !verbose_dp500 then lprintf "Size of [%s]\n" file;
- let fd = Unix32.create_ro file in
- let size = Unix32.getsize64 fd in
- write_string sock (Printf.sprintf "%015Ld" size)
- else
- if command = "GET" then
- let file, tail = String2.cut_at tail '|' in
- match String2.split tail ' ' with
- _ :: begin_read :: len_read :: _ ->
- if !verbose_dp500 then lprintf "Get of [%s] %s [%s]\n" file
begin_read len_read;
- let file = correct_file file in
-
- if !verbose_dp500 then lprintf "Get of [%s] %s [%s]\n" file
begin_read len_read;
-
- let fd = Unix32.create_ro file in
- let len_read = int_of_string len_read in
- if len_read = 1 then begin
- incr telnet;
- if !telnet > 10 then close sock (Closed_for_error "");
- raise Not_found
- end;
- let pclink_buf, len_read =
- if len_read = 0 then
- let size = Unix32.getsize64 fd in
- let size = Int64.to_int size in
- String.create size, size
- else
- if len_read > !pclink_buf_len then begin
- pclink_buf := String.create len_read;
- pclink_buf_len := len_read;
- !pclink_buf, len_read
- end else
- !pclink_buf, len_read
- in
- Unix32.read fd (Int64.of_string begin_read) pclink_buf 0 len_read;
- write sock pclink_buf 0 len_read;
- if !verbose_dp500 then lprintf "Written %d bytes\n" len_read;
- | _ -> failwith "Cannot parse pos + len"
- else
- raise Not_found
-
- with e ->
- close sock (Closed_for_error "");
- if !verbose_dp500 then lprintf "Exception %s for [%s]\n"
(Printexc2.to_string e) line
-
-
-(*************************************************************************)
-(* *)
-(* pclink_reader *)
-(* *)
-(*************************************************************************)
-
-let pclink_reader telnet sock nread =
- if !telnet < 10 then
- let b = buf sock in
- if !verbose_dp500 then lprintf "BUFFER: [%s]\n" (String.escaped
(String.sub b.buf b.pos b.len));
- let rec iter () =
- if b.len > 0 then
- if String2.starts_with b.buf "ACTION 2" then
- let rec iter_pipe i =
- if i < b.len then
- if b.buf.[b.pos + i] = '|' then
- let file = String.sub b.buf b.pos i in
- let file = correct_file file in
- buf_used b (i+1);
- if !verbose_dp500 then lprintf "Existing file [%s]\n"
(String.escaped file);
-
- write_string sock (
- if Sys.file_exists file then
- "200"
- else
- "404"
- );
- iter ()
- else
- iter_pipe (i+1)
- in
- buf_used b 9;
- iter_pipe 0
- else
- if String2.starts_with b.buf "ACTION 1" then
- let rec iter_pipe args i =
- if i < b.len then
- if b.buf.[b.pos + i] = '|' then
- let file = String.sub b.buf b.pos i in
- if !verbose_dp500 then lprintf "Argument [%s]\n"
(String.escaped file);
- buf_used b (i+1);
- let args = file :: args in
- if List.length args = 3 then begin
-
- let file = String.sub file 1 (String.length file - 1) in
- let file = correct_file file in
- if !verbose_dp500 then lprintf "Existing file [%s]\n"
(String.escaped file);
-
- write_string sock (
- if Sys.file_exists file then
- "200"
- else
- "404"
- );
-
-
- iter ()
- end else
- iter_pipe args 0
- else
- iter_pipe args (i+1)
- in
- buf_used b 9;
- iter_pipe [] 0
-
- else
- let rec iter_nl i =
- if i + 3 < b.len then
- if
- b.buf.[b.pos + i] = '\r' &&
- b.buf.[b.pos + i + 1] = '\n' &&
- b.buf.[b.pos + i + 2] = '\r' &&
- b.buf.[b.pos + i + 3] = '\n' then
- let line = String.sub b.buf b.pos i in
- buf_used b (i+4);
-
- if !verbose_dp500 then lprintf "Exec command [%s]\n"
(String.escaped line);
- exec_command telnet line sock;
- iter ()
- else
- iter_nl (i+1)
- in
- iter_nl 0
- in
- iter ()
-
-
-(*************************************************************************)
-(* *)
-(* pclink_closed *)
-(* *)
-(*************************************************************************)
-
-let pclink_closed sock reason = ()
-
-(*************************************************************************)
-(* *)
-(* pclink_handler *)
-(* *)
-(*************************************************************************)
-
-
-let pclink_handler t event =
- match event with
- TcpServerSocket.CONNECTION (s, Unix.ADDR_INET (from_ip, from_port)) ->
- if !verbose_dp500 then lprintf "dp500 CONNECTION !!\n";
- let from_ip = Ip.of_inet_addr from_ip in
- if Ip.matches from_ip !!allowed_ips then
- let token = create_token unlimited_connection_manager in
- if !verbose_dp500 then lprintf "dp500 connection allowed\n";
- let sock = TcpBufferedSocket.create_simple token
- "pclink connection"
- s in
- let telnet = ref 0 in
-
- TcpBufferedSocket.prevent_close sock;
- TcpBufferedSocket.set_max_input_buffer sock 10000;
- TcpBufferedSocket.set_max_output_buffer sock !!dp500_buffer;
- TcpBufferedSocket.set_reader sock (pclink_reader telnet);
- TcpBufferedSocket.set_closer sock pclink_closed;
- pclink_socks := sock :: !pclink_socks;
-
- else
- Unix.close s
-
- | _ -> ()
-
-let start () =
- if !!dp500_pclink then
- ignore (find_port "dp500 server" !!telnet_bind_addr
- dp500_port pclink_handler);
-
-end
Index: tools/dp500.ml
===================================================================
RCS file: tools/dp500.ml
diff -N tools/dp500.ml
--- tools/dp500.ml 2 Mar 2005 19:28:16 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,69 +0,0 @@
-(* Copyright 2001, 2002 b8_bavard, b8_fee_carabine, INRIA *)
-(*
- This file is part of mldonkey.
-
- mldonkey is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- mldonkey is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with mldonkey; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*)
-
-open CommonOptions
-open Options
-open Int64ops
-open Gettext
-open Md4
-open LittleEndian
-open Unix
-open Printf2
-
-let _s x = _s "Dp500" x
-let _b x = _b "Dp500" x
-
-module CommonTypes = struct type file end
-module CommonFile = struct
- let file_size _ = zero
- let file_disk_name _ = "no_file"
- let file_best_name _ = "no such file"
- let file_downloaded _ = zero
- end
-
-module DP500 = DriverLink.DP500(struct
-
-
- module CommonOptions = CommonOptions
- module CommonFile = CommonFile
- module CommonTypes = CommonTypes
-
- let incoming_directory () = ""
- let files () = []
-
- end)
-
-let _ =
-
- let exists_downloads_ini = Sys.file_exists
- (options_file_name downloads_ini) in
- if not exists_downloads_ini then begin
- lprintf "No config file found. Generating one.\n";
- let oc = open_out (options_file_name downloads_ini) in
- close_out oc;
- end;
- (try
- Options.load downloads_ini;
-(* Options.load downloads_expert_ini; *)
- with e ->
- lprintf "Exception %s during options load\n" (Printexc2.to_string e);
- exit 2;
- ());
- DP500.start ()
-
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Mldonkey-commits] mldonkey config/Makefile.in distrib/ChangeLog s...,
mldonkey-commits <=