reference/curl/functions/curl-multi-strerror.xml
73fae4ee51b644b72028e610abefefced57c18ad
...
...
@@ -1,6 +1,5 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-

4
3
<refentry xml:id="function.curl-multi-strerror" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
4
<refnamediv>
6
5
<refname>curl_multi_strerror</refname>
...
...
@@ -10,8 +9,8 @@
10
9
<refsect1 role="description">
11
10
&reftitle.description;
12
11
<methodsynopsis>
13
-
<type>string</type><methodname>curl_multi_strerror</methodname>
14
-
<methodparam><type>int</type><parameter>errornum</parameter></methodparam>
12
+
<type class="union"><type>string</type><type>null</type></type><methodname>curl_multi_strerror</methodname>
13
+
<methodparam><type>int</type><parameter>error_code</parameter></methodparam>
15
14
</methodsynopsis>
16
15
<para>
17
16
Returns a text error message describing the given CURLM error code.
...
...
@@ -23,7 +22,7 @@
23
22
&reftitle.parameters;
24
23
<variablelist>
25
24
<varlistentry>
26
-
<term><parameter>errornum</parameter></term>
25
+
<term><parameter>error_code</parameter></term>
27
26
<listitem>
28
27
<para>
29
28
One of the <link xlink:href="&url.curl.error;">CURLM error codes</link> constants.
...
...
@@ -49,7 +48,7 @@
49
48
<![CDATA[
50
49
<?php
51
50
// Create cURL handles
52
-
$ch1 = curl_init("http://example.com"/);
51
+
$ch1 = curl_init("http://example.com/");
53
52
$ch2 = curl_init("http://php.net/");
54
53

55
54
// Create a cURL multi handle
...
...
@@ -62,12 +61,17 @@ curl_multi_add_handle($mh, $ch2);
62
61
// Execute the multi handle
63
62
do {
64
63
$status = curl_multi_exec($mh, $active);
65
-
// Check for errors
66
-
if($status > 0) {
67
-
// Display error message
68
-
echo "ERROR!\n " . curl_multi_strerror($status);
64
+
if ($active) {
65
+
curl_multi_select($mh);
69
66
}
70
-
} while ($status === CURLM_CALL_MULTI_PERFORM || $active);
67
+
} while ($active && $status === CURLM_OK);
68
+

69
+
// Check for errors
70
+
if ($status != CURLM_OK) {
71
+
// Display error message
72
+
echo "ERROR!\n " . curl_multi_strerror($status);
73
+
}
74
+

71
75
?>
72
76
]]>
73
77
</programlisting>
...
...
@@ -86,7 +90,6 @@ do {
86
90
</refsect1>
87
91

88
92
</refentry>
89
-

90
93
<!-- Keep this comment at the end of the file
91
94
Local variables:
92
95
mode: sgml
93
96