+ /**
+ *
+ * POST all this stuff to the other site.
+ * Temporarily raise the network timeout to 120 seconds because the default 60
+ * doesn't always give the other side quite enough time to decrypt everything.
+ *
+ */
+
+ $a->config['system']['curl_timeout'] = 120;
+
+ $res = post_url($dfrn_confirm,$params);
+
+ logger('dfrn_confirm: Confirm: received data: ' . $res, LOGGER_DATA);
+
+ // Now figure out what they responded. Try to be robust if the remote site is
+ // having difficulty and throwing up errors of some kind.
+
+ $leading_junk = substr($res,0,strpos($res,'<?xml'));
+
+ $res = substr($res,strpos($res,'<?xml'));
+ if(! strlen($res)) {
+
+ // No XML at all, this exchange is messed up really bad.
+ // We shouldn't proceed, because the xml parser might choke,
+ // and $status is going to be zero, which indicates success.
+ // We can hardly call this a success.
+
+ notice( t('Response from remote site was not understood.') . EOL);
+ return;
+ }
+
+ if(strlen($leading_junk) && get_config('system','debugging')) {
+
+ // This might be more common. Mixed error text and some XML.
+ // If we're configured for debugging, show the text. Proceed in either case.
+
+ notice( t('Unexpected response from remote site: ') . EOL . $leading_junk . EOL );