X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_api.h;fp=php_http_api.h;h=fa0c1c89594f46d770e146f611f98b9bb4f3e215;hp=44071222526466386977c8e557747708b2bf4c9d;hb=c1782429f025af40d805d9c1b5b9d4416465318e;hpb=12253a8360a79b01a0747fe83cf1ec37132fd916 diff --git a/php_http_api.h b/php_http_api.h index 4407122..fa0c1c8 100644 --- a/php_http_api.h +++ b/php_http_api.h @@ -168,9 +168,9 @@ static inline void _http_sleep(double s) #define HTTP_MLLISEC (1000) #define HTTP_MCROSEC (1000 * 1000) #define HTTP_NANOSEC (1000 * 1000 * 1000) -#define HTTP_MSEC(s) (s * HTTP_MLLISEC) -#define HTTP_USEC(s) (s * HTTP_MCROSEC) -#define HTTP_NSEC(s) (s * HTTP_NANOSEC) +#define HTTP_MSEC(s) ((long)(s * HTTP_MLLISEC)) +#define HTTP_USEC(s) ((long)(s * HTTP_MCROSEC)) +#define HTTP_NSEC(s) ((long)(s * HTTP_NANOSEC)) #if defined(PHP_WIN32) Sleep((DWORD) HTTP_MSEC(s)); @@ -227,7 +227,7 @@ static inline const char *_http_locate_body(const char *message) if (*(msg+1) == '\n') { body = msg + 2; break; - } else if (*(msg+1) == '\r' && *(msg+2) == '\n' && msg != message && *(msg-1) == '\r') { + } else if (*(msg+1) == '\r' && *(msg+2) == '\n') { body = msg + 3; break; }