Fix compiler errors
This commit is contained in:
@@ -51,10 +51,10 @@ static void produce_response(HTTP_Engine *eng)
|
||||
http_engine_status(eng, 200);
|
||||
|
||||
// Set zero or more headers
|
||||
http_engine_header(eng, "Server: tinyhttp", -1);
|
||||
http_engine_header(eng, HTTP_STR("Server: tinyhttp"));
|
||||
|
||||
// Set some bytes in the body
|
||||
http_engine_body(eng, "Hello, world!", 13);
|
||||
http_engine_body(eng, HTTP_STR("Hello, world!"));
|
||||
|
||||
// This is one difference from the http_response_XXX API.
|
||||
// It's possible to write response content directly into
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#include <mswsock.h>
|
||||
@@ -222,4 +224,16 @@ int main(void)
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
printf("This example only works on windows!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user