Change requests and bug reports

Frank Fock Frank.Fock____t-online.de
Sun Nov 12 13:04:10 CET 2000


helge.fredriksen____4tel.no wrote:

> 1) Would it be possible to add a method to get access to the protected snmp
> socket variable iv_snmp_session found in snmp_pp.h? We need this to be able
> to close this socket after
> making a fork/exec call.
>

Yes, there is already such a function in class Snmpx of AGENT++:
 /**
  * Return the socket descriptor of the socket used for
  * incoming SNMP request. This is the socket the select()
  * of the receive method listens on. This socket descriptor
  * may be used to be included in other select controlled
  * polling loops.
  *
  * @return
  *    a socket descriptor.
  */
#ifdef WIN32
 unsigned long get_session_fds() { return iv_snmp_session; }
#else
        SNMPHANDLE get_session_fds() { return iv_snmp_session; }
#endif

It has been added here instead of SNMP++, because of
compatibility reasons with other SNMP++ versions.

>
> Errors on NT:
>
> 1) The previously reported bug about deserializing rows with large indexes
> now seems to be working on the solaris system. However, on the NT platform,
> we have bigger problems than before. Now not even a small number on the
> index works, even if it did previously. Debugging in Visual Studio, there
> seems to be a couple of bytes missing when deserializing from file is
> attempted. Could you have a look into this?
>

Yes, it was a bug (a weired one). The default file open mode on
NT seems to be text, but it should be binary. Do the following changes
in mib_context.cpp and it will work correctly:

void MibGroup::load_from_file(const char* fname)
{
 FILE *f;
 char *buf;
 int  size, bytes;
 char header[16];

 if ((f = fopen(fname, "rb")) == 0) // <---- add the b
  return;
...

and

void MibGroup::save_to_file(const char* fname)
{
 FILE *f;
 char *buf = 0;
 int bytes = 0;

 if ((f = fopen(fname, "wb")) == 0) {  // <---- add the b
  return;
 }


>
> 2) In the snmp++ function saveBootCounter, we experience that the statement
>
> rename(tmpFileName, fileName)
>
> is not sufficient. One have to delete the old file first. Please say
>
> #ifdef WIN32
>         _unlink(fileName);
> #endif
>

Will be fixed with the next update.
Thanks for reporting!

Best regards,
Frank

--
Frank Fock - AGENT++
Email: frank____fock.de
Fax: +49 7195 177108





More information about the AGENTPP mailing list