[Libwebsockets] Is there a limit on the path size?

Andy Green andy at warmcat.com
Fri Nov 18 22:57:31 CET 2016



On November 19, 2016 3:59:24 AM GMT+08:00, Stephen James <sajames1958 at gmail.com> wrote:
>/speech-to-text/api/v1/recognize?watson-token=2wjkP%2BiLbVPuZM7%2FgZIWHzBgiLl7RSMS3pnvFVeTC%2BeOh0a3eV0tnF73gXlxWGfDRGM8fq%2FUzG9gCIKMuAHJhu2ZpPp3m2Sg44%2FPcibuOfwjkiYhdZ3A3dE%2BFNxEXU%2F14DswB5LwnyF9BaVQs%2BED2cpxUSpVuf77IJ8x5GrqvKuC9r6mKcWu6LaniQkxEdl8EK5%2F5OffgE5YkI8KzZXQR7568wRvXxNLf0JE0s84Je55ZAgAURJTS9rRF3A0O4xL%2Fr8FOm8aqh1czeHIZZj9CFEM3xSZ6788kfHD0retQUxdYJ0fCYFp1WNeVgZ44ilqQQjA3zGIBZSDzO2XnaV1RhAOsTYs111zP7YQJBtkcpW%2FEy2yR2j7DkKR0ZoJnx5Yqqh3EOjpzlCgVDrLBwQeLm6NHwHGz8bmd10hbTnlPFIV8ZDhbyjZb6DPsCHnAR1vzapD69EgSqaMXejliFlin1Y3T4sIakSSzY1uUk2MWgCaAlpNmTB3hyUwBxGD9zRT1zK6aptOVP%2BiL8KF1H%2BOJtrKhlLzNW3MlrUK8rqswFTs0kDgHAAwbb9mSplLxAc%2FqYfq4gYnFXvUYaxyWHH5AfpEHtz2rpuUqlV9pEB%2FWldXRFYWESiRcJOlKcAE%2BRvr%2Fp2BPWGKeW9zZ9FOVBdJG4ac8z%2FObVt%2FiuN288V14vGoquwdssb2uMG9HseCc%2B%2F2C%2F%2BjIkFxWi%2Fb6zVWMKDlrIy1Qi9KHazohI289UGfawVwnRSv8rdIZ7zCNeaDmh%2Bx5B0nXG3D19KdQ6EwYcIHBK3imvmtBo%2BuGkEOJwK8FVEE%2BX%2FOlFnIRsrkh4DtUXpOO%2B0og5X54vr%2BHGL9LicmiHFgSMeL1j%2ByOaISEvwqCTWpIoLJl1IHLr3vk
p8AbSC4MiuXsyVw4Dw9cMta9GgT8FvnxnOApijLqMiGE7wFxjLAJOzkiM6qDw%3D%3D
>
>This path works find on my browser, but I cannot get it to work on test
>client

1) if you're literally using the test client, he doesn't expect such a long path and needs adapting

char path[300];

https://github.com/warmcat/libwebsockets/blob/master/test-server/test-client.c#L411

2) If it's still truncated, you can tune the max header content size limit at context creation time

short max_http_header_data;
	/**< CONTEXT: The max amount of header payload that can be handled
	 * in an http request (unrecognized header payload is dropped) */

in v2.1 this became 4K, but previously it was 1K.

3) In this case the request packet is composed into the service thread's pt buffer, so that also must be larger than the entire header (default 4096), and can also be tuned at context creation time

unsigned int pt_serv_buf_size;
	/**< CONTEXT: 0 = default of 4096.  This buffer is used by
	 * various service related features including file serving, it
	 * defines the max chunk of file that can be sent at once.
	 * At the risk of lws having to buffer failed large sends, it
	 * can be increased to, eg, 128KiB to improve throughput. */

-Andy

>
>------------------------------------------------------------------------
>
>_______________________________________________
>Libwebsockets mailing list
>Libwebsockets at ml.libwebsockets.org
>http://libwebsockets.org/mailman/listinfo/libwebsockets




More information about the Libwebsockets mailing list