Ok I spent some more hours on this issue. I can successfully run revisions 1715 to 1731. But with revision 1732 I get the error -19. Revision 1732 contains some changes in slp_network.c (among others). Below you can see how SLPNetworkRecvMessage() (in slp_network.c) behaves in revision 1731 and 1732:

Revision 1732:
- select() on line 237 returns 1
- recvfrom() on line 243 returns -1
- therefore the condition on line 276 is false and SLPNetworkRecvMessage() sets errno to EINVAL and returns -1

Revision 1731:
- select() on line 237 returns 1
- recvfrom() on line 243 returns -1
- but now on line 276 the condition is true since it does not check xferbytes as in revision 1732. SLPNetworkRecvMessage() then continues without causing any errors.

I don't know what the intention of the changes of revision 1732 was. And I don't know if recvfrom() on line 243 should not return -1 to begin with, or if the condition on line 276 in revision 1732 is incorrect. But I think someone should have a closer look at SLPNetworkRecvMessage() again.

Attached you can find my suggested patches based on the latest Mercurial revision. With these patches it works for me.



Am 13.05.2013 09:29, schrieb Robert Hegner:
I also did some more investigation on the second issue (error code -19).

When I use the beta 2 installer, it seems to work (I can register a
service using slptool without getting the -19 error).

Then I stopped slpd and replaced the binaries with the ones I built from
the latest Mercurial revision (cdaeb8) and restarted slpd. Then I got
the -19 error again.

Then I uninstalled OpenSLP, built the installer with the latest
Mercurial revision, and installed it with my own installer again. Also
in this case I get the -19 error.

So for me this looks like I can confirm the problem that Ren described
in January (he suspected that a problem was introduced somewhere between
beta 2 and the current revision).



Am 10.05.2013 13:56, schrieb Robert Hegner:
Hello,

I've been using OpenSLP in my project for a while now. This week I set
up a new computer (Windows 7 64Bit) and I tried to build and run my
application and OpenSLP on this new machine with VC++2010. Even though I
have a 64Bit OS I'm building OpenSLP as a 32Bit application, since my
own application is also 32Bit.

First I tried the latest version from the Mercurial repository (cdaeb8).
I was able to build it and slpd seems to work, since
slptool findsrvs service:service-agent
returns one entry with my IP address. However, when I try this:
slptool register service:myserv.x://myhost.com
(as in the examples of slptool), I get an access violation (Unhandled
exception at 0x00401643 in slptool.exe: 0xC0000005: Access violation
reading location 0x00000000.)

Then I tried an older version (the latest version from the SVN
repository, rev. 1701). I can also build and install slpd, and I can
also find the service-agent. But when I try to register a service using
slptool I get error code -19. As far as I know this indicates a problem
with the communication between slpd and slptool, right? However, slpd
seems to be running (otherwise I wouldn't find the service-agent). So I
guess it is a problem with missing privileges or a firewall problem.
What rules do I need in the Windows Firewall to get OpenSLP to work? (do
I need rules for slpd or slptool?, ingoing or outgoing? which port and
protocol?). Unfortunately I cannot completely disable the firewall for a
test due to group policies, but I can add rules.

Any hints on how to solve or debug at least one of these problems would
be much appreciated!

Cheers,
Robert


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may




------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and
their applications. This 200-page book is written by three acclaimed
leaders in the field. The early access version is available now.
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may


# HG changeset patch
# User Robert Hegner
# Date 1368447091 -7200
#      Mon May 13 14:11:31 2013 +0200
# Node ID 1c4ad51bde30b100bbdb88f44a5e391621ef9019
# Parent  cdaeb8be516512d9b8d12017590543835f459430
Fix access violation in slptool

diff -r cdaeb8be5165 -r 1c4ad51bde30 openslp/slptool/slptool.c
--- a/openslp/slptool/slptool.c Thu Feb 28 18:59:10 2013 -0700
+++ b/openslp/slptool/slptool.c Mon May 13 14:11:31 2013 +0200
@@ -282,7 +282,7 @@
    /* Clear property (if set), otherwise the register function is quite 
useless */
    SLPSetProperty("net.slp.watchRegistrationPID", 0);
 
-   if (*cmdline->scopes != 0)
+   if (cmdline->scopes != 0)
       SLPSetProperty("net.slp.useScopes", cmdline->scopes);
 
    if (SLPOpen(cmdline->lang, SLP_FALSE, &hslp) == SLP_OK)
# HG changeset patch
# User Robert Hegner
# Date 1368447332 -7200
#      Mon May 13 14:15:32 2013 +0200
# Node ID f4e6fb3e560e5a661d132f804bb92ed49b5640a9
# Parent  1c4ad51bde30b100bbdb88f44a5e391621ef9019
Added *.opensdf to .hgignore

diff -r 1c4ad51bde30 -r f4e6fb3e560e .hgignore
--- a/.hgignore Mon May 13 14:11:31 2013 +0200
+++ b/.hgignore Mon May 13 14:15:32 2013 +0200
@@ -55,3 +55,4 @@
 openslp/slptool/slptool
 openslp/stamp-h1
 openslp/ylwrap
+*.opensdf
# HG changeset patch
# User Robert Hegner
# Date 1368447480 -7200
#      Mon May 13 14:18:00 2013 +0200
# Node ID 1f466d0189c3e921a55730ab64244e26785c063b
# Parent  f4e6fb3e560e5a661d132f804bb92ed49b5640a9
Fix -19 error introduced with revision 1732. Not sure if 
SLPNetworkRecvMessage() is implemented correctly now.

diff -r f4e6fb3e560e -r 1f466d0189c3 openslp/common/slp_network.c
--- a/openslp/common/slp_network.c      Mon May 13 14:15:32 2013 +0200
+++ b/openslp/common/slp_network.c      Mon May 13 14:18:00 2013 +0200
@@ -295,7 +295,7 @@
    }
 
    /* Now check the version and read the rest of the message. */
-   if (xferbytes >= 5 && (*peek == 1 || *peek == 2))
+   if (*peek == 1 || *peek == 2)
    {
       /* Allocate the receive buffer as large as necessary. */
       recvlen = PEEK_LENGTH(peek);
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Openslp-users mailing list
Openslp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openslp-users

Reply via email to