Erlang/OTP Forums

Author Message

<  Yaws mailing list  ~  configurable yaws timeout

Guest
Posted: Wed Oct 07, 2009 10:19 am Reply with quote
Guest
Hi Everyone,

We have a requirement to make yaws' timeout configurable in order to
have it play nicely with the rest of the components in our system.

It seems that the timeout is hard coded via macro in yaws.hrl

I added a read_timeout to gconf, and then referred to it in the
yaws:do_recv(Sock, Num, nossl) via the process dictionary.

I don't know if it would be of general use, but it serves our purposes.

Regards,

Bruce


--- ./yaws-1.84/include/yaws.hrl.orig 2009-07-06 03:20:13.000000000 +0900
+++ ./yaws-1.84/include/yaws.hrl 2009-10-07 15:21:50.000000000 +0900
@@ -77,6 +77,8 @@
max_num_cached_files = 400,
max_num_cached_bytes = 1000000, %% 1 MEG
max_size_cached_file = 8000,
+ read_timeout = 30000, %% configurable ?READ_TIMEOUT
large_file_chunk_size = 10240,
mnesia_dir = [],
log_wrap_size = 10000000, % wrap logs after 10M


-- ./yaws-1.84/src/yaws.erl.orig 2009-07-06 03:20:13.000000000 +0900
+++ ./yaws-1.84/src/yaws.erl 2009-10-07 15:25:20.000000000 +0900
@@ -1707,9 +1707,9 @@


do_recv(Sock, Num, nossl) ->
- gen_tcp:recv(Sock, Num, ?READ_TIMEOUT);
+ gen_tcp:recv(Sock, Num, (get(gc))#gconf.read_timeout);
do_recv(Sock, Num, ssl) ->
- ssl:recv(Sock, Num, ?READ_TIMEOUT).
+ ssl:recv(Sock, Num, (get(gc))#gconf.read_timeout).


cli_recv(S, Num, SslBool) ->



Post received from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

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
You can attach files in this forum
You can download files in this forum