Fix HTTP under Windows.

This commit is contained in:
Alcaro 2015-01-23 23:02:01 +01:00
parent 1156e9d860
commit 3805a4045e
3 changed files with 9 additions and 4 deletions

View File

@ -35,9 +35,6 @@ typedef struct
char part;
char bodytype;
bool error;
#if 0
char padding[5];
#endif
size_t pos;
size_t len;

View File

@ -1,8 +1,16 @@
#include <stdio.h>
#include "net_http.h"
#ifdef _WIN32
#include <winsock2.h>
#endif
int main(void)
{
#ifdef _WIN32
WSADATA wsaData;
WSAStartup(MAKEWORD(2, 2), &wsaData);
#endif
char *w;
http_t *http1, *http2, *http3;
size_t len, pos = 0; size_t tot = 0;

View File

@ -34,7 +34,7 @@
#ifndef MSG_NOSIGNAL
#define MSG_NOSIGNAL 0
#endif
#define isagain(bytes) (false)
#define isagain(bytes) (bytes==SOCKET_ERROR && WSAGetLastError()==WSAEWOULDBLOCK)
#elif defined(_XBOX)
#define NOD3D
#include <xtl.h>