partysip-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Partysip-dev] loggin problem in win32


From: Donovan Bruce
Subject: Re: [Partysip-dev] loggin problem in win32
Date: Wed, 29 Jan 2003 11:41:20 -0700

I think there is an easier way without wholesale changes
to osip. Here is what I had to do to make file logging work for me
(my environment is Windows NT). The changes below also eliminated
what I consider to be a nuisance logging of data when there
is no input traffic.

The following changes were applied to libosip-0.9.3:
(look for the initials DAB or /* DAB */to see my changes)

1) modify  port_misc.c and port.h from oSIP-0.9.0/libosip-0.x.x/parser and 
   oSIP-0.9.0/libosip-0.x.x/osip respectively as follows:
   
   
Port_misc.c mod:
----------------   
   
#if defined(HAVE_STDARG_H) || defined(__VXWORKS_OS__) || defined(WIN32) ||
defined(_WIN32_WCE)
osip_trace (char *fi, int li, trace_level_t level, FILE * fp/* f becomes fp DAB 
*/, char
*chfr, ...)
#else
osip_trace (fi, li, level, fp/* f becomes fp DAB */, chfr, va_list)
     char *fi;
     char *li;
     int level;
     FILE *fp/* f becomes fp DAB */;
     char *chfr
#endif
     {
       va_list ap;
           FILE *f /* new f DAB */;

#ifdef ENABLE_TRACE

#if !defined(WIN32) && !defined(SYSTEM_LOGGER_ENABLED)
       if (logfile == NULL)
         {                      /* user did not initialize logger.. */
           return 1;
         }
#endif

       if (fp == NULL) /* f becomes fp DAB */
                   f = logfile==NULL ? stdout : logfile; /* DAB */
           else  /* DAB */
           f = fp; /* DAB */

 
 
port.h mod:
----------   
   int
#if defined(HAVE_STDARG_H) || defined(WIN32) || defined(__VXWORKS_OS__)
   
    osip_trace (char *fi, int li, trace_level_t level, FILE * fp/* f becomes fp 
DAB */,
char *chfr,
                ...);
#else
/* ERROR? I never tested this */
    osip_trace (fi, li, level, fp/* f becomes fp DAB */, chfr, va_list);
#endif
  
2) modify  file:  libosip-0.x.x/fsm/port_fifo.c to :

void *
fifo_tryget (fifo_t * ff)
{
  void *el;
  int rc; /* DAB */
#ifdef OSIP_MT
  if (0 > (rc = ssem_trywait (ff->qisempty)) || rc==EBUSY /* DAB */)
    {                           /* no elements... */
      return NULL;
    }    
  
  
  /******************************************************
  This step 2) change eliminates the printing of a nusiance
  message when there is no input traffic to process. !!!
  ******************************************************/

  /********************************************************************
  And this is what I had to do to VC++ to ensure correct logging 
  operation for our mutithreaded app.
  /********************************************************************
  
3)  set vc++ c++ compiler "code generation" settings to   
    "debug multithreaded dll" for all projects
    do for both libosip-0.x.x and partysip-0.x.x compilations.
     
4)  modify vc++ linker options to add msvcrt.lib in the
    General "object/library modules" line for all projects
    do for both libosip-0.x.x and partysip-0.x.x compilations.
   
5)  modify vc++ linker options "output" pane to ignore libcmtd.lib in 
    "ignore libraries" line for all projects. Do for both libosip-0.x.x
    and partysip-0.x.x compilations.
  
6)  compile osipfsm.dll amd osipparser.dll  from
    libosip.x.x/windows vc++ project files.
   
7)  compile partysip in batch mode. Do rebuild all
    from loaded plugins.dsw vc++ workspace.

8)  copy osipfsm.dll and osipparser.dll files to 
     the partysip-0.x.x/windows/.libs dir and run
    app as usual. File logging should now work.

Regards
Donovan.


Aymeric Moizard wrote:
> 
> After one complete day of fighting against this VC++ crazy
> and stupid program, I finally made it running again.
> 
> Here is the process I took:
> 1: In settings, all projects will use "Debug Multithreaded Dll"
>  instead of "Debug Multithreaded".
>  If anybody can explain the difference between both, I'll appreciate?
> 
> 2: Rename all stricmp to _stricmp and strnicmp to _strnicmp
>    in osip and partysip.
>   I'm too tired to understand why... Some explanations are
>   welcomed.
> 
> 3: Uncheck the "use default library" in the link settings.
>   Is'nt msvcrtd.dll a default library when "Debug multithreaded"
>   is selected?
> 
> 4: add "msvcrtd.lib" in the list of library used for the link.
> 
> My own feeling is that there was a link with a single threaded
> library in the program. If anyone knowns why this happen and
> how to be sure to avoid it by some click, I'll welcome again
> some help.
> 
> This makes me mad... I'll try to merge the changes tomorrow.
> Aymeric
> 
> On Tue, 28 Jan 2003, Zihong Lu wrote:
> 
> >
> > I have downloaded both libosip-0.9.3 and
> > partysip-0.5.3 source codes, and compiled them with
> > Visual Studio 7 (inside the VS .Net) in windows 2000
> > environment without error (there were some warnings
> > about "could not access code" in source code file
> > port_misc.c). I could start the partysip with the
> > following arguments:
> >
> > partysip.exe -d 6 -i -f
> > c:\partysip-0.5.3\conf\partysip.conf
> >
> > without problem, and I could log into the proxy
> > server.  However, there is no logging information at
> > anywhere, not in the terminal that started the
> > partysip.
> >
> > If I run the executable with the following arguements:
> >
> > partysip.exe -d 6 -i -f
> > c:\partysip-0.5.3\conf\partysip.conf -l log.txt
> >
> > The program crashed at the very first encounter of
> > OSIP_TRACE, in my case, it is line
> >
> >
> > OSIP_TRACE (osip_trace (__FILE__, __LINE__,
> > OSIP_INFO2, NULL, "serverip token %i: '%s'\n", n,
> > core->serverip[n]));
> >
> >
> > I did traced into the code, and found out that it had
> > an Access Violation at
> >
> > Microsoft file _file.c, line:
> >     EnterCriticalSection( &(((_FILEX *)pf)->lock) );
> >
> > when called from fprintf() in Microsfot file
> > fprintf.c.
> >
> >
> > Did any one run into this run time exception?  Or did
> > I miss something?  I had double checked the project
> > settings in osipfsm and osipparser, ensured that they
> > have the mutithread flags set correctly, ie, the
> > following flags existed:
> >
> > -DUSE_TMP_BUFFER, -DOSIP_MT, -DWIN32
> >
> >
> >
> > -Zihong
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> > http://mailplus.yahoo.com
> >
> >
> > _______________________________________________
> > Partysip-dev mailing list
> > address@hidden
> > http://mail.nongnu.org/mailman/listinfo/partysip-dev
> >
> 
> _______________________________________________
> Partysip-dev mailing list
> address@hidden
> http://mail.nongnu.org/mailman/listinfo/partysip-dev




reply via email to

[Prev in Thread] Current Thread [Next in Thread]