From caf173ab903d993aebdf137f3ca64f1ca73b74dc Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 7 Mar 2019 13:32:30 +0100 Subject: [locationinfo] Introduce timeouts for curl operations --- .../locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php') diff --git a/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php b/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php index 809634ad..7f84dd92 100644 --- a/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php +++ b/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php @@ -174,9 +174,8 @@ class CourseBackend_HisInOne extends CourseBackend private function postToServer($request, $action) { $header = array( - "Content-type: text/xml;charset=\"utf-8\"", - "SOAPAction: \"" . $action . "\"", - "Content-length: " . strlen($request), + 'Content-type: text/xml;charset="utf-8"', + 'SOAPAction: "' . $action . '"', ); if ($this->curlHandle === false) { @@ -191,6 +190,8 @@ class CourseBackend_HisInOne extends CourseBackend CURLOPT_URL => $this->location, CURLOPT_POSTFIELDS => $request, CURLOPT_HTTPHEADER => $header, + CURLOPT_TIMEOUT => 15, + CURLOPT_CONNECTTIMEOUT => 3, ); curl_setopt_array($this->curlHandle, $options); -- cgit v1.2.3-55-g7522