← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2169: miniupnpc: remove minissdpc, it's not for Win

 

------------------------------------------------------------
revno: 2169
committer: poy <poy@xxxxxxxxxx>
branch nick: repo
timestamp: Fri 2010-06-25 22:23:07 +0200
message:
  miniupnpc: remove minissdpc, it's not for Win
removed:
  miniupnpc/minissdpc.c
  miniupnpc/vc/
  miniupnpc/vc/unistd.h
modified:
  miniupnpc/SConscript


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'miniupnpc/SConscript'
--- miniupnpc/SConscript	2010-06-18 15:02:48 +0000
+++ miniupnpc/SConscript	2010-06-25 20:23:07 +0000
@@ -3,10 +3,7 @@
 env, target, sources = dev.prepare_build(source_path, 'miniupnpc', source_glob = '*.c', in_bin = False)
 
 if dev.is_win32():
-	env.Append(CPPDEFINES = ['STATICLIB', '_WIN32_WINNT=0x501', '_WIN32_IE=0x501', 'WINVER=0x501', 'WIN32_LEAN_AND_MEAN'])
-	if env['CC'] == 'cl': # MSVC
-		env.Append(CPPDEFINES = ['WIN32'])
-		env.Append(CPPPATH = ['vc'])
+	env.Append(CPPDEFINES = ['STATICLIB', 'WIN32', '_WIN32_WINNT=0x501', '_WIN32_IE=0x501', 'WINVER=0x501', 'WIN32_LEAN_AND_MEAN'])
 
 ret = env.StaticLibrary(target, sources)
 

=== removed file 'miniupnpc/minissdpc.c'
--- miniupnpc/minissdpc.c	2010-06-18 12:09:55 +0000
+++ miniupnpc/minissdpc.c	1970-01-01 00:00:00 +0000
@@ -1,130 +0,0 @@
-/* $Id: minissdpc.c,v 1.13 2009/12/04 16:57:29 nanard Exp $ */
-/* Project : miniupnp
- * Author : Thomas BERNARD
- * copyright (c) 2005-2009 Thomas Bernard
- * This software is subjet to the conditions detailed in the
- * provided LICENCE file. */
-/*#include <syslog.h>*/
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#if defined(WIN32) || defined(__amigaos__) || defined(__amigaos4__)
-#ifdef WIN32
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#include <io.h>
-#endif
-#if defined(__amigaos__) || defined(__amigaos4__)
-#include <sys/socket.h>
-#endif
-#if defined(__amigaos__)
-#define uint16_t unsigned short
-#endif
-/* Hack */
-#define UNIX_PATH_LEN   108
-struct sockaddr_un {
-  uint16_t sun_family;
-  char     sun_path[UNIX_PATH_LEN];
-};
-#else
-#include <sys/socket.h>
-#include <sys/un.h>
-#endif
-
-#include "minissdpc.h"
-#include "miniupnpc.h"
-
-#include "codelength.h"
-
-struct UPNPDev *
-getDevicesFromMiniSSDPD(const char * devtype, const char * socketpath)
-{
-	struct UPNPDev * tmp;
-	struct UPNPDev * devlist = NULL;
-	unsigned char buffer[2048];
-	ssize_t n;
-	unsigned char * p;
-	unsigned char * url;
-	unsigned int i;
-	unsigned int urlsize, stsize, usnsize, l;
-	int s;
-	struct sockaddr_un addr;
-
-	s = socket(AF_UNIX, SOCK_STREAM, 0);
-	if(s < 0)
-	{
-		/*syslog(LOG_ERR, "socket(unix): %m");*/
-		perror("socket(unix)");
-		return NULL;
-	}
-	addr.sun_family = AF_UNIX;
-	strncpy(addr.sun_path, socketpath, sizeof(addr.sun_path));
-	/* TODO : check if we need to handle the EINTR */
-	if(connect(s, (struct sockaddr *)&addr, sizeof(struct sockaddr_un)) < 0)
-	{
-		/*syslog(LOG_WARNING, "connect(\"%s\"): %m", socketpath);*/
-		close(s);
-		return NULL;
-	}
-	stsize = strlen(devtype);
-	buffer[0] = 1; /* request type 1 : request devices/services by type */
-	p = buffer + 1;
-	l = stsize;	CODELENGTH(l, p);
-	if(p + stsize > buffer + sizeof(buffer))
-	{
-		/* devtype is too long ! */
-		close(s);
-		return NULL;
-	}
-	memcpy(p, devtype, stsize);
-	p += stsize;
-	if(write(s, buffer, p - buffer) < 0)
-	{
-		/*syslog(LOG_ERR, "write(): %m");*/
-		perror("minissdpc.c: write()");
-		close(s);
-		return NULL;
-	}
-	n = read(s, buffer, sizeof(buffer));
-	if(n<=0)
-	{
-		perror("minissdpc.c: read()");
-		close(s);
-		return NULL;
-	}
-	p = buffer + 1;
-	for(i = 0; i < buffer[0]; i++)
-	{
-		if(p+2>=buffer+sizeof(buffer))
-			break;
-		DECODELENGTH(urlsize, p);
-		if(p+urlsize+2>=buffer+sizeof(buffer))
-			break;
-		url = p;
-		p += urlsize;
-		DECODELENGTH(stsize, p);
-		if(p+stsize+2>=buffer+sizeof(buffer))
-			break;
-		tmp = (struct UPNPDev *)malloc(sizeof(struct UPNPDev)+urlsize+stsize);
-		tmp->pNext = devlist;
-		tmp->descURL = tmp->buffer;
-		tmp->st = tmp->buffer + 1 + urlsize;
-		memcpy(tmp->buffer, url, urlsize);
-		tmp->buffer[urlsize] = '\0';
-		memcpy(tmp->buffer + urlsize + 1, p, stsize);
-		p += stsize;
-		tmp->buffer[urlsize+1+stsize] = '\0';
-		devlist = tmp;
-		/* added for compatibility with recent versions of MiniSSDPd 
-		 * >= 2007/12/19 */
-		DECODELENGTH(usnsize, p);
-		p += usnsize;
-		if(p>buffer + sizeof(buffer))
-			break;
-	}
-	close(s);
-	return devlist;
-}
-

=== removed directory 'miniupnpc/vc'
=== removed file 'miniupnpc/vc/unistd.h'
--- miniupnpc/vc/unistd.h	2010-06-18 15:02:48 +0000
+++ miniupnpc/vc/unistd.h	1970-01-01 00:00:00 +0000
@@ -1,5 +0,0 @@
-// stub file for VC
-
-#define uint16_t UINT16
-#define ssize_t SSIZE_T
-#define snprintf _snprintf