| modification, are permitted provided that the conditions mentioned |
| in the accompanying LICENSE file are met. |
+--------------------------------------------------------------------+
- | Copyright (c) 2004-2006, Michael Wallner <mike@php.net> |
+ | Copyright (c) 2004-2010, Michael Wallner <mike@php.net> |
+--------------------------------------------------------------------+
*/
case IS_HTTP_RESPONSE:
add_assoc_long(&array, "Response Code", (long) HTTP_INFO(info).response.code);
- add_assoc_string(&array, "Response Status", HTTP_INFO(info).response.status, 1);
+ if (HTTP_INFO(info).response.status) {
+ add_assoc_string(&array, "Response Status", HTTP_INFO(info).response.status, 1);
+ }
break;
}
}
}
#endif
- info->http.version = atof(http + lenof("HTTP/"));
+ info->http.version = zend_strtod(http + lenof("HTTP/"), NULL);
/* is response */
if (pre_header == http) {
while (' ' == *status) ++status;
HTTP_INFO(info).response.status = estrndup(status, end - status);
} else {
- HTTP_INFO(info).response.status = ecalloc(1, 1);
+ HTTP_INFO(info).response.status = NULL;
}
return SUCCESS;
return FAILURE;
}
} else {
- HTTP_INFO(info).request.method = ecalloc(1, 1);
- HTTP_INFO(info).request.url = ecalloc(1, 1);
+ HTTP_INFO(info).request.method = NULL;
+ HTTP_INFO(info).request.url = NULL;
}
return SUCCESS;
}
}
-
/*
* Local variables:
* tab-width: 4