diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2001-09-14 14:35:40 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2001-09-14 14:35:40 +0200 |
commit | e425cb943457ace770538aaf3be421a40a26f99a (patch) | |
tree | d625452a69931286f8921bfe44586ede1684ab02 | |
parent | 1e72e33a9739544b64c1d52980ef5f8e43e7f8c1 (diff) | |
download | vdr-e425cb943457ace770538aaf3be421a40a26f99a.tar.gz vdr-e425cb943457ace770538aaf3be421a40a26f99a.tar.bz2 |
Changed size of all parse buffers to 10KB
-rw-r--r-- | HISTORY | 3 | ||||
-rw-r--r-- | config.c | 6 | ||||
-rw-r--r-- | config.h | 6 | ||||
-rw-r--r-- | dvbapi.c | 5 | ||||
-rw-r--r-- | svdrp.c | 6 | ||||
-rw-r--r-- | svdrp.h | 6 | ||||
-rw-r--r-- | tools.c | 6 | ||||
-rw-r--r-- | tools.h | 7 |
8 files changed, 22 insertions, 23 deletions
@@ -739,3 +739,6 @@ Video Disk Recorder Revision History (thanks to Stefan Huelswitt). - Implemented replay mode display (thanks to Stefan Huelswitt, with a few rewrites by kls). +- Changed the size of all input buffers used to parse config files or receive + SVDRP commands to the same value of 10KB. This allows long strings to be + used in the 'summary' field of a timer, for instance. @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.c 1.69 2001/09/09 13:52:48 kls Exp $ + * $Id: config.c 1.70 2001/09/14 14:35:30 kls Exp $ */ #include "config.h" @@ -72,7 +72,7 @@ bool cKeys::Load(const char *FileName) FILE *f = fopen(fileName, "r"); if (f) { int line = 0; - char buffer[MaxBuffer]; + char buffer[MAXPARSEBUFFER]; result = true; while (fgets(buffer, sizeof(buffer), f) > 0) { line++; @@ -869,7 +869,7 @@ bool cSetup::Load(const char *FileName) FILE *f = fopen(fileName, "r"); if (f) { int line = 0; - char buffer[MaxBuffer]; + char buffer[MAXPARSEBUFFER]; bool result = true; while (fgets(buffer, sizeof(buffer), f) > 0) { line++; @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.h 1.76 2001/09/09 13:51:45 kls Exp $ + * $Id: config.h 1.77 2001/09/14 14:35:32 kls Exp $ */ #ifndef __CONFIG_H @@ -21,8 +21,6 @@ #define VDRVERSION "0.95" -#define MaxBuffer 10000 - #define MAXPRIORITY 99 #define MAXLIFETIME 99 @@ -192,7 +190,7 @@ public: FILE *f = fopen(fileName, "r"); if (f) { int line = 0; - char buffer[MaxBuffer]; + char buffer[MAXPARSEBUFFER]; result = true; while (fgets(buffer, sizeof(buffer), f) > 0) { line++; @@ -7,7 +7,7 @@ * DVD support initially written by Andreas Schultz <aschultz@warp10.net> * based on dvdplayer-0.5 by Matjaz Thaler <matjaz.thaler@guest.arnes.si> * - * $Id: dvbapi.c 1.116 2001/09/14 14:19:37 kls Exp $ + * $Id: dvbapi.c 1.117 2001/09/14 14:25:33 kls Exp $ */ //#define DVDDEBUG 1 @@ -50,9 +50,6 @@ extern "C" { #define DEV_OST_VIDEO "/dev/ost/video" #define DEV_OST_AUDIO "/dev/ost/audio" -#define KILOBYTE(n) ((n) * 1024) -#define MEGABYTE(n) ((n) * 1024 * 1024) - // The size of the array used to buffer video data: // (must be larger than MINVIDEODATA - see remux.h) #define VIDEOBUFSIZE MEGABYTE(1) @@ -10,7 +10,7 @@ * and interact with the Video Disk Recorder - or write a full featured * graphical interface that sits on top of an SVDRP connection. * - * $Id: svdrp.c 1.22 2001/09/01 09:50:03 kls Exp $ + * $Id: svdrp.c 1.23 2001/09/14 14:31:22 kls Exp $ */ #define _GNU_SOURCE @@ -262,7 +262,7 @@ void cSVDRP::Close(bool Timeout) { if (file.IsOpen()) { //TODO how can we get the *full* hostname? - char buffer[MAXCMDBUFFER]; + char buffer[BUFSIZ]; gethostname(buffer, sizeof(buffer)); Reply(221, "%s closing connection%s", buffer, Timeout ? " (timeout)" : ""); isyslog(LOG_INFO, "closing SVDRP connection"); //TODO store IP#??? @@ -944,7 +944,7 @@ void cSVDRP::Process(void) if (file.IsOpen() || file.Open(socket.Accept())) { if (SendGreeting) { //TODO how can we get the *full* hostname? - char buffer[MAXCMDBUFFER]; + char buffer[BUFSIZ]; gethostname(buffer, sizeof(buffer)); time_t now = time(NULL); Reply(220, "%s SVDRP VideoDiskRecorder %s; %s", buffer, VDRVERSION, ctime(&now)); @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: svdrp.h 1.10 2001/09/01 09:24:50 kls Exp $ + * $Id: svdrp.h 1.11 2001/09/14 14:35:34 kls Exp $ */ #ifndef __SVDRP_H @@ -26,15 +26,13 @@ public: int Accept(void); }; -#define MAXCMDBUFFER 1024 - class cSVDRP { private: cSocket socket; cFile file; CRect ovlClipRects[MAXCLIPRECTS]; uint numChars; - char cmdLine[MAXCMDBUFFER]; + char cmdLine[MAXPARSEBUFFER]; char *message; time_t lastActivity; void Close(bool Timeout = false); @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: tools.c 1.43 2001/08/26 15:45:41 kls Exp $ + * $Id: tools.c 1.44 2001/09/14 14:35:37 kls Exp $ */ #define _GNU_SOURCE @@ -21,8 +21,6 @@ #include <unistd.h> #include "i18n.h" -#define MaxBuffer 1000 - int SysLogLevel = 3; ssize_t safe_read(int filedes, void *buffer, size_t size) @@ -56,7 +54,7 @@ void writechar(int filedes, char c) char *readline(FILE *f) { - static char buffer[MaxBuffer]; + static char buffer[MAXPARSEBUFFER]; if (fgets(buffer, sizeof(buffer), f) > 0) { int l = strlen(buffer) - 1; if (l >= 0 && buffer[l] == '\n') @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: tools.h 1.32 2001/09/14 13:40:35 kls Exp $ + * $Id: tools.h 1.33 2001/09/14 14:35:40 kls Exp $ */ #ifndef __TOOLS_H @@ -29,6 +29,11 @@ extern int SysLogLevel; #define SECSINDAY 86400 +#define KILOBYTE(n) ((n) * 1024) +#define MEGABYTE(n) ((n) * 1024 * 1024) + +#define MAXPARSEBUFFER KILOBYTE(10) + #define DELETENULL(p) (delete (p), p = NULL) template<class T> inline T min(T a, T b) { return a <= b ? a : b; } |