The server returns the correct value and starts listening for new
requests. For some reason, the EOF marker does reach the client ( I
think ). I pasted the output below.
linenr 11 is just before the while loop in get_xpath, linenr 12 is in
the body of the while and linenr 12b is right after the while loop ( 12b
is never reached ).
** Code ***************
## read answer
print "linenr 11\n";
$self->debug ("get_xpath: reading answer");
my $length = 0;
my $line;
while (my $h = sysread (SOCK, $line, 100))
{
print "linenr 12\n" ;
$length += $h;
$load .= $line;
print "line :" . $line . "\n";
}
print "linenr 12b\n";
$load = "" if ($load eq "\x00\n");
shutdown (SOCK, 0);
print "linenr 13\n" ;
if ($length == 0)
{
$self->setError ("Client: The answer for the following message
signals an error.\n$msg");
$load = undef;
}
## $load = undef if (not $load and $load ne "\0");
print "linenr 14\n" ;
$self->debug ("get_xpath: received info: $load");
$self->debug ("all ok");
$self->{USAGE_COUNTER}++;
print "linenr 15\n" ;
$self->_cleanup (@_);
return $load;
** Output ********************
-n Starting OpenCA ...
startDaemon /opt/openca-0.9.2.2/OpenCA/var/log/xml_cache.log
/opt/openca-0.9.2.2/OpenCA/var/tmp/xml_cache.pid
OpenCA::XML::Cache->_init: init of OpenCA::XML::Cache
OpenCA::XML::Cache->_init: general parts ...
OpenCA::XML::Cache->_init: init of OpenCA::XML::Cache completed
OpenCA::XML::Cache->startDaemon
OpenCA::XML::Cache->startDaemon: uaddr:
/opt/openca-0.9.2.2/OpenCA/var/tmp/openca_xml_cache
OpenCA::XML::Cache->startDaemon: maxconn: 20
OpenCA::XML::Cache->startDaemon: anonymous socket initialized
linenr 0
linenr 1
OpenCA::XML::Cache->startDaemon: try to open PIDFILE ...
linenr 3
OpenCA::XML::Cache->IPCLOOP: wait for clients
linenr 4
OpenCA::XML::Cache->startDaemon: PID: 15345
OpenCA::XML::Cache->LOGMESSAGE: startDaemon successfull at Mon Aug 8
08:31:48 2005 UTC PID: 15345<br>
linenr 2
linenr 6
linenr 7
linenr 10
OpenCA::XML::Cache->_init: init of OpenCA::XML::Cache
OpenCA::XML::Cache->_init: general parts ...
OpenCA::XML::Cache->_init: init of OpenCA::XML::Cache completed
OpenCA::XML::Cache->get_xpath: send message:
/opt/openca-0.9.2.2/OpenCA/etc/log.xml<br>
stderr<br>
0<br>
<br>
OpenCA::XML::Cache->connect to socket
/opt/openca-0.9.2.2/OpenCA/var/tmp/openca_xml_cache
OpenCA::XML::Cache->get_xpath: sending message
linenr 11
OpenCA::XML::Cache->get_xpath: reading answer
linenr 5
OpenCA::XML::Cache->IPCLOOP: accepted connection from client
OpenCA::XML::Cache->IPCLOOP: message until now:
/opt/openca-0.9.2.2/OpenCA/etc/log.xml<br>
OpenCA::XML::Cache->IPCLOOP: message until now:
/opt/openca-0.9.2.2/OpenCA/etc/log.xml<br>
stderr<br>
OpenCA::XML::Cache->IPCLOOP: message until now:
/opt/openca-0.9.2.2/OpenCA/etc/log.xml<br>
stderr<br>
0<br>
OpenCA::XML::Cache->IPCLOOP: message received
OpenCA::XML::Cache->IPCLOOP: received message:
/opt/openca-0.9.2.2/OpenCA/etc/log.xml<br>
stderr<br>
0<br>
<br>
OpenCA::XML::Cache->IPCLOOP: xml-file:
/opt/openca-0.9.2.2/OpenCA/etc/log.xml
OpenCA::XML::Cache->IPCLOOP: xpath: stderr
OpenCA::XML::Cache->IPCLOOP: counter: 0
OpenCA::XML::Cache->IPCLOOP: answer:
/opt/openca-0.9.2.2/OpenCA/var/log/stderr.log
OpenCA::XML::Cache->IPCLOOP: write answer to socket
linenr 12
line :/opt/openca-0.9.2.2/OpenCA/var/log/stderr.log
OpenCA::XML::Cache->IPCLOOP: request completed
linenr 3
OpenCA::XML::Cache->IPCLOOP: wait for clients
linenr 4
[EMAIL PROTECTED] wrote:
Hi Peter,
perhaps this mail hangs a little bit because I cannot answer over my
normal system today.
I've been adding debug lines to determine the place where the code
hangs. The precise location is in Cache.pm, function get_xpath, in the
line reading the answer back from the cache server :
while (my $h = read (SOCK, $line, 100))
On this line the script hangs forever. Replacing read with sysread
doesn't fix the problem but makes the code go into the body of the while
once.
This would mean that the socket is open but the server does not answer. So
there are two possibilities:
1. the server crashs
2. the server performs an endless loop
(3. the server hangs)
Do you activated the debugging of the XML cache? Do you see what the
server does?
Michael
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Openca-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openca-users