From a6b9099e018a9067b5c0ef428463c3e360410b95 Mon Sep 17 00:00:00 2001 From: Ron Pedde Date: Sun, 15 Apr 2007 20:36:00 +0000 Subject: [PATCH] Use S_ISDIR to determine file directoryishness --- src/configfile.c | 2 +- src/upnp.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/configfile.c b/src/configfile.c index d60bb367..6a2df953 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -343,7 +343,7 @@ void config_handler(WS_CONNINFO *pwsc) { /* this is quite broken, but will work */ os_stat(resolved_path,&sb); - if(sb.st_mode & S_IFDIR) { + if(S_ISDIR(sb.st_mode)) { ws_addresponseheader(pwsc,"Location","/index.html"); ws_returnerror(pwsc,302,"Moved"); config_set_status(pwsc,0,NULL); diff --git a/src/upnp.c b/src/upnp.c index 726a5001..3d5cad36 100755 --- a/src/upnp.c +++ b/src/upnp.c @@ -107,7 +107,7 @@ void upnp_build_packet(char *packet, int len, UPNP_PACKETINFO *pi) { port = conf_get_int("general","port",0); - len = upnp_strcat("NOTIFY * HTTP/1.0\r\n",packet,len); + len = upnp_strcat("NOTIFY * HTTP/1.1\r\n",packet,len); if(pi->location) { gethostname(hostname,sizeof(hostname)); snprintf(buffer,sizeof(buffer),"LOCATION: http://%s:%d%s\r\n", @@ -121,7 +121,7 @@ void upnp_build_packet(char *packet, int len, UPNP_PACKETINFO *pi) { len=upnp_strcat("NTS: ssdp:alive\r\n",packet,len); /* USN */ - len=upnp_strcat("USN: uuid:",packet,len); + len=upnp_strcat("USN:uuid:",packet,len); len=upnp_strcat(UPNP_UUID,packet,len); if(pi->usn) { snprintf(buffer,sizeof(buffer),"::%s",pi->usn); @@ -131,9 +131,9 @@ void upnp_build_packet(char *packet, int len, UPNP_PACKETINFO *pi) { len=upnp_strcat("CACHE-CONTROL: max-age=1800\r\n",packet,len); if(pi->nt) { - snprintf(buffer,sizeof(buffer),"NT: %s\r\n",pi->nt); + snprintf(buffer,sizeof(buffer),"NT:%s\r\n",pi->nt); } else { - snprintf(buffer,sizeof(buffer),"NT: uuid:%s\r\n", UPNP_UUID); + snprintf(buffer,sizeof(buffer),"NT:uuid:%s\r\n", UPNP_UUID); } len=upnp_strcat(buffer,packet,len);