Project

General

Profile

Actions

Feature #3041

closed

mod_wstunnel disconnect TCP connection with backend when if WebSocket communication continues and total size of all packet exceeds server.max-request-size without 0.

Added by imanishi over 3 years ago. Updated over 3 years ago.

Status:
Invalid
Priority:
Low
Category:
mod_wstunnel
Target version:
-
ASK QUESTIONS IN Forums:
No

Description

mod_wstunnel disconnect TCP connection with backend when if WebSocket communication continues and total size of all packet exceeds server.max-request-size without 0.
In our environment while about 10 minutes of WebSocket communication with server.max-request-size=516, the following error message appears.

(connections-glue.c.273) request-size too long: 528386 -> 413

When I reverse the following changes and change it to call chunkqueue_reset() after forwarding to backend, I've confirmed that the problem is no longer occurring.
Because in mod_wstunnel you get long connection and continuously TCP packets.

https://github.com/lighttpd/lighttpd1.4/commit/513e407b064ea169241e019e5b9d92d5d905a856#diff-77f56e8215851290655c9ad9643cd9718ef96dbfd41ed750bb3aa4ed368e2510L1342

I attached the patch. Would you merge the patch?


Files

mod_wstunnel.c.patch (852 Bytes) mod_wstunnel.c.patch imanishi, 2020-11-17 10:42
Actions #1

Updated by gstrauss over 3 years ago

  • Tracker changed from Bug to Feature
  • Status changed from New to Need Feedback
  • Priority changed from Normal to Low
  • Target version deleted (1.4.56)

This is not a bug, since server.max-request-size is operating as advertised.

It appears that you are suggesting that request size limit should not apply to websocket requests. It is reasonable that you desire that behavior. Is it the right behavior for everyone?

The patch you have proposed is incorrect for other reasons, such as logging and accounting, not to mention that part of your patch deletes the comment
/*(not chunkqueue_reset(); do not reset cq->bytes_in, cq->bytes_out)*/
and calls chunkqueue_reset() Did you really think the comment you deleted had no meaning?

A simpler patch would have set the configuration to disable the limit for the wstunnel request. (r->conf.max_request_size = 0;)

However, the lighttpd default server.max-request-size = 0 does not enforce a limit.

If you have configured a limit in your lighttpd configuration, then you have the option of creating a condition in lighttpd.conf to apply the limit to the scripts to which it should apply, or you can set server.max-request-size = 0 in a condition that matches what is handled by websockets.

$HTTP["url"] =~ "^/ws/" {
    server.max-request-size = 0
    wstunnel.server = ("" => ... )
}

The current lighttpd behavior allows a user to configure server.max-request-size for wstunnel connections.
lighttpd configuration allows either behavior to be specified (limit or no limit), so why should lighttpd change?
Why is the behavior you are suggesting the correct behavior for everyone, and why is the current lighttpd behavior incorrect?

Actions #2

Updated by imanishi over 3 years ago

Thank you for the kindly response.
I understand illegal my lighttpd configuration.

Actions #3

Updated by gstrauss over 3 years ago

  • Status changed from Need Feedback to Invalid
Actions

Also available in: Atom