miniupnpc: use #define UPNP_VERSION_STRING "UPnP/1.1"

This commit is contained in:
Thomas Bernard 2014-11-05 06:34:51 +01:00
parent 80268b203c
commit 55fc3e4c3c
4 changed files with 23 additions and 7 deletions

View File

@ -1,7 +1,7 @@
/* $Id: minisoap.c,v 1.22 2012/01/21 13:30:31 nanard Exp $ */ /* $Id: minisoap.c,v 1.23 2014/11/04 22:31:55 nanard Exp $ */
/* Project : miniupnp /* Project : miniupnp
* Author : Thomas Bernard * Author : Thomas Bernard
* Copyright (c) 2005-2012 Thomas Bernard * Copyright (c) 2005-2014 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.
* *
@ -96,7 +96,7 @@ int soapPostSubmit(int fd,
headerssize = snprintf(headerbuf, sizeof(headerbuf), headerssize = snprintf(headerbuf, sizeof(headerbuf),
"POST %s HTTP/%s\r\n" "POST %s HTTP/%s\r\n"
"Host: %s%s\r\n" "Host: %s%s\r\n"
"User-Agent: " OS_STRING ", UPnP/1.0, MiniUPnPc/" MINIUPNPC_VERSION_STRING "\r\n" "User-Agent: " OS_STRING ", " UPNP_VERSION_STRING ", MiniUPnPc/" MINIUPNPC_VERSION_STRING "\r\n"
"Content-Length: %d\r\n" "Content-Length: %d\r\n"
"Content-Type: text/xml\r\n" "Content-Type: text/xml\r\n"
"SOAPAction: \"%s\"\r\n" "SOAPAction: \"%s\"\r\n"

View File

@ -4,4 +4,12 @@
#define OS_STRING "${CMAKE_SYSTEM_NAME}" #define OS_STRING "${CMAKE_SYSTEM_NAME}"
#define MINIUPNPC_VERSION_STRING "${MINIUPNPC_VERSION}" #define MINIUPNPC_VERSION_STRING "${MINIUPNPC_VERSION}"
#if 0
/* according to "UPnP Device Architecture 1.0" */
#define UPNP_VERSION_STRING "UPnP/1.0"
#else
/* according to "UPnP Device Architecture 1.1" */
#define UPNP_VERSION_STRING "UPnP/1.1"
#endif
#endif #endif

View File

@ -1,8 +1,8 @@
/* $Id: miniupnpcstrings.h.in,v 1.4 2011/01/04 11:41:53 nanard Exp $ */ /* $Id: miniupnpcstrings.h.in,v 1.6 2014/11/04 22:31:55 nanard Exp $ */
/* Project: miniupnp /* Project: miniupnp
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
* Author: Thomas Bernard * Author: Thomas Bernard
* Copyright (c) 2005-2011 Thomas Bernard * Copyright (c) 2005-2014 Thomas Bernard
* This software is subjects to the conditions detailed * This software is subjects to the conditions detailed
* in the LICENCE file provided within this distribution */ * in the LICENCE file provided within this distribution */
#ifndef MINIUPNPCSTRINGS_H_INCLUDED #ifndef MINIUPNPCSTRINGS_H_INCLUDED
@ -11,5 +11,13 @@
#define OS_STRING "OS/version" #define OS_STRING "OS/version"
#define MINIUPNPC_VERSION_STRING "version" #define MINIUPNPC_VERSION_STRING "version"
#if 0
/* according to "UPnP Device Architecture 1.0" */
#define UPNP_VERSION_STRING "UPnP/1.0"
#else
/* according to "UPnP Device Architecture 1.1" */
#define UPNP_VERSION_STRING "UPnP/1.1"
#endif
#endif #endif

View File

@ -1,4 +1,4 @@
/* $Id: miniwget.c,v 1.61 2014/02/05 17:27:48 nanard Exp $ */ /* $Id: miniwget.c,v 1.65 2014/11/04 22:31:55 nanard Exp $ */
/* Project : miniupnp /* Project : miniupnp
* Website : http://miniupnp.free.fr/ * Website : http://miniupnp.free.fr/
* Author : Thomas Bernard * Author : Thomas Bernard
@ -368,7 +368,7 @@ miniwget3(const char * host,
"GET %s HTTP/%s\r\n" "GET %s HTTP/%s\r\n"
"Host: %s:%d\r\n" "Host: %s:%d\r\n"
"Connection: Close\r\n" "Connection: Close\r\n"
"User-Agent: " OS_STRING ", UPnP/1.0, MiniUPnPc/" MINIUPNPC_VERSION_STRING "\r\n" "User-Agent: " OS_STRING ", " UPNP_VERSION_STRING ", MiniUPnPc/" MINIUPNPC_VERSION_STRING "\r\n"
"\r\n", "\r\n",
path, httpversion, host, port); path, httpversion, host, port);