Exemplo n.º 1
0
Arquivo: curl.cpp Projeto: psfu/ULib
      "CURLE_FTP_SSL_FAILED",             /* 64 - Requested FTP SSL level failed */
      "CURLE_SEND_FAIL_REWIND",           /* 65 - Sending the data requires a rewind that failed */
      "CURLE_SSL_ENGINE_INITFAILED",      /* 66 - failed to initialise ENGINE */
      "CURLE_LOGIN_DENIED",               /* 67 - user, password or similar was not accepted and we failed to login */
      "CURLE_TFTP_NOTFOUND",              /* 68 - file not found on server */
      "CURLE_TFTP_PERM",                  /* 69 - permission problem on server */
      "CURLE_TFTP_DISKFULL",              /* 70 - out of disk space on server */
      "CURLE_TFTP_ILLEGAL",               /* 71 - Illegal TFTP operation */
      "CURLE_TFTP_UNKNOWNID",             /* 72 - Unknown transfer ID */
      "CURLE_TFTP_EXISTS",                /* 73 - File already exists */
      "CURLE_TFTP_NOSUCHUSER",            /* 74 - No such user */
   };

   static char buffer[CURL_ERROR_SIZE+32];

   (void) u__snprintf(buffer, sizeof(buffer), U_CONSTANT_TO_PARAM("%s (%d, %s)"), (result >= 0 && result < (int)U_NUM_ELEMENTS(errlist) ? errlist[result] : ""), result, errorBuffer);

   U_RETURN(buffer);
}

U_NO_EXPORT void UCURL::setup()
{
   U_TRACE_NO_PARAM(1, "UCURL::setup()")

   U_INTERNAL_ASSERT_EQUALS(inited, false)

   inited = true;

   CURLcode mresult = (CURLcode) U_SYSCALL(curl_global_init, "%d", CURL_GLOBAL_NOTHING); /* set up the program environment that libcurl needs */

   U_VAR_UNUSED(mresult)
Exemplo n.º 2
0
      "CURLE_FTP_SSL_FAILED",             /* 64 - Requested FTP SSL level failed */
      "CURLE_SEND_FAIL_REWIND",           /* 65 - Sending the data requires a rewind that failed */
      "CURLE_SSL_ENGINE_INITFAILED",      /* 66 - failed to initialise ENGINE */
      "CURLE_LOGIN_DENIED",               /* 67 - user, password or similar was not accepted and we failed to login */
      "CURLE_TFTP_NOTFOUND",              /* 68 - file not found on server */
      "CURLE_TFTP_PERM",                  /* 69 - permission problem on server */
      "CURLE_TFTP_DISKFULL",              /* 70 - out of disk space on server */
      "CURLE_TFTP_ILLEGAL",               /* 71 - Illegal TFTP operation */
      "CURLE_TFTP_UNKNOWNID",             /* 72 - Unknown transfer ID */
      "CURLE_TFTP_EXISTS",                /* 73 - File already exists */
      "CURLE_TFTP_NOSUCHUSER",            /* 74 - No such user */
   };

   static char buffer[CURL_ERROR_SIZE+32];

   (void) sprintf(buffer, "%s (%d, %s)", (result >= 0 && result < U_NUM_ELEMENTS(errlist) ? errlist[result] : ""), result, errorBuffer);

   U_RETURN(buffer);
}

U_NO_EXPORT void UCURL::setup()
{
   U_TRACE(1, "UCURL::setup()")

   U_INTERNAL_ASSERT_EQUALS(inited,false)

   inited = true;

   CURLcode mresult = (CURLcode) U_SYSCALL(curl_global_init, "%d", CURL_GLOBAL_NOTHING);

   U_VAR_UNUSED(mresult)