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

Modified Files:
        Jamfile connection.cpp connection.hpp posix_main.cpp 
        server.cpp server.hpp win_main.cpp 
Log Message:
Change error handling to match TR2 proposal.


Index: Jamfile
===================================================================
RCS file: /cvsroot/boost/boost/libs/asio/example/http/server/Jamfile,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Jamfile     25 Jul 2006 11:04:00 -0000      1.2
+++ Jamfile     8 Nov 2006 05:32:13 -0000       1.3
@@ -22,6 +22,7 @@
 
 exe http_server
   : <lib>@boost/libs/thread/build/boost_thread
+    <lib>@boost/libs/system/build/boost_system
     connection.cpp
     connection_manager.cpp
     mime_types.cpp

Index: connection.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/asio/example/http/server/connection.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- connection.cpp      25 Jul 2006 11:04:00 -0000      1.2
+++ connection.cpp      8 Nov 2006 05:32:13 -0000       1.3
@@ -43,7 +43,7 @@
   socket_.close();
 }
 
-void connection::handle_read(const boost::asio::error& e,
+void connection::handle_read(const boost::system::error_code& e,
     std::size_t bytes_transferred)
 {
   if (!e)
@@ -80,7 +80,7 @@
   }
 }
 
-void connection::handle_write(const boost::asio::error& e)
+void connection::handle_write(const boost::system::error_code& e)
 {
   if (e != boost::asio::error::operation_aborted)
   {

Index: connection.hpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/asio/example/http/server/connection.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- connection.hpp      25 Jul 2006 11:04:00 -0000      1.2
+++ connection.hpp      8 Nov 2006 05:32:13 -0000       1.3
@@ -47,10 +47,11 @@
 
 private:
   /// Handle completion of a read operation.
-  void handle_read(const boost::asio::error& e, std::size_t bytes_transferred);
+  void handle_read(const boost::system::error_code& e,
+      std::size_t bytes_transferred);
 
   /// Handle completion of a write operation.
-  void handle_write(const boost::asio::error& e);
+  void handle_write(const boost::system::error_code& e);
 
   /// Socket for the connection.
   boost::asio::ip::tcp::socket socket_;

Index: posix_main.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/asio/example/http/server/posix_main.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- posix_main.cpp      25 Jul 2006 11:04:00 -0000      1.2
+++ posix_main.cpp      8 Nov 2006 05:32:13 -0000       1.3
@@ -62,10 +62,6 @@
     s.stop();
     t.join();
   }
-  catch (boost::asio::error& e)
-  {
-    std::cerr << "asio error: " << e << "\n";
-  }
   catch (std::exception& e)
   {
     std::cerr << "exception: " << e.what() << "\n";

Index: server.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/asio/example/http/server/server.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- server.cpp  25 Jul 2006 11:04:01 -0000      1.2
+++ server.cpp  8 Nov 2006 05:32:13 -0000       1.3
@@ -52,7 +52,7 @@
   io_service_.post(boost::bind(&server::handle_stop, this));
 }
 
-void server::handle_accept(const boost::asio::error& e)
+void server::handle_accept(const boost::system::error_code& e)
 {
   if (!e)
   {

Index: server.hpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/asio/example/http/server/server.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- server.hpp  25 Jul 2006 11:04:01 -0000      1.2
+++ server.hpp  8 Nov 2006 05:32:13 -0000       1.3
@@ -39,7 +39,7 @@
 
 private:
   /// Handle completion of an asynchronous accept operation.
-  void handle_accept(const boost::asio::error& e);
+  void handle_accept(const boost::system::error_code& e);
 
   /// Handle a request to stop the server.
   void handle_stop();

Index: win_main.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/asio/example/http/server/win_main.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- win_main.cpp        25 Jul 2006 11:04:01 -0000      1.2
+++ win_main.cpp        8 Nov 2006 05:32:13 -0000       1.3
@@ -59,10 +59,6 @@
     // Run the server until stopped.
     s.run();
   }
-  catch (boost::asio::error& e)
-  {
-    std::cerr << "asio error: " << e << "\n";
-  }
   catch (std::exception& e)
   {
     std::cerr << "exception: " << e.what() << "\n";


-------------------------------------------------------------------------
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