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-1560773 ] Crash in curl_multi_perform on upload to 'file' errors

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Tue, 26 Sep 2006 03:45:22 -0700

Bugs item #1560773, was opened at 2006-09-18 16:25
Message generated for change (Settings changed) made by bagder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1560773&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: crash
>Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Daniel Stenberg (bagder)
Summary: Crash in curl_multi_perform on upload to 'file' errors

Initial Comment:
danil at mtsnet.ru

This happens with the next setup:
Platform: Win2000, mingw-2.95.2
libcurl: libcurl-7.15.4 and libcurl-7.15.6-20060911
+ssl builds downloaded from the official site

Libcurl crashes during 'multi' upload on Windows2000
if url points to the non-existing directory.

Simplified code abstract is below (it works when file
destination correct)

Regards,
  Danil

#include <stdio.h>
#include <curl/curl.h>

const char* theData = "this is a test\n";
int hasNotBeenSent = 1;

int fRead(void *dataPtr, unsigned items, unsigned
size, void* whatever);

int main()
{
        CURLSH *curlShare;
        CURLM* multiHandle;
        CURL* easyHandle;
        CURLcode curlCode;
        int isMultiRunning;

        curl_global_init(CURL_GLOBAL_ALL );

        easyHandle = curl_easy_init();
        curl_easy_setopt( easyHandle, CURLOPT_
READFUNCTION, fRead);
        curl_easy_setopt( easyHandle, CURLOPT_READDATA,
0);
        curl_easy_setopt( easyHandle, CURLOPT_
INFILESIZE, strlen(theData) );
        curl_easy_setopt( easyHandle, CURLOPT_URL, "file:
//e:\\NO_SUCH_DIR\file.txt");
        curl_easy_setopt( easyHandle, CURLOPT_UPLOAD, 1);

        multiHandle = curl_multi_init();
        curl_multi_add_handle( multiHandle, easyHandle );

        while(curlCode = curl_multi_perform(
multiHandle, &isMultiRunning ),
                                                curlCode == CURLM_
CALL_MULTI_PERFORM) ;;;

        printf("I can not get here\n");
        curl_multi_remove_handle(multiHandle,
easyHandle);
        curl_multi_cleanup(multiHandle);
        curl_easy_cleanup(easyHandle);
        curl_global_cleanup();

        return 0;
}

int fRead(void *dataPtr, unsigned items, unsigned
size, void* whatever)
{
        /* send the string one time */
        return hasNotBeenSent ?
                memcpy( dataPtr, theData, strlen(theData
)), hasNotBeenSent = 0, strlen (theData)
                : 0 ;
}

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

Comment By: Daniel Stenberg (bagder)
Date: 2006-09-26 12:45

Message:
Logged In: YES
user_id=1110

Great! Closing this now...

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

Comment By: Nobody/Anonymous (nobody)
Date: 2006-09-26 12:31

Message:
Logged In: NO

testing with the build of 25-10-2006 the issue has gone.
Thank you.

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

Comment By: Daniel Stenberg (bagder)
Date: 2006-09-23 21:15

Message:
Logged In: YES
user_id=1110

I need more/updated details or I will close this soon due to
lack of details and the fact it works for me...

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

Comment By: Daniel Stenberg (bagder)
Date: 2006-09-20 13:30

Message:
Logged In: YES
user_id=1110

This has the same code error as your FTP bug report.

I can't repeat this crash using CVS HEAD on a Linux host,
using your example snippet from above

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

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1560773&group_id=976
Received on 2006-09-26

These mail archives are generated by hypermail.

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

File upload with ASP.NET