curl-library
curl.exe return no result but file was uploaded correctly.
From: your ishiro <your_ishiro2_at_yahoo.com>
Date: Mon, 31 Aug 2009 01:05:12 -0700 (PDT)
Date: Mon, 31 Aug 2009 01:05:12 -0700 (PDT)
Hi experts.
I got encounterd a strange issue using curl.exe on Windows Server 2008.
Next command success to upload files but sometimes no result has returned on
standard output.
$ curl.exe -iT test.doc http://localhost/dav/test.doc
for example, I made next script named 'curlupload.py' by python. This script
can upload a lot of files to WevDav folder http://localhost:60000/dav/.
Please prepare 'files' folder and put 'test-core.doc' file(60KB) into folder before
execute next script.
-- import os, shutil, popen2 dir = 'files/' for i in range(1000): file = 'test-%05d.doc' % (i + 1) if not os.path.exists(dir + file): shutil.copyfile(dir + 'test-core.doc', dir + file) cmd = 'curl.exe -iT %s%s http://localhost:60000/dav/%s' % (dir, file, file) (stdout, stdin, stderr) = popen2.popen3(cmd) print '*** ' + file for line in stdout: print line -- I executed like this. $ python curlupload.py > result.txt Then we could see some result from server had disappear. The result of test-00686.doc has gone somewhere like this. -- : : (chomp) : : *** test-00685.doc HTTP/1.1 100 Continue HTTP/1.1 201 Created Date: Fri, 28 Aug 2009 10:12:49 GMT Server: Apache/2.2.11 (Win32) DAV/2 Location: http://localhost:60000/dav/test-00685.doc Content-Length: 197 Content-Type: text/html; charset=ISO-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>201 Created</title> </head><body> <h1>Created</h1> <p>Resource /dav/test-00685.doc has been created.</p> </body></html> *** test-00686.doc *** test-00687.doc HTTP/1.1 100 Continue HTTP/1.1 201 Created Date: Fri, 28 Aug 2009 10:12:50 GMT Server: Apache/2.2.11 (Win32) DAV/2 Location: http://localhost:60000/dav/test-00687.doc Content-Length: 197 Content-Type: text/html; charset=ISO-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>201 Created</title> </head><body> <h1>Created</h1> <p>Resource /dav/test-00687.doc has been created.</p> </body></html> : : (chomp) : : -- These are all I know so far. 1. This happens 1 or 2 times per 1000 files uploads. 2. This happends only with curl-7.19.5 or higher. curl-7.19.4 works always fine. 3. This happenes only Windows Server 2008. Windows Server 2003 works always fine. I haven't checked any other environments (Linux, Mac OSX...). 4. This is not the matter of WevDav server. because I tried some kind of servers, apache and NetApp. The result was always same. 5. I used binary of curl.exe from download site and I build binary from source code. The result was always same. I want to use latest version of curl. So please tell me some advice. Thank you for your kindness in advance. -- Best regards.Received on 2009-08-31