-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/rework wserver (Issue 1133) #1164
Conversation
Better handling of sexcolor in menubar (avoids failure when no spouse)
AS_OK: handle pedigree collapse when sosa_filter=on
Invert params in aa is_substr baaccc; add 'in' as equivalent to 'is_ubstr'
Synchro 17 mai
On my Mac, tested in server and CGI mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR. I only had a quick look for now but this seems to be good work.
Here is my first (quick) review.
@@ -912,7 +916,6 @@ let treat_request = | |||
#endif | |||
| _ -> incorrect_request | |||
end conf base ; | |||
Output.flush conf ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is wrong with flushing here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not remove all the flushes in the code (several places). Output.flush does nothing more (see gwd.ml line 17). Cleaning will have to be done later. Only gwd and wserver can flush and close connections.
loop_write 0 | ||
end; | ||
loop () | ||
exit 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need explicit exit 0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not modify the original code on this point.
We are in the child process (pid = 0).
exit 0 allows not return to the infinite loop of server (line 641 WServer)
therefore necessary
exit 0 | ||
with | ||
| Unix.Unix_error (Unix.ECONNRESET, _, _) | ||
| Unix.Unix_error (Unix.ECONNABORTED, _, _) -> Unix.close t; exit 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question: do we need exit 0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same response (necessary)
loop () | ||
with Unix.Unix_error (Unix.ECONNRESET, _, _) -> () | ||
|
||
let close_connection () = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is wrong with this, and why is shutdown_noerr
better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
close_connection did several things
skip_possible_remaining_chars was a useless function that only read empty stream (caused unnecessary waiting time) . only a shutdown / close sequence is needed
in plugins/export/plugin_export.ml |
end | ||
else geneweb_server () | ||
|
||
let () = | ||
#ifdef DEBUG | ||
Printexc.record_backtrace true; | ||
Sys.enable_runtime_warnings false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean true? I picked (and corrected) these two lines here : 53d561e
A lot of things is done in gwdLog. Wouldn't this to commits be good enough? I prefer adding as less code as possible in the core of geneweb.
|
Bonjour. Pas encore testé les logs mais : (rah mauvaise manip)
|
Quant au log j'ai le même problème signalé à Titifix hier à savoir que je
n'arrive plus à avoir la sortie en console (comportement par défaut à
l'époque) :
* `-log stderr` écrit un fichier `stderr` ;
* `-log 2` écrit un fichier `2` ET un fichier `stderr`.
Titifix a fait un commit ce matin pour ça sur sa PR je n'ai pas encore
testé vu que j'étais revenu tester le master
TitiFix@811dc10
Le ven. 28 mai 2021 à 15:42, Julien Sagot ***@***.***> a
écrit :
… A lot of things is done in gwdLog. Wouldn't this to commits be good
enough? I prefer adding as less code as possible in the core of geneweb.
e01ccd4 gwd: log to stderr as default instead of gwd.syslog file
f177589 Made syslog optionnal (not enabled by default).
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1164 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACO7ZZ3O3MGJ5WEZF2ERPBDTP6MTVANCNFSM45NTHA3Q>
.
|
|
Thanks, |
Commits 25 et 28 mai
PR retirée. |
Les principaux correctifs on été integrés à la main, mais il reste pas mal de choses à voir sur cette PR. |
Fix/rework wserver/gwd/gwsetup for Windows from commit a6d35c7
(Unix specific functions are isolated to preserve fork operation)
Solved Issues :
Summary :
-- HTTP exchanges is now HTTP/1.1 as well as CGI exchanges (CGI/1.1)
-- wserver is the master of the connections: Flush and close must not be done outside of wserver.
-- Mutil.bench now use stderr (sdtout is reserved for CGI mode)
-- The launch of a 2nd Geneweb server on the same port is now refused
-- HTTP status 404 now generated on missing file if requested file is not present.
-- HTTP status 405 (Not allowed) for unsupported methods (PUT, HEAD, etc ...).
-- add missing HTTP header for the index page in request.ml and HTTP 404 when unknown basename
-- replacement charset = iso-8859-1 by utf-8 in the response headers (not uniform everywhere).
-- Fixed mime types, some were wrong / obsolete (font, etc ...)
-- the -cgi option to force CGI mode is no longer needed (remains for test purposes). CGI mode now depends on the presence of the GATEWAY_INTERFACE env. variable defined by the CGI RFC.
-- General files (.js, .css, ...) are now in public cache; Personal images are in private cache
-- Always close HTTP connection (HTTP close header)
css/bootstrap.min.css.map
js/bootstrap.bundle.min.js.map
etc/webfonts/fa-regular-400.eot (need only for IE)
etc/webfonts/fa-solid-900.eot (need only for IE)
etc/webfonts/fa-brands-400.eot (need only for IE)
etc/favicon.ico
etc/apple-touch-icon-precomposed.png
Test environnement : 64 bits
OS :
Browsers :
Network trafic : check with Wireshark.