CVS update: php3
| From: | sas | Date: | Thu, 20 May 1999 16:34:33 +0000 |
| Subject: | CVS update: php3 | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-5812@lists.php.net to get a copy of this message | ||
Date: Thursday May 20, 1999 @ 12:34
Author: sas
Update of /repository/php3
In directory php:/tmp/cvs-serv22643
Modified Files:
ChangeLog fopen-wrappers.c fopen-wrappers.h
Log Message:
Rewrite of the socket buffering system. This also fixes all known issues
as documented within the code.
In this form, all updated functions work. I don't know of any problems, but
I'm eagerly awaiting Stig's "pain tests."
I've used emalloc and friends to find possible memory problems. Once we are
sure they work, they must be replaced with their respective C library calls
for persistency support.
Index: php3/ChangeLog
diff -u php3/ChangeLog:1.635 php3/ChangeLog:1.636
--- php3/ChangeLog:1.635 Wed May 19 14:49:09 1999
+++ php3/ChangeLog Thu May 20 12:34:31 1999
@@ -1,6 +1,8 @@
PHP 3.0 CHANGE LOG ChangeLog
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
May 19 1999, Version 3.0.8
+- Rewrite socket buffering subsystem (Sascha)
+- Fix semaphore support on glibc-2.1 systems (Sascha)
- Add headers_sent() function which returns true if the http headers have been
sent out already
- Ora_GetColumn and Ora_Fetch_Into can now return "LONG" and "LONG RAW"
Index: php3/fopen-wrappers.c
diff -u php3/fopen-wrappers.c:1.58 php3/fopen-wrappers.c:1.59
--- php3/fopen-wrappers.c:1.58 Mon Apr 5 17:34:23 1999
+++ php3/fopen-wrappers.c Thu May 20 12:34:32 1999
@@ -27,7 +27,7 @@
| Jim Winstead <jimw@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: fopen-wrappers.c,v 1.58 1999/04/05 21:34:23 sas Exp $ */
+/* $Id: fopen-wrappers.c,v 1.59 1999/05/20 16:34:32 sas Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
@@ -480,7 +480,6 @@
FILE *fp = NULL;
struct sockaddr_in server;
unsigned short portno;
- char winfeof;
if (!strncasecmp(path, "http://", 7)) {
resource = url_parse(path);
@@ -590,8 +589,8 @@
/* Read past http header */
body = 0;
location[0] = '\0';
- while (!body && recv(*socketd, (char *) &winfeof, 1, MSG_PEEK)) {
- if (SOCK_FGETC(buf, *socketd) == SOCK_RECV_ERR) {
+ while (!body && !SOCK_FEOF(*socketd)) {
+ if (SOCK_FGETC(*socketd) == SOCK_RECV_ERR) {
SOCK_FCLOSE(*socketd);
*socketd = 0;
free_url(resource);
Index: php3/fopen-wrappers.h
diff -u php3/fopen-wrappers.h:1.23 php3/fopen-wrappers.h:1.24
--- php3/fopen-wrappers.h:1.23 Thu Feb 25 09:57:54 1999
+++ php3/fopen-wrappers.h Thu May 20 12:34:32 1999
@@ -26,7 +26,7 @@
| Authors: Jim Winstead <jimw@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: fopen-wrappers.h,v 1.23 1999/02/25 14:57:54 rasmus Exp $ */
+/* $Id: fopen-wrappers.h,v 1.24 1999/05/20 16:34:32 sas Exp $ */
#ifndef _FOPEN_WRAPPERS_H
#define _FOPEN_WRAPPERS_H
@@ -55,8 +55,10 @@
#endif
#define SOCK_WRITE(d,s) send(s,d,strlen(d),0)
#define SOCK_WRITEL(d,l,s) send(s,d,l,0)
-#define SOCK_FGETC(c,s) recv(s,c,1,0)
+#define SOCK_FGETC(s) _php3_sock_fgetc((s))
#define SOCK_FGETS(b,l,s) _php3_sock_fgets((b),(l),(s))
+#define SOCK_FEOF(sock) _php3_sock_feof((sock))
+#define SOCK_FREAD(ptr,size,sock) _php3_sock_fread((ptr),(size),(sock))
/* values for issock */
#define IS_NOT_SOCKET 0
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net