miniupnp.tuxfamily.org Forum Index miniupnp.tuxfamily.org
The forum about miniupnp and libnatpmp
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

miniupnp with Linksys WRT610N

 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpc Bugs
View previous topic :: View next topic  
Author Message
jinschoi



Joined: 11 Apr 2010
Posts: 5

PostPosted: Sun Apr 11, 2010 1:29 am    Post subject: miniupnp with Linksys WRT610N Reply with quote

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
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1525

PostPosted: Mon Apr 12, 2010 4:20 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
jinschoi



Joined: 11 Apr 2010
Posts: 5

PostPosted: Mon Apr 12, 2010 4:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1525

PostPosted: Mon Apr 12, 2010 4:46 pm    Post subject: Reply with quote

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 Sad

Billion BiPAC, 7404VNOX, 7404VNPX, 7404VGPX, 7404VGOX and 7401VGP
were reported to have this behaviour Sad
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
jinschoi



Joined: 11 Apr 2010
Posts: 5

PostPosted: Mon Apr 12, 2010 5:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1525

PostPosted: Mon Apr 12, 2010 5:12 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
jinschoi



Joined: 11 Apr 2010
Posts: 5

PostPosted: Mon Apr 12, 2010 7:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1525

PostPosted: Mon Apr 12, 2010 8:43 pm    Post subject: Reply with quote

Thanks a lot for the patch !
miniupnpc-1.4.20100412.tar.gz
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1525

PostPosted: Mon Apr 12, 2010 8:46 pm    Post subject: Reply with quote

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 Smile

In the meantime, your patch fix the problem !
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1525

PostPosted: Sat Dec 11, 2010 6:12 pm    Post subject: Reply with quote

hello, I implemented the chunked transfer encoding.
Could you check if that works properly with the Bipac routers ?

thank you

miniupnpc-1.4.20101209.tar.gz
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
jinschoi



Joined: 11 Apr 2010
Posts: 5

PostPosted: Sun Dec 26, 2010 10:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpc Bugs All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP
© 2007 Thomas Bernard, author of MiniUPNP.