[sword-svn] r3894 - trunk/src/mgr

scribe at crosswire.org scribe at crosswire.org
Wed Nov 22 12:17:51 EST 2023


Author: scribe
Date: 2023-11-22 12:17:51 -0500 (Wed, 22 Nov 2023)
New Revision: 3894

Modified:
   trunk/src/mgr/curlftpt.cpp
   trunk/src/mgr/curlhttpt.cpp
   trunk/src/mgr/ftplibftpt.cpp
Log:
standardize and fix error results from transport drivers


Modified: trunk/src/mgr/curlftpt.cpp
===================================================================
--- trunk/src/mgr/curlftpt.cpp	2023-11-06 16:58:07 UTC (rev 3893)
+++ trunk/src/mgr/curlftpt.cpp	2023-11-22 17:17:51 UTC (rev 3894)
@@ -202,9 +202,18 @@
 			else if (CURLE_REMOTE_ACCESS_DENIED == res) {
 				retVal = -3;
 			}
-			else {
+			else if (CURLE_REMOTE_FILE_NOT_FOUND == res) {
+				retVal = -4;
+			}
+			else if (CURLE_HTTP_RETURNED_ERROR == res) {
+				retVal = -5;
+			}
+			else if (this->term)  {
 				retVal = -1;
 			}
+			else {
+				retVal = -9;
+			}
 		}
 	}
 

Modified: trunk/src/mgr/curlhttpt.cpp
===================================================================
--- trunk/src/mgr/curlhttpt.cpp	2023-11-06 16:58:07 UTC (rev 3893)
+++ trunk/src/mgr/curlhttpt.cpp	2023-11-22 17:17:51 UTC (rev 3894)
@@ -190,12 +190,21 @@
                ) {
 				retVal = -2;
 			}
-			else if (CURLE_HTTP_RETURNED_ERROR == res) {
+			else if (CURLE_REMOTE_ACCESS_DENIED == res) {
 				retVal = -3;
 			}
-			else {
+			else if (CURLE_REMOTE_FILE_NOT_FOUND == res) {
+				retVal = -4;
+			}
+			else if (CURLE_HTTP_RETURNED_ERROR == res) {
+				retVal = -5;
+			}
+			else if (this->term)  {
 				retVal = -1;
 			}
+			else {
+				retVal = -9;
+			}
 		}
 	}
 

Modified: trunk/src/mgr/ftplibftpt.cpp
===================================================================
--- trunk/src/mgr/ftplibftpt.cpp	2023-11-06 16:58:07 UTC (rev 3893)
+++ trunk/src/mgr/ftplibftpt.cpp	2023-11-22 17:17:51 UTC (rev 3894)
@@ -184,7 +184,7 @@
 	}
 	if (fd > 0) FileMgr::closeFile(fd);
 SWLOGD("FTPLibFTPTransport - returning: %d\n", retVal);
-	return retVal;
+	return retVal == 1 ? (this->term ? -1 : -2) : retVal;
 }
 
 



More information about the sword-cvs mailing list