aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorGisle Vanem <gvanem@yahoo.no>2016-02-06 17:04:37 -0500
committerJay Satiro <raysatiro@yahoo.com>2016-02-06 17:04:38 -0500
commitc71b6a2795791f73fd6ca62abebc74da7104d8e6 (patch)
tree664311aaf3b2227e33f47b60e1e55241d8889f6d /docs
parent6f702ebaa237487e1d1e7c1ad4b9a019c2ae474d (diff)
examples/asiohiper: Avoid function name collision on Windows
closesocket => close_socket Winsock already has the former. Bug: https://curl.haxx.se/mail/lib-2016-02/0016.html
Diffstat (limited to 'docs')
-rw-r--r--docs/examples/asiohiper.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/examples/asiohiper.cpp b/docs/examples/asiohiper.cpp
index c9bb99955..d6065e554 100644
--- a/docs/examples/asiohiper.cpp
+++ b/docs/examples/asiohiper.cpp
@@ -48,6 +48,7 @@
#include <curl/curl.h>
#include <boost/asio.hpp>
#include <boost/bind.hpp>
+#include <iostream>
#define MSG_OUT stdout /* Send info to stdout, change to stderr if you want */
@@ -378,9 +379,9 @@ static curl_socket_t opensocket(void *clientp, curlsocktype purpose,
}
/* CURLOPT_CLOSESOCKETFUNCTION */
-static int closesocket(void *clientp, curl_socket_t item)
+static int close_socket(void *clientp, curl_socket_t item)
{
- fprintf(MSG_OUT, "\nclosesocket : %d", item);
+ fprintf(MSG_OUT, "\nclose_socket : %d", item);
std::map<curl_socket_t, boost::asio::ip::tcp::socket *>::iterator it = socket_map.find(item);
@@ -427,7 +428,7 @@ static void new_conn(char *url, GlobalInfo *g)
curl_easy_setopt(conn->easy, CURLOPT_OPENSOCKETFUNCTION, opensocket);
/* call this function to close a socket */
- curl_easy_setopt(conn->easy, CURLOPT_CLOSESOCKETFUNCTION, closesocket);
+ curl_easy_setopt(conn->easy, CURLOPT_CLOSESOCKETFUNCTION, close_socket);
fprintf(MSG_OUT,
"\nAdding easy %p to multi %p (%s)", conn->easy, g->multi, url);
@@ -441,7 +442,6 @@ static void new_conn(char *url, GlobalInfo *g)
int main(int argc, char **argv)
{
GlobalInfo g;
- CURLMcode rc;
(void)argc;
(void)argv;