Upgrade miniupnpc to 2.0

This commit is contained in:
Adam Ierymenko 2016-06-02 17:04:15 -07:00
commit 4342b71d7a
28 changed files with 198 additions and 1425 deletions

View file

@ -1,7 +1,7 @@
/* $Id: testminiwget.c,v 1.4 2012/06/23 22:35:59 nanard Exp $ */
/* $Id: testminiwget.c,v 1.5 2016/01/24 17:24:36 nanard Exp $ */
/* Project : miniupnp
* Author : Thomas Bernard
* Copyright (c) 2005-2012 Thomas Bernard
* Copyright (c) 2005-2016 Thomas Bernard
* This software is subject to the conditions detailed in the
* LICENCE file provided in this distribution.
* */
@ -20,15 +20,17 @@ int main(int argc, char * * argv)
int size, writtensize;
FILE *f;
char addr[64];
int status_code = -1;
if(argc < 3) {
fprintf(stderr, "Usage:\t%s url file\n", argv[0]);
fprintf(stderr, "Example:\t%s http://www.google.com/ out.html\n", argv[0]);
return 1;
}
data = miniwget_getaddr(argv[1], &size, addr, sizeof(addr), 0);
if(!data) {
fprintf(stderr, "Error fetching %s\n", argv[1]);
data = miniwget_getaddr(argv[1], &size, addr, sizeof(addr), 0, &status_code);
if(!data || (status_code != 200)) {
if(data) free(data);
fprintf(stderr, "Error %d fetching %s\n", status_code, argv[1]);
return 1;
}
printf("local address : %s\n", addr);