@@ -65,7 +65,8 @@ int main(int argc, const char **argv) {
6565 try {
6666 // Execute the request.
6767 easy.perform();
68- } catch (curl_easy_exception error) {
68+
69+ } catch (curl_easy_exception &error) {
6970 // If you want to get the entire error stack we can do:
7071 curlcpp_traceback errors = error.get_traceback();
7172 // Otherwise we could print the stack like this:
@@ -102,7 +103,8 @@ int main(int argc, const char **argv) {
102103 try {
103104 // Execute the request.
104105 easy.perform();
105- } catch (curl_easy_exception error) {
106+
107+ } catch (curl_easy_exception &error) {
106108 // If you want to get the entire error stack we can do:
107109 curlcpp_traceback errors = error.get_traceback();
108110 // Otherwise we could print the stack like this:
@@ -111,6 +113,7 @@ int main(int argc, const char **argv) {
111113
112114 // Retrieve information about curl current session.
113115 auto x = easy.get_info<CURLINFO_CONTENT_TYPE>();
116+
114117 // Print out content type
115118 std::cout << x.get() << std::endl;
116119 return 0;
@@ -155,7 +158,8 @@ int main(int argc, const char * argv[]) {
155158 easy.add<CURLOPT_HTTPPOST>(form.get());
156159 // Execute the request.
157160 easy.perform();
158- } catch (curl_easy_exception error) {
161+
162+ } catch (curl_easy_exception &error) {
159163 // If you want to get the entire error stack we can do:
160164 curlcpp_traceback errors = error.get_traceback();
161165 // Otherwise we could print the stack like this:
@@ -202,7 +206,8 @@ int main(int argc, const char * argv[]) {
202206 try {
203207 // Execute the request
204208 easy.perform();
205- } catch (curl_easy_exception error) {
209+
210+ } catch (curl_easy_exception &error) {
206211 // If you want to get the entire error stack we can do:
207212 curlcpp_traceback errors = error.get_traceback();
208213 // Otherwise we could print the stack like this:
@@ -247,7 +252,8 @@ int main() {
247252 try {
248253 // Execute the request.
249254 easy.perform();
250- } catch (curl_easy_exception error) {
255+
256+ } catch (curl_easy_exception &error) {
251257 // If you want to get the entire error stack we can do:
252258 curlcpp_traceback errors = error.get_traceback();
253259 // Otherwise we could print the stack like this:
@@ -295,7 +301,8 @@ int main(int argc, const char * argv[]) {
295301 easy.add<CURLOPT_CONNECT_ONLY>(true);
296302 // Execute the request.
297303 easy.perform();
298- } catch (curl_easy_exception error) {
304+
305+ } catch (curl_easy_exception &error) {
299306 // If you want to get the entire error stack we can do:
300307 curlcpp_traceback errors = error.get_traceback();
301308 // Otherwise we could print the stack like this:
@@ -307,6 +314,7 @@ int main(int argc, const char * argv[]) {
307314 sender.send(request);
308315 // Prints che sent bytes number.
309316 cout<<"Sent bytes: "<<sender.get_sent_bytes()<<endl;
317+
310318 for(;;) {
311319 // You should wait here to check if socket is ready to receive
312320 try {
@@ -316,7 +324,8 @@ int main(int argc, const char * argv[]) {
316324 receiver.receive(easy);
317325 // Prints the received bytes number.
318326 cout<<"Receiver bytes: "<<receiver.get_received_bytes()<<endl;
319- } catch (curl_easy_exception error) {
327+
328+ } catch (curl_easy_exception &error) {
320329 // If any errors occurs, exit from the loop
321330 break;
322331 }
0 commit comments