pollita         Thu Jan 29 19:24:19 2004 EDT

  Modified files:              
    /php-src/ext/standard       http_fopen_wrapper.c 
    /php-src    NEWS 
  Log:
  Fix potential bug in http:// proxy support.  
  Some proxy servers require entire URI be sent in request string.
  
  Add context option "http"/"request_fulluri" to allow this behavior.
  
  
http://cvs.php.net/diff.php/php-src/ext/standard/http_fopen_wrapper.c?r1=1.80&r2=1.81&ty=u
Index: php-src/ext/standard/http_fopen_wrapper.c
diff -u php-src/ext/standard/http_fopen_wrapper.c:1.80 
php-src/ext/standard/http_fopen_wrapper.c:1.81
--- php-src/ext/standard/http_fopen_wrapper.c:1.80      Thu Jan  8 03:17:32 2004
+++ php-src/ext/standard/http_fopen_wrapper.c   Thu Jan 29 19:24:17 2004
@@ -18,7 +18,7 @@
    |          Wez Furlong <[EMAIL PROTECTED]>                          |
    +----------------------------------------------------------------------+
  */
-/* $Id: http_fopen_wrapper.c,v 1.80 2004/01/08 08:17:32 andi Exp $ */ 
+/* $Id: http_fopen_wrapper.c,v 1.81 2004/01/30 00:24:17 pollita Exp $ */ 
 
 #include "php.h"
 #include "php_globals.h"
@@ -105,7 +105,7 @@
        size_t chunk_size = 0, file_size = 0;
        int eol_detect = 0;
        char *transport_string, *errstr = NULL;
-       int transport_len, have_header = 0;
+       int transport_len, have_header = 0, request_fulluri = 0;
 
        if (redirect_max < 1) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Circular redirect, 
aborting.");
@@ -189,16 +189,33 @@
                strcpy(scratch, "GET ");
        }
 
-       /* file */
-       if (resource->path && *resource->path)
-               strlcat(scratch, resource->path, scratch_len);
-       else
-               strlcat(scratch, "/", scratch_len);
-
-       /* query string */
-       if (resource->query)    {
-               strlcat(scratch, "?", scratch_len);
-               strlcat(scratch, resource->query, scratch_len);
+       /* Should we send the entire path in the request line, default to no. */
+       if (context &&
+               php_stream_context_get_option(context, "http", "request_fulluri", 
&tmpzval) == SUCCESS) {
+               SEPARATE_ZVAL(tmpzval);
+               convert_to_boolean_ex(tmpzval);
+               request_fulluri = Z_BVAL_PP(tmpzval) ? 1 : 0;
+               zval_ptr_dtor(tmpzval);
+       }
+
+       if (request_fulluri) {
+               /* Ask for everything */
+               strcat(scratch, path);
+       } else {
+               /* Send the traditional /path/to/file?query_string */
+
+               /* file */
+               if (resource->path && *resource->path) {
+                       strlcat(scratch, resource->path, scratch_len);
+               } else {
+                       strlcat(scratch, "/", scratch_len);
+               }
+
+               /* query string */
+               if (resource->query)    {
+                       strlcat(scratch, "?", scratch_len);
+                       strlcat(scratch, resource->query, scratch_len);
+               }
        }
 
        /* protocol version we are speaking */
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1590&r2=1.1591&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1590 php-src/NEWS:1.1591
--- php-src/NEWS:1.1590 Mon Jan 26 17:30:23 2004
+++ php-src/NEWS        Thu Jan 29 19:24:18 2004
@@ -54,6 +54,8 @@
 - Fixed bug #24608 (__set not triggered when overloading with array).
   (Stanislav)
 - Fixed bug #24243 (enabling browscap causes segfault). (Wez)
+- Added context option "http"/"request_fulluri" to send entire URI in request.
+  Required format for some proxies. (Sara)
 - Added third optional parameter 'strict' to array_keys(). Works like the
   'strict' parameter of in_array(). Feature request #24258. (Andrey)
 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to