X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fsalmon.php;h=8341b902a7a874b3db3e140d32478bda9b564962;hb=18bd7f5eb7153726d616297981e04816798b5463;hp=3d525f51ad36d0a2d55349937c140e404f8b56ea;hpb=273594af62c960b5a52da5ec1cf6d6bd450415ba;p=friendica.git diff --git a/include/salmon.php b/include/salmon.php index 3d525f51ad..8341b902a7 100644 --- a/include/salmon.php +++ b/include/salmon.php @@ -1,15 +1,14 @@ > -EOT; - - $slap = str_replace('',$namespaces,$slap); - + logger('slapper called for '.$url.'. Data: ' . $slap); + // create a magic envelope $data = base64url_encode($slap); @@ -125,7 +107,7 @@ EOT; '$signature' => $signature )); - // slap them + // slap them post_url($url,$salmon, array( 'Content-type: application/magic-envelope+xml', 'Content-length: ' . strlen($salmon) @@ -138,7 +120,7 @@ EOT; if($return_code > 299) { - logger('slapper: compliant salmon failed. Falling back to status.net hack2'); + logger('compliant salmon failed. Falling back to status.net hack2'); // Entirely likely that their salmon implementation is // non-compliant. Let's try once more, this time only signing @@ -152,7 +134,7 @@ EOT; '$signature' => $signature2 )); - // slap them + // slap them post_url($url,$salmon, array( 'Content-type: application/magic-envelope+xml', 'Content-length: ' . strlen($salmon) @@ -162,11 +144,11 @@ EOT; if($return_code > 299) { - logger('slapper: compliant salmon failed. Falling back to status.net hack3'); + logger('compliant salmon failed. Falling back to status.net hack3'); // Entirely likely that their salmon implementation is // non-compliant. Let's try once more, this time only signing - // the data, without the precomputed blob + // the data, without the precomputed blob $salmon = replace_macros($salmon_tpl,array( '$data' => $data, @@ -176,7 +158,7 @@ EOT; '$signature' => $signature3 )); - // slap them + // slap them post_url($url,$salmon, array( 'Content-type: application/magic-envelope+xml', 'Content-length: ' . strlen($salmon) @@ -184,7 +166,7 @@ EOT; $return_code = $a->get_curl_code(); } } - logger('slapper returned ' . $return_code); + logger('slapper for '.$url.' returned ' . $return_code); if(! $return_code) return(-1); if(($return_code == 503) && (stristr($a->get_curl_headers(),'retry-after')))