Update of /cvsroot/boost/boost/libs/asio/example/http/client
In directory 
sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17073/libs/asio/example/http/client

Modified Files:
        Jamfile async_client.cpp sync_client.cpp 
Log Message:
Change error handling to match TR2 proposal.


Index: Jamfile
===================================================================
RCS file: /cvsroot/boost/boost/libs/asio/example/http/client/Jamfile,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Jamfile     25 Jul 2006 11:04:00 -0000      1.3
+++ Jamfile     8 Nov 2006 05:32:13 -0000       1.4
@@ -21,7 +21,8 @@
 }
 
 exe async_client
-  : async_client.cpp
+  : <lib>@boost/libs/system/build/boost_system
+    async_client.cpp
   : <include>$(BOOST_ROOT)
     <include>../../../../..
     <define>BOOST_ALL_NO_LIB=1
@@ -32,7 +33,8 @@
   ;
 
 exe sync_client
-  : sync_client.cpp
+  : <lib>@boost/libs/system/build/boost_system
+    sync_client.cpp
   : <include>$(BOOST_ROOT)
     <include>../../../../..
     <define>BOOST_ALL_NO_LIB=1

Index: async_client.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/asio/example/http/client/async_client.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- async_client.cpp    25 Jul 2006 11:04:00 -0000      1.3
+++ async_client.cpp    8 Nov 2006 05:32:13 -0000       1.4
@@ -44,7 +44,7 @@
   }
 
 private:
-  void handle_resolve(const boost::asio::error& err,
+  void handle_resolve(const boost::system::error_code& err,
       tcp::resolver::iterator endpoint_iterator)
   {
     if (!err)
@@ -62,7 +62,7 @@
     }
   }
 
-  void handle_connect(const boost::asio::error& err,
+  void handle_connect(const boost::system::error_code& err,
       tcp::resolver::iterator endpoint_iterator)
   {
     if (!err)
@@ -87,7 +87,7 @@
     }
   }
 
-  void handle_write_request(const boost::asio::error& err)
+  void handle_write_request(const boost::system::error_code& err)
   {
     if (!err)
     {
@@ -102,7 +102,7 @@
     }
   }
 
-  void handle_read_status_line(const boost::asio::error& err)
+  void handle_read_status_line(const boost::system::error_code& err)
   {
     if (!err)
     {
@@ -137,7 +137,7 @@
     }
   }
 
-  void handle_read_headers(const boost::asio::error& err)
+  void handle_read_headers(const boost::system::error_code& err)
   {
     if (!err)
     {
@@ -164,7 +164,7 @@
     }
   }
 
-  void handle_read_content(const boost::asio::error& err)
+  void handle_read_content(const boost::system::error_code& err)
   {
     if (!err)
     {

Index: sync_client.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/asio/example/http/client/sync_client.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- sync_client.cpp     25 Jul 2006 11:04:00 -0000      1.3
+++ sync_client.cpp     8 Nov 2006 05:32:13 -0000       1.4
@@ -38,11 +38,11 @@
 
     // Try each endpoint until we successfully establish a connection.
     tcp::socket socket(io_service);
-    boost::asio::error error = boost::asio::error::host_not_found;
+    boost::system::error_code error = boost::asio::error::host_not_found;
     while (error && endpoint_iterator != end)
     {
       socket.close();
-      socket.connect(*endpoint_iterator++, boost::asio::assign_error(error));
+      socket.connect(*endpoint_iterator++, error);
     }
     if (error)
       throw error;
@@ -98,8 +98,7 @@
 
     // Read until EOF, writing data to output as we go.
     while (boost::asio::read(socket, response,
-          boost::asio::transfer_at_least(1),
-          boost::asio::assign_error(error)))
+          boost::asio::transfer_at_least(1), error))
       std::cout << &response;
     if (error != boost::asio::error::eof)
       throw error;


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to