[PHP-DEV] CVS update: php31/main From: shane (php-dev <email protected>)
Date: 05/31/98

Date: Sunday May 31, 1998 @ 12:44
Author: shane

Update of /repository/php31/main
In directory asf:/tmp/cvs-serv25702/main

Modified Files:
        head.c main.c
Log Message:
Added getmyiid for getting instance or thread id's. Change sapi to expect
php3_globals as the first param to its functions, as some server modules
may need information from the globals (such as request ini variables).

Index: php31/main/head.c
diff -c php31/main/head.c:1.2 php31/main/head.c:1.3
*** php31/main/head.c:1.2 Fri May 29 10:51:44 1998
--- php31/main/head.c Sun May 31 12:44:27 1998
***************
*** 26,32 ****
     | Authors: Rasmus Lerdorf <rasmus <email protected>> |
     +----------------------------------------------------------------------+
   */
! /* $Id: head.c,v 1.2 1998/05/29 14:51:44 shane Exp $ */
  #ifdef THREAD_SAFE
  #include "tls.h"
  #endif
--- 26,32 ----
     | Authors: Rasmus Lerdorf <rasmus <email protected>> |
     +----------------------------------------------------------------------+
   */
! /* $Id: head.c,v 1.3 1998/05/31 16:44:27 shane Exp $ */
  #ifdef THREAD_SAFE
  #include "tls.h"
  #endif
***************
*** 103,112 ****
                          GLOBAL(cont_type) = estrdup(r + 1);
                  } else {
                          *r = ':';
! GLOBAL(sapi_rqst)->insert_header(GLOBAL(sapi_rqst)->scid,arg1->value.str.val);
                  }
          } else {
! GLOBAL(sapi_rqst)->insert_header(GLOBAL(sapi_rqst)->scid,arg1->value.str.val);
          }
  }
  
--- 103,112 ----
                          GLOBAL(cont_type) = estrdup(r + 1);
                  } else {
                          *r = ':';
! GLOBAL(sapi_rqst)->insert_header(php3_globals,arg1->value.str.val);
                  }
          } else {
! GLOBAL(sapi_rqst)->insert_header(php3_globals,arg1->value.str.val);
          }
  }
  
***************
*** 134,153 ****
                          php3_treat_data(PARSE_POST, NULL); /* POST Data */
                  }
                  if (!GLOBAL(cont_type)) {
! GLOBAL(sapi_rqst)->insert_header(GLOBAL(sapi_rqst),"Content-type: text/html");
! GLOBAL(sapi_rqst)->send_header(GLOBAL(sapi_rqst));
                  } else {
                          tempstr = emalloc(strlen(GLOBAL(cont_type)) + sizeof("Content-type:") +1);
                          if(tempstr) {
                                  strcpy(tempstr, "Content-type:");
                                  strcpy(tempstr + sizeof("Content-type:") - 1, GLOBAL(cont_type));
! GLOBAL(sapi_rqst)->insert_header(GLOBAL(sapi_rqst),tempstr);
                                  efree(tempstr);
                          }
! GLOBAL(sapi_rqst)->send_header(GLOBAL(sapi_rqst));
                          efree(GLOBAL(cont_type));
                  }
! GLOBAL(sapi_rqst)->flush(GLOBAL(sapi_rqst));
                  GLOBAL(php3_HeaderPrinted) = 1;
                  GLOBAL(header_called) = 1;
          }
--- 134,153 ----
                          php3_treat_data(PARSE_POST, NULL); /* POST Data */
                  }
                  if (!GLOBAL(cont_type)) {
! GLOBAL(sapi_rqst)->insert_header(php3_globals,"Content-type: text/html");
! GLOBAL(sapi_rqst)->send_header(php3_globals);
                  } else {
                          tempstr = emalloc(strlen(GLOBAL(cont_type)) + sizeof("Content-type:") +1);
                          if(tempstr) {
                                  strcpy(tempstr, "Content-type:");
                                  strcpy(tempstr + sizeof("Content-type:") - 1, GLOBAL(cont_type));
! GLOBAL(sapi_rqst)->insert_header(php3_globals,tempstr);
                                  efree(tempstr);
                          }
! GLOBAL(sapi_rqst)->send_header(php3_globals);
                          efree(GLOBAL(cont_type));
                  }
! GLOBAL(sapi_rqst)->flush(php3_globals);
                  GLOBAL(php3_HeaderPrinted) = 1;
                  GLOBAL(header_called) = 1;
          }
***************
*** 249,255 ****
          if(tempstr1) {
                  strcpy(tempstr1, "Set-Cookie: ");
                  strcpy(tempstr1 + sizeof("Set-Cookie: ") - 1, tempstr);
! GLOBAL(sapi_rqst)->insert_header(GLOBAL(sapi_rqst),tempstr1);
                  efree(tempstr1);
          }
          if (domain) efree(domain);
--- 249,255 ----
          if(tempstr1) {
                  strcpy(tempstr1, "Set-Cookie: ");
                  strcpy(tempstr1 + sizeof("Set-Cookie: ") - 1, tempstr);
! GLOBAL(sapi_rqst)->insert_header(php3_globals,tempstr1);
                  efree(tempstr1);
          }
          if (domain) efree(domain);
Index: php31/main/main.c
diff -c php31/main/main.c:1.14 php31/main/main.c:1.15
*** php31/main/main.c:1.14 Sun May 31 10:57:32 1998
--- php31/main/main.c Sun May 31 12:44:28 1998
***************
*** 29,35 ****
     +----------------------------------------------------------------------+
   */
  
! /* $Id: main.c,v 1.14 1998/05/31 14:57:32 shane Exp $ */
  
  /* #define CRASH_DETECTION */
  
--- 29,35 ----
     +----------------------------------------------------------------------+
   */
  
! /* $Id: main.c,v 1.15 1998/05/31 16:44:28 shane Exp $ */
  
  /* #define CRASH_DETECTION */
  
***************
*** 254,260 ****
  #endif
  #if USE_SAPI
          if (php3_header()) {
! GLOBAL(sapi_rqst)->log(GLOBAL(sapi_rqst)->scid, log_message);
          }
  #endif
  }
--- 254,260 ----
  #endif
  #if USE_SAPI
          if (php3_header()) {
! GLOBAL(sapi_rqst)->log(php3_globals, log_message);
          }
  #endif
  }
***************
*** 304,310 ****
          /* fix for memory manager shutting down before request is started! */
          if(GLOBAL(sapi_rqst) && !GLOBAL(sapi_rqst)->cgi){
  #endif
! ret = GLOBAL(sapi_rqst)->writeclient(GLOBAL(sapi_rqst)->scid, buffer, size);
  #if DEBUG
          }
  #endif
--- 304,310 ----
          /* fix for memory manager shutting down before request is started! */
          if(GLOBAL(sapi_rqst) && !GLOBAL(sapi_rqst)->cgi){
  #endif
! ret = GLOBAL(sapi_rqst)->writeclient(php3_globals, buffer, size);
  #if DEBUG
          }
  #endif
***************
*** 910,916 ****
          req = NULL;
  #endif
  #if USE_SAPI
! GLOBAL(sapi_rqst)->flush(GLOBAL(sapi_rqst)->scid);
  #endif
  }
  
--- 910,916 ----
          req = NULL;
  #endif
  #if USE_SAPI
! GLOBAL(sapi_rqst)->flush(php3_globals);
  #endif
  }
  
***************
*** 1243,1249 ****
          fflush(stdout);
  #endif
  #if 0 /* SAPI */
! GLOBAL(sapi_rqst)->flush(GLOBAL(sapi_rqst)->scid);
  #endif
  }
  
--- 1243,1249 ----
          fflush(stdout);
  #endif
  #if 0 /* SAPI */
! GLOBAL(sapi_rqst)->flush(php3_globals);
  #endif
  }