]> granicus.if.org Git - curl/commitdiff
curl -T: ignore file size of special files
authorKamil Dudka <kdudka@redhat.com>
Thu, 12 Aug 2010 19:45:31 +0000 (21:45 +0200)
committerKamil Dudka <kdudka@redhat.com>
Sun, 15 Aug 2010 09:26:13 +0000 (11:26 +0200)
original bug report at https://bugzilla.redhat.com/622520

RELEASE-NOTES
src/main.c

index d33314b00d188ee3f1143a1fb7ea60787df0a8c9..080e572e9473e2a7d2470c8fe628ecaaf4be0e00 100644 (file)
@@ -9,7 +9,7 @@ Curl and libcurl 7.21.2
 
 This release includes the following changes:
 
- o 
+ o curl -T: ignore file size of special files
 
 This release includes the following bugfixes:
 
index 5585c1755bf8b44c51b32975df11f456000b258a..3b78d602f6d4c9c245b2aea2864a53c0da6caad2 100644 (file)
@@ -4925,7 +4925,10 @@ operate(struct Configurable *config, int argc, argv_item_t argv[])
             goto quit_urls;
           }
           infdopen=TRUE;
-          uploadfilesize=fileinfo.st_size;
+
+          /* we ignore file size for char/block devices, sockets, etc. */
+          if(S_IFREG == (fileinfo.st_mode & S_IFMT))
+            uploadfilesize=fileinfo.st_size;
 
         }
         else if(uploadfile && stdin_upload(uploadfile)) {