|
version 1.1.1.1, 2012/02/21 23:16:22
|
version 1.1.1.2, 2013/07/22 00:36:10
|
|
Line 1
|
Line 1
|
| /* $Id$ */ |
/* $Id$ */ |
| /* Project : miniupnp |
/* Project : miniupnp |
| * Author : Thomas Bernard |
* Author : Thomas Bernard |
| * Copyright (c) 2005-2009 Thomas Bernard | * Copyright (c) 2005-2012 Thomas Bernard |
| * This software is subject to the conditions detailed in the |
* This software is subject to the conditions detailed in the |
| * LICENCE file provided in this distribution. |
* LICENCE file provided in this distribution. |
| * |
* |
|
Line 9
|
Line 9
|
| */ |
*/ |
| #include <stdio.h> |
#include <stdio.h> |
| #include <string.h> |
#include <string.h> |
| #ifdef WIN32 | #ifdef _WIN32 |
| #include <io.h> |
#include <io.h> |
| #include <winsock2.h> |
#include <winsock2.h> |
| #define snprintf _snprintf |
#define snprintf _snprintf |
|
Line 24
|
Line 24
|
| /* only for malloc */ |
/* only for malloc */ |
| #include <stdlib.h> |
#include <stdlib.h> |
| |
|
| #ifdef WIN32 | #ifdef _WIN32 |
| #define PRINT_SOCKET_ERROR(x) printf("Socket error: %s, %d\n", x, WSAGetLastError()); |
#define PRINT_SOCKET_ERROR(x) printf("Socket error: %s, %d\n", x, WSAGetLastError()); |
| #else |
#else |
| #define PRINT_SOCKET_ERROR(x) perror(x) |
#define PRINT_SOCKET_ERROR(x) perror(x) |
|
Line 57 httpWrite(int fd, const char * body, int bodysize,
|
Line 57 httpWrite(int fd, const char * body, int bodysize,
|
| /* disable send on the socket */ |
/* disable send on the socket */ |
| /* draytek routers dont seems to like that... */ |
/* draytek routers dont seems to like that... */ |
| #if 0 |
#if 0 |
| #ifdef WIN32 | #ifdef _WIN32 |
| if(shutdown(fd, SD_SEND)<0) { |
if(shutdown(fd, SD_SEND)<0) { |
| #else |
#else |
| if(shutdown(fd, SHUT_WR)<0) { /*SD_SEND*/ |
if(shutdown(fd, SHUT_WR)<0) { /*SD_SEND*/ |