From: Simone Piccardi Date: Fri, 2 May 2003 10:09:50 +0000 (+0000) Subject: Aggiornamento alla versione reale X-Git-Url: https://gapil.gnulinux.it/gitweb/?a=commitdiff_plain;h=5e54ad63881cd5bd7c71395d073127e41f1b68d6;p=gapil.git Aggiornamento alla versione reale --- diff --git a/listati/ServEcho.c b/listati/ServEcho.c index 0ea0635..686c14a 100644 --- a/listati/ServEcho.c +++ b/listati/ServEcho.c @@ -4,16 +4,16 @@ void ServEcho(int sockfd) { char debug[MAXLINE+20]; /* main loop, reading 0 char means client close connection */ while ( (nread = read(sockfd, buffer, MAXLINE)) != 0) { + nwrite = FullWrite(sockfd, buffer, nread); if (debugging) { - snprintf(debug, MAXLINE+20, "Letti %d bytes, %s\n", nread, buffer); - debug[strlen(debug)] = 0; + buffer[nread] = 0; + snprintf(debug, MAXLINE+20, "Letti %d byte, %s", nread, buffer); if (demonize) { /* go daemon */ syslog(LOG_DEBUG, debug); } else { - fputs(debug, stdout); + printf("%s", debug); } } - nwrite = FullWrite(sockfd, buffer, nread); } return; } diff --git a/sources/TCP_echod.c b/sources/TCP_echod.c index 606f852..831159a 100644 --- a/sources/TCP_echod.c +++ b/sources/TCP_echod.c @@ -1,6 +1,6 @@ -/* ElemEchoTCPServer.c +/* TCP_echod.c * - * Copyright (C) 2001 Simone Piccardi + * Copyright (C) 2001-2003 Simone Piccardi * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,7 +26,7 @@ * * Usage: echod -h give all info * - * $Id: TCP_echod.c,v 1.1 2003/05/02 09:50:55 piccardi Exp $ + * $Id: TCP_echod.c,v 1.2 2003/05/02 10:09:50 piccardi Exp $ * ****************************************************************/ /*