View previous topic :: View next topic |
Author |
Message |
Rick
Joined: 10 Dec 2008 Posts: 10
|
Posted: Sat Dec 20, 2008 2:36 pm Post subject: |
|
|
POST /wipc_cont HTTP/1.1
HOST: 192.168.1.1:80
CONTENT-LENGTH: 296
CONTENT-TYPE: text/xml; charset="utf-8"
SOAPACTION: "urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress"
<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:GetExternalIPAddress xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1">
</u:GetExternalIPAddress>
</s:Body>
</s:Envelope>
this for example works, miniupnpc's version doesn't. - still trying to actually get it to do a portforwarding though.
I really think now that it's the line feed/carriage returns breaking some compatiblity - without the return+newline aftert <s:Body> the request won't work, for example.
Just noticed in the protocols that svchost also managed to fetch a port for itself via the following:
Code: |
<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:AddPortMapping xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1">
<NewRemoteHost></NewRemoteHost>
<NewExternalPort>61907</NewExternalPort>
<NewProtocol>UDP</NewProtocol>
<NewInternalPort>4704</NewInternalPort>
<NewInternalClient>192.168.1.57</NewInternalClient>
<NewEnabled>1</NewEnabled>
<NewPortMappingDescription>svchost (192.168.1.57:4704) 61907 UDP</NewPortMappingDescription>
<NewLeaseDuration>0</NewLeaseDuration>
</u:AddPortMapping>
</s:Body>
</s:Envelope>
|
|
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1589
|
Posted: Sat Dec 20, 2008 3:17 pm Post subject: |
|
|
XML indentation should not have any consequence but well... maybe it has some with your router. _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1589
|
Posted: Sat Dec 20, 2008 3:23 pm Post subject: |
|
|
Let's try with this patch which add CR-LF almost everywhere
Code: | --- miniupnpc.c 18 Dec 2008 17:46:36 -0000 1.57
+++ miniupnpc.c 20 Dec 2008 15:21:46 -0000
@@ -157,10 +157,15 @@
"<" SOAPPREFIX ":Envelope "
"xmlns:" SOAPPREFIX "=\"http://schemas.xmlsoap.org/soap/envelope/\" "
SOAPPREFIX ":encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">"
+ "\r\n"
"<" SOAPPREFIX ":Body>"
+ "\r\n"
"<" SERVICEPREFIX ":%s xmlns:" SERVICEPREFIX "=\"%s\">"
+ "\r\n"
"</" SERVICEPREFIX ":%s>"
- "</" SOAPPREFIX ":Body></" SOAPPREFIX ":Envelope>"
+ "\r\n"
+ "</" SOAPPREFIX ":Body>\r\n"
+ "</" SOAPPREFIX ":Envelope>"
"\r\n", action, service, action);
}
else
@@ -173,8 +178,10 @@
"<" SOAPPREFIX ":Envelope "
"xmlns:" SOAPPREFIX "=\"http://schemas.xmlsoap.org/soap/envelope/\" "
SOAPPREFIX ":encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">"
+ "\r\n"
"<" SOAPPREFIX ":Body>"
- "<" SERVICEPREFIX ":%s xmlns:" SERVICEPREFIX "=\"%s\">",
+ "\r\n"
+ "<" SERVICEPREFIX ":%s xmlns:" SERVICEPREFIX "=\"%s\">\r\n",
action, service);
p = soapbody + soapbodylen;
while(args->elt)
@@ -202,6 +209,8 @@
while(*pe)
*(p++) = *(pe++);
*(p++) = '>';
+ *(p++) = '\r';
+ *(p++) = '\n';
args++;
}
*(p++) = '<';
@@ -211,7 +220,7 @@
pe = action;
while(*pe)
*(p++) = *(pe++);
- strncpy(p, "></" SOAPPREFIX ":Body></" SOAPPREFIX ":Envelope>\r\n",
+ strncpy(p, ">\r\n</" SOAPPREFIX ":Body>\r\n</" SOAPPREFIX ":Envelope>\r\n",
soapbody + sizeof(soapbody) - p);
}
if(!parseURL(url, hostname, &port, &path)) return -1;
|
_________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1589
|
Posted: Sat Dec 20, 2008 3:26 pm Post subject: |
|
|
I'm thinking about something :
maybe you should try to remove Code: | "<?xml version=\"1.0\"?>\r\n" | from miniupnpc.c ... i noticed this difference also _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
Rick
Joined: 10 Dec 2008 Posts: 10
|
Posted: Sat Dec 20, 2008 4:19 pm Post subject: |
|
|
oh, I think that's just due to me being incompetent when copy/pasting the packets, the version string is always there. |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1589
|
Posted: Sun Dec 21, 2008 7:18 pm Post subject: |
|
|
Rick wrote: | oh, I think that's just due to me being incompetent when copy/pasting the packets, the version string is always there. |
just remove it from the sources !
you should also send me an email so I can email you sources packages _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
© 2007 Thomas Bernard, author of MiniUPNP.
|