--- tftp.c.orig	2007-08-13 18:05:18.000000000 +0800
+++ tftp.c	2007-08-13 18:11:47.000000000 +0800
@@ -738,10 +738,14 @@
 
         switch(event) {
         case TFTP_EVENT_DATA:
-          /* Don't pass to the client empty or retransmitted packets */
-          if (state->rbytes > 4 &&
+          /* Don't pass to the client retransmitted packets, we can accept empty file */
+          if (state->rbytes >= 4 &&
               ((state->block+1) == getrpacketblock(&state->rpacket))) {
-            code = Curl_client_write(conn, CLIENTWRITE_BODY,
+
+            if (state->rbytes == 4) /*take care of empty file*/
+              code = data->set.fwrite_func((char *)&state->rpacket.data[4], 1, 0, data->set.out);
+            else
+              code = Curl_client_write(conn, CLIENTWRITE_BODY,
                                      (char *)&state->rpacket.data[4],
                                      state->rbytes-4);
             if(code)
