Koen, your patch doesn't work at all.
Web server (apache) is not responding.
However, I've managed to fix this bug.
Patch is in the attachment.
Shared process binds sockets to files named server-<PID>.
I've noticed that for example for PID 12345 file is named server-1234
(last symbol skipped).
Thus if Wt applications that are being run in series, they try to bind
to same socket file (90% of time).
It seems that in FreeBSD (maybe in some other OS as well) socklen MUST
include trailing '\0'.
Koen Deforche wrote:
Hey Andrii,
2009/5/5 Andrii Arsirii <[email protected]>:
Guys, does anyone has the subj. working?
On my setup it starts refreshing all the time with new wt ID in URL.
Reproduced in 2.1.5 and 2.2.3
OS: FreeBSD 7.1
Thanks for the report. It seems that indeed the bind() with sun_path
code might not be entirely portable.
Perhaps the following might work better (we are going to make a
virtual machine for BSD, so I cannot confirm it yet), and in any case,
it will print the exact path which is bound:
local.sun_family = AF_LOCAL;
strncpy (local.sun_path, socketPath.c_str(), sizeof (local.sun_path));
local.sun_path[sizeof (local.sun_path) - 1] = '\0';
unlink(local.sun_path);
std::cerr << getpid() << ": " << local.sun_path << std::endl;
socklen_t len = (offsetof (struct sockaddr_un, sun_path) + strlen
(local.sun_path) + 1);
Then I investigated sources and saw that log output doesn't correspond to
what is actually done (see patch wrong_debug_msg.diff attached).
After application of patch it's seen that problem happens on bind()
invocation,
Woops... But this is apparently already fixed in my 2.99 git tree.
How can it be that bind() fails? It seems there are some race conditions....
Can you see if the change works for you ?
Regards,
koen
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest
--
Andrii Arsirii
Streamco
http://streamco.org.ua
Index: src/fcgi/Server.C
===================================================================
--- src/fcgi/Server.C (revision 174)
+++ src/fcgi/Server.C (working copy)
@@ -257,7 +257,7 @@
struct sockaddr_un local;
local.sun_family = AF_UNIX;
strcpy(local.sun_path, socketPath.c_str());
- socklen_t len = strlen(local.sun_path) + sizeof(local.sun_family);
+ socklen_t len = strlen(local.sun_path) + sizeof(local.sun_family) + 1;
int tries = 0;
for (tries = 0; tries < maxTries; ++tries) {
@@ -590,7 +590,7 @@
local.sun_family = AF_UNIX;
strcpy(local.sun_path, socketPath.c_str());
unlink(local.sun_path);
- socklen_t len = strlen(local.sun_path) + sizeof(local.sun_family);
+ socklen_t len = strlen(local.sun_path) + sizeof(local.sun_family) + 1;
if (bind(s, (struct sockaddr *)& local, len) == -1) {
conf.log("fatal") << "bind(): " << strerror(errno);
@@ -651,10 +651,10 @@
local.sun_family = AF_UNIX;
strcpy(local.sun_path, socketPath.c_str());
unlink(local.sun_path);
- socklen_t len = strlen(local.sun_path) + sizeof(local.sun_family);
+ socklen_t len = strlen(local.sun_path) + sizeof(local.sun_family) + 1;
if (bind(s, (struct sockaddr *)& local, len) == -1) {
- conf.log("fatal") << "socket(): " << strerror(errno);
+ conf.log("fatal") << "bind(): " << strerror(errno);
exit(1);
}
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest