[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
SOCKET handling and Netscape SDK bug(?)
Howdy!
Two problems/questions, the first one is about SOCKET handling in
openLDAP (daemon.c code), the second one is about a possible bug in
Netscape SDK4.0.
1.
I tried to connect my Lotus Notes client to my LDAP server
(openLdap2.0-alpha3 on NT). Sometimes the communication works great,
binding, searching etc. BUT sometimes the server shuts down becourse the
main listener select-function returns error code 10038. I have not
gotten this error when connection/working with other clients.
I.e. socket handling in select-function in thread function
"slapd_daemon_task(...)" in daemon.c
returns SOCKET_ERROR and when I check the exact error with sock_errno()
or WSAGetLastError() I get error: 10038, WSAENOTSOCK.
//-----------------------
switch(ns = select( nfds, &readfds,
#ifdef HAVE_WINSOCK
/* don't pass empty fd_set */
( writefds.fd_count > 0 ? &writefds : NULL ),
#else
&writefds,
#endif
NULL, tvp ))
{
case SOCKET_ERROR: // SOCKET_ERROR is -1
{ /* failure - try again */
int err=sock_errno();
int wsaErr=WSAGetLastError(); // <---- checking for detailed
error code
printf("WSAGetLastError return error code: %i\n",wsaErr);
#ifdef _DAEMON_DUMP_
printf("switch -1\n");
#endif
if(err==EBADF&&++ebadf<SLAPD_EBADF_LIMIT)
{
continue;
}
if( err != EINTR )
{
Debug( LDAP_DEBUG_CONNS,
"daemon: select failed (%d): %s\n",
err, sock_errstr(err), 0 );
slapd_shutdown = -1; // slapd is shutting down
}
}
continue;
//----------------------------------
I got a suggestion from a collegue that this could be becourse the
select function is reading from the "tail" of the last socket and return
error becourse of this. I have problems believing this but....
Any suggestions?
2.
I added the propriate root DSE attributes to "root_dse_info(...)"
function and when debugging(VC6) everything looks great.
I then tried to get the rootDSE entry using Netscape SDK 4.0 client
package (the example in chapter 11, page 3 of NSSDK3.0 manual) BUT it
only received the last attributetype from the entry ("objectclass"
values). The received entry didnt not contain the "namingContext"
attribute or the schema attribute.
Has anyone else tried this?
Could it be a bug in Netscape SDK ?
Sorry about the piece of code included, I'm really greatful for any help
or suggestions.
--
sincerely
Mikael Grehn
M.Sc
Systems Engineer
Envilogg Datateknik AB