View previous topic :: View next topic |
Author |
Message |
twear
Joined: 01 Nov 2012 Posts: 80
|
Posted: Tue Jun 04, 2013 8:47 pm Post subject: SetDefaultConnectionService |
|
|
In the certification test the send an invalid request:
Code: | <?xml version="1.0" encoding="utf-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><u:SetDefaultConnectionService xmlns:u="urn:schemas-upnp-org:service:Layer3Forwarding:1"><NewDefaultConnectionService>uuid:e3c41abc-5951-4924-a650-b49ded3450dc:WANConnectionDevice:1,INVALID_SERVICE_ID</NewDefaultConnectionService></u:SetDefaultConnectionService></s:Body></s:Envelope> |
and MiniUPnPd responds incorrectly with:
Code: | <?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:SetDefaultConnectionServiceResponse xmlns:u="urn:schemas-upnp-org:service:Layer3Forwarding:1"></u:SetDefaultConnectionServiceResponse></s:Body></s:Envelope>
|
Im not exactly sure what the response should be.... |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1589
|
Posted: Wed Jun 05, 2013 9:03 am Post subject: |
|
|
I guess it should responds with the error 721 InvalidServiceID _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1589
|
|
Back to top |
|
|
twear
Joined: 01 Nov 2012 Posts: 80
|
Posted: Wed Jun 05, 2013 6:12 pm Post subject: |
|
|
it's not working.
What are you expecting "service" to be. And why are you comparing it to "SERVICE_ID_WANIPC", shouldn't it be layer3forwarding? |
|
Back to top |
|
|
twear
Joined: 01 Nov 2012 Posts: 80
|
Posted: Wed Jun 05, 2013 6:29 pm Post subject: |
|
|
is there any easy way to add debug statements in so I can help you out? |
|
Back to top |
|
|
twear
Joined: 01 Nov 2012 Posts: 80
|
Posted: Wed Jun 05, 2013 8:50 pm Post subject: |
|
|
so it looks like a parsing error to me:
sent -uuid:e3c41abc-5951-4924-a650-b49ded3450dc:WANConnectionDevice:1,INVALID_SERVICE_ID
the first value from data is parsed and becomes:
uuid:e3c41abc-5951-4924-a650-b49ded3450dc:WANConnectionDevice:1
So it looks like you are actually parsing it to well... ha. but i took a look at the parser and I'm lost in your code, so hopefully you can figure it out |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1589
|
Posted: Wed Jun 05, 2013 11:25 pm Post subject: |
|
|
twear wrote: | it's not working.
What are you expecting "service" to be. And why are you comparing it to "SERVICE_ID_WANIPC", shouldn't it be layer3forwarding? |
what do you mean it's not working ? it does not respond the error 721 InvalidServiceID ?
The connection service id is not layer3forwarding, but the IPConnection service :
#define SERVICE_ID_WANIPC "urn:upnp-org:serviceId:WANIPConn1" _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Last edited by miniupnp on Wed Jun 05, 2013 11:33 pm; edited 1 time in total |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1589
|
Posted: Wed Jun 05, 2013 11:32 pm Post subject: |
|
|
twear wrote: | so it looks like a parsing error to me:
sent -uuid:e3c41abc-5951-4924-a650-b49ded3450dc:WANConnectionDevice:1,INVALID_SERVICE_ID
the first value from data is parsed and becomes:
uuid:e3c41abc-5951-4924-a650-b49ded3450dc:WANConnectionDevice:1
So it looks like you are actually parsing it to well... ha. but i took a look at the parser and I'm lost in your code, so hopefully you can figure it out |
Where do you see a parsing error ? _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1589
|
Posted: Wed Jun 05, 2013 11:35 pm Post subject: |
|
|
twear wrote: | is there any easy way to add debug statements in so I can help you out? |
Code: | syslog(LOG_DEBUG, "blah : %s", string); |
_________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
twear
Joined: 01 Nov 2012 Posts: 80
|
Posted: Thu Jun 06, 2013 5:02 am Post subject: |
|
|
miniupnp wrote: | twear wrote: | so it looks like a parsing error to me:
sent -uuid:e3c41abc-5951-4924-a650-b49ded3450dc:WANConnectionDevice:1,INVALID_SERVICE_ID
the first value from data is parsed and becomes:
uuid:e3c41abc-5951-4924-a650-b49ded3450dc:WANConnectionDevice:1
So it looks like you are actually parsing it to well... ha. but i took a look at the parser and I'm lost in your code, so hopefully you can figure it out |
Where do you see a parsing error ? |
so through debugging and everything I got to this point, your other comments were spot on.
But the 721 response is never sent, your code is never hit because the "service" come out to be NULL. I put some prints in it to check. So the parsing error that I was talking about comes down to the fact that when you create "service" from "p" that p didn't have the ",INVALID_SERVICE_ID" in it which results in service being NULL. So my conclusion is there is something wrong with how you are parsing out "p"
hope that helps |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1589
|
Posted: Thu Jun 06, 2013 12:17 pm Post subject: |
|
|
twear wrote: |
But the 721 response is never sent, your code is never hit because the "service" come out to be NULL. |
Please read again the code if service == NULL, the 721 error should be sent :
Code: |
} else if(service == NULL || 0 != strcmp(service+1, SERVICE_ID_WANIPC)) {
SoapError(h, 721, "InvalidServiceID");
} else |
_________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
twear
Joined: 01 Nov 2012 Posts: 80
|
Posted: Thu Jun 06, 2013 5:37 pm Post subject: |
|
|
it's always null though, so it's not even passing the other cases |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1589
|
Posted: Thu Jun 06, 2013 8:31 pm Post subject: |
|
|
that is strange because the parsing doesn't do anything special...
just before the line
ParseNameValue(h->req_buf + h->req_contentoff, h->req_contentlen, &data);
add :
syslog(LOG_DEBUG, "%.*s", h->req_contentlen, h->req_buf + h->req_contentoff)
So you will see exaclty what is parsed... _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
twear
Joined: 01 Nov 2012 Posts: 80
|
Posted: Thu Jun 06, 2013 8:58 pm Post subject: |
|
|
So after skipping the first test case this does succeed on for the invalid test case, but it returns the same response no matter what. 721
I believe that this is due to the value of "p", which is always "uuid:c6c05a33-f704-48df-9910-e099b3471d81:WANConnectionDevice:1" so when you do strchr(p, ',') the return would always be NULL since ',' is never present.
shouldn't p be "uuid:c6c05a33-f704-48df-9910-e099b3471d81:WANConnectionDevice:1,INVALID_SERVICE_ID" in the invalid case? |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1589
|
Posted: Thu Jun 06, 2013 9:00 pm Post subject: |
|
|
twear wrote: | shouldn't p be "uuid:c6c05a33-f704-48df-9910-e099b3471d81:WANConnectionDevice:1,INVALID_SERVICE_ID" in the invalid case? |
Please check the XML string as asked before so we can know if something is wrong with the request, or with the parsing... _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
|