View previous topic :: View next topic |
Author |
Message |
jinschoi
Joined: 11 Apr 2010 Posts: 5
|
Posted: Sun Apr 11, 2010 1:29 am Post subject: miniupnp with Linksys WRT610N |
|
|
I was trying to debug why miniupnp could not adjust the port forwardings on my Linksys WRT610N. After some playing around with upnpc, I determined that the router only accepts HTTP/1.1, and returns nothing on HTTP/1.0 requests. Changing all HTTP requests to version 1.1 made it work as expected. |
|
Back to top |
|
 |
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1525
|
Posted: Mon Apr 12, 2010 4:20 pm Post subject: |
|
|
Well that's a problem because only HTTP/1.0 is properly implemented in miniupnpc.
In order to support HTTP/1.1, chunked transfert encoding should be implemented. _________________ Main miniUPnP author.
http://miniupnp.tuxfamily.org/ |
|
Back to top |
|
 |
jinschoi
Joined: 11 Apr 2010 Posts: 5
|
Posted: Mon Apr 12, 2010 4:31 pm Post subject: |
|
|
I understand the concern about not "properly" implementing HTTP/1.1, but I would venture a guess that to a first approximation 0% of routers would use chunked transfer encoding. I have no data to support this, though.
Would it be too terrible to retry with HTTP/1.1 after a failed HTTP/1.0 request, and reject any chunked transfer encoding responses? It would be an easy fix, wouldn't break for any routers which work now, and would allow use of miniupnp for Linksys routers, of which there are a great many out there.
I'm not sure whether this problem affects all Linksys routers, or just those with the latest firmware, but even if it were just the latest firmware, it will become more of an issue as it becomes more widespread. We could also ask Linksys to accept HTTP/1.0 going forward. |
|
Back to top |
|
 |
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1525
|
Posted: Mon Apr 12, 2010 4:46 pm Post subject: |
|
|
jinschoi wrote: | I understand the concern about not "properly" implementing HTTP/1.1, but I would venture a guess that to a first approximation 0% of routers would use chunked transfer encoding. I have no data to support this, though.
|
I have data to tell that unfortunately, there is at least one widely spread home router that use Chunked transfer encoding when the HTTP request advertises itself as HTTP/1.1
Billion BiPAC, 7404VNOX, 7404VNPX, 7404VGPX, 7404VGOX and 7401VGP
were reported to have this behaviour  _________________ Main miniUPnP author.
http://miniupnp.tuxfamily.org/ |
|
Back to top |
|
 |
jinschoi
Joined: 11 Apr 2010 Posts: 5
|
Posted: Mon Apr 12, 2010 5:01 pm Post subject: |
|
|
Okay. What about my idea of trying 1.1 only if 1.0 fails? That would be just a few lines of code, and would keep those chunked transfer routers working as well. |
|
Back to top |
|
 |
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1525
|
Posted: Mon Apr 12, 2010 5:12 pm Post subject: |
|
|
jinschoi wrote: | Okay. What about my idea of trying 1.1 only if 1.0 fails? That would be just a few lines of code, and would keep those chunked transfer routers working as well. |
You should try this with you router. (and send me a patch if everything is ok !)
The real "fix" would be to implement chunked transfer encoding, that is on the TODO list... _________________ Main miniUPnP author.
http://miniupnp.tuxfamily.org/ |
|
Back to top |
|
 |
jinschoi
Joined: 11 Apr 2010 Posts: 5
|
Posted: Mon Apr 12, 2010 7:39 pm Post subject: |
|
|
Okay, here's my patch. Tries HTTP/1.0, falls back to HTTP/1.1 if nothing is returned. Works for me, though it has the downside of doubling the number of queries for routers that have this problem. Should have no effect on routers for which it currently works.
Of course, you're right it should do chunked transfer encoding for real, but that's too much work for me right now.... What about using a full featured HTTP library? Would it bulk up the code size too much? |
|
Back to top |
|
 |
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1525
|
|
Back to top |
|
 |
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1525
|
Posted: Mon Apr 12, 2010 8:46 pm Post subject: |
|
|
jinschoi wrote: | Of course, you're right it should do chunked transfer encoding for real, but that's too much work for me right now.... What about using a full featured HTTP library? Would it bulk up the code size too much? |
Avoiding dependencies and having the code as small as possible were the reason why a full featured HTTP library is nos used.
Maybe this should be reconsidered. (well, I'll rather implement chunked transfer encoding
In the meantime, your patch fix the problem ! _________________ Main miniUPnP author.
http://miniupnp.tuxfamily.org/ |
|
Back to top |
|
 |
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1525
|
|
Back to top |
|
 |
jinschoi
Joined: 11 Apr 2010 Posts: 5
|
Posted: Sun Dec 26, 2010 10:35 pm Post subject: |
|
|
I don't know about Bipac, but it no longer works for Cisco/Linksys routers again.
edit: Okay, I've gone back and tried it with hand-generated requests, and old versions of the code, and I've determined that it's fine. Cisco/Linksys routers can apparently only have 32 redirects, and attempts to add more result in a 402 invalid args error. |
|
Back to top |
|
 |
|