if(S_ISREG(fileinfo.st_mode))
uploadfilesize = fileinfo.st_size;
+#ifdef DEBUGBUILD
+ /* allow dedicated test cases to override */
+ {
+ char *ev = getenv("CURL_UPLOAD_SIZE");
+ if(ev) {
+ int sz = atoi(ev);
+ uploadfilesize = (curl_off_t)sz;
+ }
+ }
+#endif
+
if(uploadfilesize != -1) {
struct OperationConfig *config = per->config; /* for the macro below */
#ifdef CURL_DISABLE_LIBCURL_OPTION
test426 \
test430 test431 test432 test433 test434 test435 test436 \
\
-test440 test441 test442 test443 test444 test445 test446 \
+test440 test441 test442 test443 test444 test445 test446 test447 \
\
test490 test491 test492 test493 test494 test495 test496 \
\
--- /dev/null
+<testcase>
+<info>
+<keywords>
+HTTP
+HTTP PUT
+growing file
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data crlf="yes">
+HTTP/1.1 200 OK
+Date: Tue, 09 Nov 2010 14:49:00 GMT
+Server: test-server/fake
+Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT
+ETag: "21025-dc7-39462498"
+Accept-Ranges: bytes
+Content-Length: 6
+Connection: close
+Content-Type: text/html
+Funny-head: yesyes
+
+-foo-
+</data>
+</reply>
+
+#
+# Client-side
+<client>
+<features>
+debug
+</features>
+<server>
+http
+</server>
+<name>
+HTTP PUT with growing file
+</name>
+<setenv>
+CURL_UPLOAD_SIZE=498
+</setenv>
+<command>
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER -T log/%TESTNUMBER
+</command>
+<file name="log/%TESTNUMBER">
+%repeat[100 x hello]%
+</file>
+</client>
+
+#
+# Verify data after the test has been "shot"
+<verify>
+<protocol crlf="yes" nonewline="yes">
+PUT /%TESTNUMBER HTTP/1.1
+Host: %HOSTIP:%HTTPPORT
+User-Agent: curl/%VERSION
+Accept: */*
+Content-Length: 498
+
+%repeat[99 x hello]%hel
+</protocol>
+</verify>
+</testcase>