aboutsummaryrefslogtreecommitdiff
path: root/www/pserv
diff options
context:
space:
mode:
authorAlex Dupre <ale@FreeBSD.org>2004-05-05 09:45:38 +0000
committerAlex Dupre <ale@FreeBSD.org>2004-05-05 09:45:38 +0000
commitde8127efe5f697d7aa2cf288b37c40a03fcc6f97 (patch)
tree8febfe7f664f83bf0778fd8d8c70475289d8bb3b /www/pserv
parentcdaf84bfc95e0822f12cf463779ab16a26c474a7 (diff)
downloadports-de8127efe5f697d7aa2cf288b37c40a03fcc6f97.tar.gz
ports-de8127efe5f697d7aa2cf288b37c40a03fcc6f97.zip
Notes
Diffstat (limited to 'www/pserv')
-rw-r--r--www/pserv/Makefile1
-rw-r--r--www/pserv/files/patch-handlers.c27
-rw-r--r--www/pserv/files/patch-main.c48
3 files changed, 37 insertions, 39 deletions
diff --git a/www/pserv/Makefile b/www/pserv/Makefile
index 7e50554f267d..1bbbe6681f42 100644
--- a/www/pserv/Makefile
+++ b/www/pserv/Makefile
@@ -7,6 +7,7 @@
PORTNAME= pserv
PORTVERSION= 3.0.b3
+PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
diff --git a/www/pserv/files/patch-handlers.c b/www/pserv/files/patch-handlers.c
index 9f232cc89b24..fefc0325b371 100644
--- a/www/pserv/files/patch-handlers.c
+++ b/www/pserv/files/patch-handlers.c
@@ -1,5 +1,5 @@
---- sources/handlers.c.orig Mon Oct 20 10:27:32 2003
-+++ sources/handlers.c Tue Oct 21 00:13:59 2003
+--- sources/handlers.c.orig Thu Oct 23 12:43:05 2003
++++ sources/handlers.c Fri Apr 23 16:19:52 2004
@@ -24,6 +24,7 @@
#endif
@@ -35,7 +35,7 @@
newEnvp[i] = NULL;
/* we change the current working directory to the scripts one */
-@@ -317,7 +331,244 @@
+@@ -317,7 +331,251 @@
return 0;
}
@@ -214,6 +214,13 @@
+ newArgv[i] = NULL; /* we correctly terminate argv */
+
+ i = 0;
++ /* beware of not overfilling this array, check MAX_ENVP_LEN */
++ if (req.contentLength != -1)
++ {
++ sprintf(newEnvp[i++], "CONTENT_LENGTH=%ld", req.contentLength);
++ strcpy(newEnvp[i], "CONTENT_TYPE=");
++ strcat(newEnvp[i++], req.contentType);
++ }
+ strcpy(newEnvp[i], "SERVER_NAME=");
+ strcat(newEnvp[i++], DEFAULT_SERVER_NAME);
+ strcpy(newEnvp[i], "SERVER_SOFTWARE=");
@@ -281,17 +288,3 @@
int sock;
char filePath[];
char mimeType[];
-@@ -360,11 +611,11 @@
- return -1;
- }
- stat(filePath, &fileStats);
-- generateMimeHeader(sock, 200, mimeType, &fileStats, req.protocolVersion, FULL_HEADER);
-- logWriter(LOG_GET_SUCCESS, req.documentAddress, (long int)fileStats.st_size, req, 0);
- howMany = 0;
- if (strncmp(mimeType, "text", 4)) /* check if it is a text type */
- { /* raw binary output routine */
-+ generateMimeHeader(sock, 200, mimeType, &fileStats, req.protocolVersion, FULL_HEADER);
-+ logWriter(LOG_GET_SUCCESS, req.documentAddress, (long int)fileStats.st_size, req, 0);
- fatal = NO;
- retry = NO;
- while(!feof(inFile) && !fatal)
diff --git a/www/pserv/files/patch-main.c b/www/pserv/files/patch-main.c
index 64020a82ee01..1948cef4aa2f 100644
--- a/www/pserv/files/patch-main.c
+++ b/www/pserv/files/patch-main.c
@@ -1,5 +1,5 @@
--- sources/main.c.orig Sat Dec 20 11:16:21 2003
-+++ sources/main.c Thu Jan 8 12:27:13 2004
++++ sources/main.c Wed May 5 11:28:52 2004
@@ -23,6 +23,7 @@
char defaultFileName[MAX_PATH_LEN+1];
char logFileName[MAX_PATH_LEN+1];
@@ -23,21 +23,10 @@
while (i < readLines)
{
if (!strncmp(reqArray[i], "User-Agent:", strlen("User-Agent:")))
-@@ -327,14 +331,28 @@
- strncpy(reqStruct->userAgent, &reqArray[i][strlen("User-Agent: ")], USER_AGENT_LEN - 1);
- reqStruct->userAgent[USER_AGENT_LEN] = '\0';
- }
-- else if (!strncmp(reqArray[i], "Content-Length:", strlen("Content-length:")) || !strncmp(reqArray[i], "Content-length:", strlen("Content-length:")))
-- {
-- strcpy(token, &reqArray[i][strlen("Content-length: ")]);
-- sscanf(token, "%ld", &(reqStruct->contentLength));
-+ else if (!strncmp(reqArray[i], "Content-Length:", strlen("Content-length:")) || !strncmp(reqArray[i], "Content-length:", strlen("Content-length:")))
-+ {
-+ strcpy(token, &reqArray[i][strlen("Content-length: ")]);
-+ sscanf(token, "%ld", &(reqStruct->contentLength));
-+#ifdef PRINTF_DEBUG
-+ printf("content length %ld\n", reqStruct->contentLength);
-+#endif
+@@ -334,6 +338,20 @@
+ #ifdef PRINTF_DEBUG
+ printf("content length %ld\n", reqStruct->contentLength);
+ #endif
+ }
+ else if (!strncmp(reqArray[i], "Content-Type:", strlen("Content-type:")) || !strncmp(reqArray[i], "Content-type:", strlen("Content-type:")))
+ {
@@ -49,15 +38,12 @@
+ else if (!strncmp(reqArray[i], "Cookie:", strlen("Cookie:")))
+ {
+ strncpy(reqStruct->cookie, &reqArray[i][strlen("Cookie: ")], MAX_COOKIE_LEN - 1);
- #ifdef PRINTF_DEBUG
-- printf("content length %ld\n", reqStruct->contentLength);
++#ifdef PRINTF_DEBUG
+ printf("cookie %s\n", reqStruct->cookie);
- #endif
-- }
-+ }
++#endif
+ }
i++;
}
- /* if we didn't find a User-Agent we fill in a (N)ot(R)ecognized */
@@ -431,18 +449,39 @@
/* we append the default file name */
strcat(completeFilePath, defaultFileName);
@@ -131,6 +117,15 @@
#ifdef PRINTF_DEBUG
printf ("begin of post handling\n");
+@@ -547,7 +586,7 @@
+ return -1;
+ } else if (req.contentLength >= BUFFER_SIZE)
+ {
+- sayError(sock, BUFFER_OVERFLOW, "", req);
++ sayError(sock, POST_BUFFER_OVERFLOW, "", req);
+ return -1;
+ }
+ while (!readFinished)
@@ -625,7 +664,77 @@
#ifdef PRINTF_DEBUG
printf("buff: |%s|\n", buff);
@@ -257,3 +252,12 @@
}
if (!feof(f)) fscanf(f, "%s %s", str1, str2);
if (str1 != NULL && str2 != NULL && !strcmp(str1, "cgiRoot"))
+@@ -1002,7 +1127,7 @@
+ } */
+ } else
+ {
+- sayError(newSocket, BUFFER_OVERFLOW, "", NULL);
++ sayError(newSocket, POST_BUFFER_OVERFLOW, "", NULL);
+ }
+ }
+ if (close(newSocket))