mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2009-10-16 08:19 pm

[dw-free] Add user-agent information to xposter and content importer, requested by LiveJournal.

[commit: http://hg.dwscoalition.org/dw-free/rev/0f75400b09e0]

Add user-agent information to xposter and content importer, requested by
LiveJournal.

Patch by [staff profile] mark.

Files modified:
  • cgi-bin/DW/External/XPostProtocol/LJXMLRPC.pm
  • cgi-bin/DW/Worker/ContentImporter/LiveJournal.pm
--------------------------------------------------------------------------------
diff -r 03ac3ce3a905 -r 0f75400b09e0 cgi-bin/DW/External/XPostProtocol/LJXMLRPC.pm
--- a/cgi-bin/DW/External/XPostProtocol/LJXMLRPC.pm	Fri Oct 16 15:33:54 2009 +0000
+++ b/cgi-bin/DW/External/XPostProtocol/LJXMLRPC.pm	Fri Oct 16 20:19:27 2009 +0000
@@ -109,7 +109,10 @@ sub call_xmlrpc {
 sub call_xmlrpc {
     my ($self, $proxyurl, $mode, $req, $auth) = @_;
     
-    my $xmlrpc = eval { XMLRPC::Lite->proxy($proxyurl); };
+    my $xmlrpc = eval {
+        XMLRPC::Lite->proxy( $proxyurl, agent => "$LJ::SITENAME XPoster ($LJ::ADMIN_EMAIL)" );
+    };
+
     # connection error if no proxy
     return {
         success => 0,
diff -r 03ac3ce3a905 -r 0f75400b09e0 cgi-bin/DW/Worker/ContentImporter/LiveJournal.pm
--- a/cgi-bin/DW/Worker/ContentImporter/LiveJournal.pm	Fri Oct 16 15:33:54 2009 +0000
+++ b/cgi-bin/DW/Worker/ContentImporter/LiveJournal.pm	Fri Oct 16 20:19:27 2009 +0000
@@ -369,7 +369,8 @@ sub call_xmlrpc {
     my ( $class, $opts, $mode, $hash, $depth ) = @_;
 
     my $xmlrpc = XMLRPC::Lite->new;
-    $xmlrpc->proxy( "http://" . ( $opts->{server} || $opts->{hostname} ) . "/interface/xmlrpc" );
+    $xmlrpc->proxy( "http://" . ( $opts->{server} || $opts->{hostname} ) . "/interface/xmlrpc",
+                    agent => "$LJ::SITENAME Content Importer ($LJ::ADMIN_EMAIL)" );
 
     my $chal;
     while ( ! $chal ) {
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org