- rather use a list of disallowed chars
[m6w6/ext-http] / http_message_api.c
index 27f3d78228273ec502f2297387f60513e464043e..0b5908ecab8d5ea4598241fe440ad62929457af5 100644 (file)
@@ -108,19 +108,20 @@ PHP_HTTP_API void _http_message_set_info(http_message *message, http_info *info)
 {
        message->http.version = info->http.version;
        
-       switch (info->type)
+       switch (message->type = info->type)
        {
                case IS_HTTP_REQUEST:
-                       message->type = HTTP_MSG_REQUEST;
                        HTTP_INFO(message).request.url = estrdup(HTTP_INFO(info).request.url);
                        STR_SET(HTTP_INFO(message).request.method, estrdup(HTTP_INFO(info).request.method));
-                       break;
+               break;
                
                case IS_HTTP_RESPONSE:
-                       message->type = HTTP_MSG_RESPONSE;
                        HTTP_INFO(message).response.code = HTTP_INFO(info).response.code;
                        STR_SET(HTTP_INFO(message).response.status, estrdup(HTTP_INFO(info).response.status));
-                       break;
+               break;
+               
+               default:
+               break;
        }
 }
 
@@ -490,7 +491,7 @@ PHP_HTTP_API STATUS _http_message_send(http_message *message TSRMLS_DC)
                                        parts.host = estrndup(Z_STRVAL_PP(zhost), Z_STRLEN_PP(zhost));
                                }
                                
-                               http_build_url(url, &parts, NULL, &uri, NULL);
+                               http_build_url(HTTP_URL_REPLACE, url, &parts, NULL, &uri, NULL);
                                php_url_free(url);
                                efree(parts.host);
                        } else {