- honor other REGISTER_CLASS macros too
[m6w6/ext-http] / http_request_api.c
index 857bc6706b8afc27f0a6451012accbaf4d708d61..5214a77c401f025e4bad8bc3a893f2915b082dfb 100644 (file)
@@ -1,16 +1,13 @@
 /*
-   +----------------------------------------------------------------------+
-   | PECL :: http                                                         |
-   +----------------------------------------------------------------------+
-   | This source file is subject to version 3.0 of the PHP license, that  |
-   | is bundled with this package in the file LICENSE, and is available   |
-   | through the world-wide-web at http://www.php.net/license/3_0.txt.    |
-   | If you did not receive a copy of the PHP license and are unable to   |
-   | obtain it through the world-wide-web, please send a note to          |
-   | license@php.net so we can mail you a copy immediately.               |
-   +----------------------------------------------------------------------+
-   | Copyright (c) 2004-2005 Michael Wallner <mike@php.net>               |
-   +----------------------------------------------------------------------+
+    +--------------------------------------------------------------------+
+    | PECL :: http                                                       |
+    +--------------------------------------------------------------------+
+    | Redistribution and use in source and binary forms, with or without |
+    | modification, are permitted provided that the conditions mentioned |
+    | in the accompanying LICENSE file are met.                          |
+    +--------------------------------------------------------------------+
+    | Copyright (c) 2004-2005, Michael Wallner <mike@php.net>            |
+    +--------------------------------------------------------------------+
 */
 
 /* $Id$ */
@@ -837,10 +834,6 @@ static int http_curl_raw_callback(CURL *ch, curl_infotype type, char *data, size
 {
        HTTP_REQUEST_CALLBACK_DATA(ctx, http_request_conv *, conv);
 
-#if 0
-       fprintf(stderr, "DEBUG: %s\n", data);
-#endif
-
        switch (type)
        {
                case CURLINFO_DATA_IN:
@@ -861,6 +854,26 @@ static int http_curl_raw_callback(CURL *ch, curl_infotype type, char *data, size
                                phpstr_append(conv->request, data, length);
                        }
                break;
+#if 0
+               default:
+                       fprintf(stderr, "## ", type);
+                       if (!type) {
+                               fprintf(stderr, "%s", data);
+                       } else {
+                               ulong i;
+                               for (i = 1; i <= length; ++i) {
+                                       fprintf(stderr, "%02X ", data[i-1] & 0xFF);
+                                       if (!(i % 20)) {
+                                               fprintf(stderr, "\n## ");
+                                       }
+                               }
+                               fprintf(stderr, "\n");
+                       }
+                       if (data[length-1] != 0xa) {
+                               fprintf(stderr, "\n");
+                       }
+               break;
+#endif
        }
 
        if (type) {
@@ -910,9 +923,9 @@ static void http_ssl_lock(int mode, int n, const char * file, int line)
        }
 }
 
-static unsigned long http_ssl_id(void)
+static ulong http_ssl_id(void)
 {
-       return (unsigned long) tsrm_thread_id();
+       return (ulong) tsrm_thread_id();
 }
 
 static inline void http_ssl_init(void)