cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-2816745 ] 100% CPU Usage and Error 55

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Sun, 05 Jul 2009 12:22:42 +0000

Bugs item #2816745, was opened at 2009-07-05 03:26
Message generated for change (Comment added) made by bagder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2816745&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: libcurl
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: guideX (guidex)
Assigned to: Daniel Stenberg (bagder)
Summary: 100% CPU Usage and Error 55

Initial Comment:
Versions:
- libssh2-1.1
- zlib 1.2.3
- curl 7.19.5
- openssl 0.9.8k
- MS Visual C++ 2008 SP1
- Compiled on Windows Server 2008
- Program with Curl In use on Windows Server 2003 RC4
- .NET Framework 3.5

I used the Using-libcurl-with-SSH-support-in-Visual-Studio-2008.pdf tutorial which is on the Curl homepage co compile curl, and I used the code in C++ located at the bottom of this message. The files are large in size, something like 2 GB to 55 GB, sometimes it takes over a day to transfer these files, when it does, I go to the console app and it says 'File Upload Failed! Error 55'. On the error list page, that error means 'Failed sending network data.', and when I look at the processes, I see 100% CPU usage, and the whole server is sluggish. I have to end task on the console app which has libcurl, and restart it, and the resulting file is incomplete. Please help or let me know what to do.

Here's the code it fails on ...

void SSHUpload(char * strSource, char * strDestination) {
        CURL * hCurl;
        CURLcode ccCurlResult = CURL_LAST;
        curl_off_t cotFileSize;
        HANDLE hFile;
        LARGE_INTEGER liFileSize;
        hFile = CreateFileA(strSource, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
        if(hFile != INVALID_HANDLE_VALUE)
        {
                ccCurlResult = curl_global_init(CURL_GLOBAL_WIN32);
                if(ccCurlResult == 0)
                {
                        hCurl = curl_easy_init();
                        if(hCurl) {
                                curl_easy_setopt(hCurl, CURLOPT_VERBOSE, TRUE);
                                curl_easy_setopt(hCurl, CURLOPT_UPLOAD, TRUE);
                                GetFileSizeEx(hFile, &liFileSize);
                                cotFileSize = liFileSize.QuadPart;
                                curl_easy_setopt(hCurl, CURLOPT_INFILESIZE_LARGE, cotFileSize);
                                curl_easy_setopt(hCurl, CURLOPT_NOPROGRESS, FALSE);
                                curl_easy_setopt(hCurl, CURLOPT_PROGRESSFUNCTION, upload_transfer_progress);
                                curl_easy_setopt(hCurl, CURLOPT_READFUNCTION, read_data);
                                curl_easy_setopt(hCurl, CURLOPT_READDATA, hFile);
                                curl_easy_setopt(hCurl, CURLOPT_URL, strDestination);
                                curl_easy_setopt(hCurl, CURLOPT_PORT, 22);
                                curl_easy_setopt(hCurl, CURLOPT_USERPWD, "root:password");
                                curl_easy_setopt(hCurl, CURLOPT_SSH_AUTH_TYPES, CURLSSH_AUTH_PASSWORD);
                                printf("Uploading\n");
                                ccCurlResult = curl_easy_perform(hCurl);
                                curl_easy_cleanup(hCurl);
                        }
                }
                CloseHandle(hFile);
                curl_global_cleanup();
                if (ccCurlResult == CURLE_OK)
                        printf("File Uploaded.");
                else
                        printf("File Upload Failed! %d\n", ccCurlResult);
        }
        else
                printf("File Upload Failed! Could not open local file!");
}

----------------------------------------------------------------------

>Comment By: Daniel Stenberg (bagder)
Date: 2009-07-05 14:22

Message:
The code that diplsays the error message is clearly in your app. How come
you then blame libcurl for the 100% CPU?

I would also encourage you to check the code and see if that resume stuff
actually works. Have you tried to enforce that and tried the functionality
with just a few small files?

In general it will help us if you can research more on the EXACT
circumstances when the bug happens. Alternatively, please provide an
example we can use to repeat the problem.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2816745&group_id=976
Received on 2009-07-05

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET