On Sat, Oct 31, 2009 at 11:12 AM, Koushik Narayanan <firstname.lastname@example.org> wrote:
Ok. But that would mean having an erl file generated at the deployment machine and compiled there. Though the erlang installations have both the compiler and the runtime installed, generally it wouldn't be required to have a compiler at a deployment machine.
Why does it have to be generated at the deployment host? A beam file is a beam file; it can be generated anywhere and run anywhere.You don't really need a separate compiler, BTW, given that the compile module is always available by default in Erlang/OTP unless you take it out. If you're changing mime.types, you can generate a new one from an erlang shell by calling mime_type_c:compile(), assuming the yaws ebin directory is in the erlang code path and your working directory is where mime.types resides. This will generate a new mime_types.erl source module. You can then compile that either using the c(mime_types) erl shell command, which will also load it for you, or by calling compile:file("mime_types") and then using the code module to load the object code. Either way, doing this from a shell script is quite easy. Also, this can all be done via a remsh to a running yaws instance, in which case generating and compiling the new mime_types module will load it right into your running web server.
Also, you might want to consider updating to 1.85, as I did a huge update on the MIME types recently, adding quite a few in the process. Perhaps with this newer version, the need to reload mime types will be greatly reduced or even eliminated for you.
I am stuck at 1.77 because, I am having problems in using the OTP http module to fetch data from yaws asynchronously in yaws versions greater than 1.77. And also I feel its not required to have a comprehensive list of all possible mime types at all deployments. Depending on the application specifying what is required would be better imho.I guess I disagree. MIME types are registered with the IANA and are thus globally standardized and widely known. There's really no reason to subset them unless you're running in an embedded environment with memory limitations so severe that it takes too much space to hold MIME type definitions you'll never use.
When you say you have problems fetching data asynchronously via the OTP http module, I assume you're talking about the client side, so how can that be a yaws problem? Assuming the responses from yaws conform to RFC 2616, which I think is safe to assume otherwise we'd be getting all kinds of bug reports, the problem would seem to be in the client. Have you considered using the ibrowse client instead? There are a few known bugs in the httpc module.
My overall advice is to 1) determine why your client has an issue, and fix that so you can move off 1.77 to a more recent yaws, and 2) to deploy a much more complete set of MIME types such as that found in 1.85, such that your sysadmins do not need to generate anything. If you need help fixing the client issue, please send the details of the problems you're seeing to this list, and we'll try to help as much as we can.