+ $params['dfrn_version'] = DFRN_PROTOCOL_VERSION ;
+ if($duplex == 1)
+ $params['duplex'] = 1;
+
+ logger('dfrn_confirm: Confirm: posting data to ' . $dfrn_confirm . ': ' . print_r($params,true), LOGGER_DATA);
+
+ /**
+ *
+ * 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;