]> granicus.if.org Git - curl/commitdiff
Leave the TFTPD test server running after a file upload.
authorDan Fandrich <dan@coneharvesters.com>
Mon, 15 Jan 2007 21:03:53 +0000 (21:03 +0000)
committerDan Fandrich <dan@coneharvesters.com>
Mon, 15 Jan 2007 21:03:53 +0000 (21:03 +0000)
Flush the protocol log data so it's immediately available to the test harness.

tests/server/tftpd.c

index 7120c152b1d9f2d1c2924480d243471b7b613bdd..1b674a592fd2e92486fd16602a3bca6cd5e94ccf 100644 (file)
@@ -615,6 +615,7 @@ again:
 
   /* store input protocol */
   fprintf(test->server, "mode: %s\n", mode);
+  fflush(test->server);
 
   for (pf = formats; pf->f_mode; pf++)
     if (strcmp(pf->f_mode, mode) == 0)
@@ -799,10 +800,9 @@ static void sendtftp(struct testcase *test, struct formats *pf)
   } while (size == SEGSIZE);
 }
 
-static void justquit(int signum)
+static void justtimeout(int signum)
 {
   (void)signum;
-  exit(0);
 }
 
 
@@ -876,7 +876,7 @@ send_ack:
   ap->th_block = htons((u_short)(block));
   (void) swrite(peer, ackbuf, 4);
 #if defined(HAVE_ALARM) && defined(SIGALRM)
-  mysignal(SIGALRM, justquit);           /* just quit on timeout */
+  mysignal(SIGALRM, justtimeout);        /* just abort read on timeout */
   alarm(rexmtval);
 #endif
   n = sread(peer, buf, sizeof(buf));     /* normally times out and quits */