Tadashi Okoshi
slash****@users*****
2006年 1月 29日 (日) 03:24:33 JST
Index: affelio/lib/Affelio/App/Admin/MakeAffelioLink.pm
diff -u affelio/lib/Affelio/App/Admin/MakeAffelioLink.pm:1.4 affelio/lib/Affelio/App/Admin/MakeAffelioLink.pm:1.5
--- affelio/lib/Affelio/App/Admin/MakeAffelioLink.pm:1.4 Thu Jan 19 18:26:57 2006
+++ affelio/lib/Affelio/App/Admin/MakeAffelioLink.pm Sun Jan 29 03:24:33 2006
@@ -14,7 +14,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-# $Id: MakeAffelioLink.pm,v 1.4 2006/01/19 09:26:57 slash5234 Exp $
+# $Id: MakeAffelioLink.pm,v 1.5 2006/01/28 18:24:33 slash5234 Exp $
package Affelio::App::Admin::MakeAffelioLink;
{
@@ -37,7 +37,7 @@
use Exporter;
@Affelio::App::Admin::MakeAffelioLink::ISA = "Exporter";
- @Affelio::App::Admin::MakeAffelioLink::EXPORT = qw (show send_request handler);
+ @Affelio::App::Admin::MakeAffelioLink::EXPORT = qw (show send_request handler _send_request);
#######################################################################
#handler
@@ -139,5 +139,59 @@
debug_print("MakeAffelioLink::show end.");
}
+
+
+ #######################################################################
+ #_send_request
+ #######################################################################
+ sub _send_request{
+ my $af = shift;
+ my $dest_uri = shift;
+
+ debug_print("MakeAffelioLink::send: start.");
+
+ my $wi = new Affelio::misc::WebInput;
+
+ $dest_uri =~ s/\/$//;
+
+ my $cur_time = get_timestamp();
+ debug_print("MakeAffelioLink::send: $dest_uri");
+
+ ###########################################
+ # Send HandShake to the URL
+ ###########################################
+ my $my_DH_pri_key_str="";
+ try{
+ $my_DH_pri_key_str
+ = send_HandShake(dest_uri => $dest_uri,
+ my_nickname => $af->{user__nickname},
+ my_AFID => $af->{site__web_root},
+ mesg => "",
+ timestamp => $cur_time);
+ }catch Affelio::exception::NetworkException with{
+ my $E = shift;
+ throw Affelio::exception::CommunicationException($E);
+ }catch Affelio::exception::Exception with{
+ my $E = shift;
+ throw Affelio::exception::CommunicationException($E);
+ };
+ debug_print("MakeAffelioLink::send: send_HandShake returned success.");
+
+ ###########################################
+ # Save peer's info into pending_DB
+ ###########################################
+ my $tmpdb= new Affelio::SNS::Handshaker_tmpDB($af);
+ $tmpdb->add_sent_Handshake($cur_time,
+ $dest_uri,
+ "",
+ $cur_time,
+ $my_DH_pri_key_str);
+ debug_print("MakeAffelioLink::send: wroteDB $dest_uri=>[$cur_time]\n");
+
+ debug_print("MakeAffelioLink::send: end.");
+ return;
+ }
+
+
}
1;