>From b700c67b0c8500d673a2e3fa08445a4bc60f7996 Mon Sep 17 00:00:00 2001
From: Salvatore Iovene <salvatore.iovene@linux.intel.com>
Date: Mon, 23 May 2011 12:04:06 +0300
Subject: [PATCH 1/3] NeonCXX: rename check to checkError.

Using a name that gives better context.
---
 src/backends/webdav/NeonCXX.cpp |   12 ++++++------
 src/backends/webdav/NeonCXX.h   |   16 ++++++++--------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/backends/webdav/NeonCXX.cpp b/src/backends/webdav/NeonCXX.cpp
index dcabf00..7097011 100644
--- a/src/backends/webdav/NeonCXX.cpp
+++ b/src/backends/webdav/NeonCXX.cpp
@@ -367,7 +367,7 @@ int Session::sslVerify(void *userdata, int failures, const ne_ssl_certificate *c
 unsigned int Session::options(const std::string &path)
 {
     unsigned int caps;
-    check(ne_options2(m_session, path.c_str(), &caps));
+    checkError(ne_options2(m_session, path.c_str(), &caps));
     return caps;
 }
 #endif // HAVE_LIBNEON_OPTIONS
@@ -405,7 +405,7 @@ void Session::propfindURI(const std::string &path, int depth,
     const char *tmp = ne_get_response_header(req, "Location");
     std::string location(tmp ? tmp : "");
 
-    if (!check(error, status->code, status, location)) {
+    if (!checkError(error, status->code, status, location)) {
         goto retry;
     }
 }
@@ -480,7 +480,7 @@ void Session::flush()
     }
 }
 
-bool Session::check(int error, int code, const ne_status *status, const string &location)
+bool Session::checkError(int error, int code, const ne_status *status, const string &location)
 {
     flush();
 
@@ -822,7 +822,7 @@ bool Request::run()
         error = ne_xml_dispatch_request(m_req, m_parser->get());
     }
 
-    return check(error);
+    return checkError(error);
 }
 
 int Request::addResultData(void *userdata, const char *buf, size_t len)
@@ -832,9 +832,9 @@ int Request::addResultData(void *userdata, const char *buf, size_t len)
     return 0;
 }
 
-bool Request::check(int error)
+bool Request::checkError(int error)
 {
-    return m_session.check(error, getStatus()->code, getStatus(), getResponseHeader("Location"));
+    return m_session.checkError(error, getStatus()->code, getStatus(), getResponseHeader("Location"));
 }
 
 }
diff --git a/src/backends/webdav/NeonCXX.h b/src/backends/webdav/NeonCXX.h
index f4b5407..67210ef 100644
--- a/src/backends/webdav/NeonCXX.h
+++ b/src/backends/webdav/NeonCXX.h
@@ -277,7 +277,7 @@ class Session {
      *
      * call sequence is this:
      * - startOperation()
-     * - repeat until success or final failure: create request, run(), check()
+     * - repeat until success or final failure: create request, run(), checkError()
      *
      * @param operation    internal descriptor for debugging (for example, PROPFIND)
      * @param deadline     time at which the operation must be completed, otherwise it'll be considered failed;
@@ -287,7 +287,7 @@ class Session {
 
     /**
      * to be called after each operation which might have produced debugging output by neon;
-     * automatically called by check()
+     * automatically called by checkError()
      */
     void flush();
 
@@ -303,7 +303,7 @@ class Session {
      * @return true for success, false if retry needed (only if deadline not empty);
      *         errors reported via exceptions
      */ 
-    bool check(int error, int code = 0, const ne_status *status = NULL,
+    bool checkError(int error, int code = 0, const ne_status *status = NULL,
                const string &location = "");
 
     ne_session *getSession() const { return m_session; }
@@ -321,9 +321,9 @@ class Session {
     ne_session *m_session;
     URI m_uri;
     std::string m_proxyURL;
-    /** time when last successul request completed, maintained by check() */
+    /** time when last successul request completed, maintained by checkError() */
     Timespec m_lastRequestEnd;
-    /** number of times a request was sent, maintained by startOperation(), the credentials callback, and check() */
+    /** number of times a request was sent, maintained by startOperation(), the credentials callback, and checkError() */
     int m_attempt;
 
     /** ne_set_server_auth() callback */
@@ -485,10 +485,10 @@ class Request
 
     /**
      * Execute the request. May only be called once per request. Uses
-     * Session::check() underneath to detect fatal errors and throw
+     * Session::checkError() underneath to detect fatal errors and throw
      * exceptions.
      *
-     * @return result of Session::check()
+     * @return result of Session::checkError()
      */
     bool run();
 
@@ -514,7 +514,7 @@ class Request
     static int addResultData(void *userdata, const char *buf, size_t len);
 
     /** throw error if error code *or* current status indicates failure */
-    bool check(int error);
+    bool checkError(int error);
 };
 
 /** thrown for 301 HTTP status */
-- 
1.7.2.2

