Ignore:
Timestamp:
26/06/06 16:16:23 (13 years ago)
Author:
spascoe
Message:

Fixed the client API testcase problem. The client and server modules
cannot be linked into the same python interpreter, presumably because of
symbol conflicts. This should only be an issue during testing so I've created
the runclient.py script to circumvent it. There are now a set of test cases that wrap both client and server in python.

bbftp.c has been ammended to ensure all global variables are reset on each
invocation of bbftpc_main().

Location:
TI05-delivery/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/trunk/src/bbftp-client-3.2.0/bbftpc/bbftp.c

    r1157 r1238  
    370370 
    371371#ifdef NDG_PYTHON_EMBED 
     372/** Reset all global variables to how they were first initialised. 
     373 */ 
     374void bbftpc_reset_globals(void) { 
     375 
     376  state   = SETTOZERO ; 
     377  timestamp = SETTOZERO ; 
     378   
     379  protocolmin = 2 ;  
     380  protocolmax = 3 ;  
     381  //int     protocol ; 
     382  debug = SETTOZERO ; 
     383  verbose = SETTOZERO ; 
     384  warning = SETTOZERO ; 
     385  statoutput = SETTOZERO ; 
     386  globaltrymax = NBTRYMAX ; 
     387  newcontrolport = CONTROLPORT ; 
     388  usessh = SETTOZERO ; 
     389  sshbatchmode  = SETTOZERO ; 
     390  sshchildpid   = SETTOZERO ; 
     391  sshidentityfile = NULL ; 
     392  sshremotecmd = NULL ; 
     393  sshcmd = NULL ; 
     394   
     395  usecert = SETTOZERO ; 
     396  useprivate = SETTOZERO ; 
     397  privatestr = NULL ; 
     398   
     399  //struct sockaddr_in hisctladdr ; 
     400  //struct sockaddr_in myctladdr ; 
     401  bbftprc = NULL ; 
     402  //int     localumask ; 
     403#if defined(WITH_RFIO) || defined(WITH_RFIO64) 
     404  localcos  = SETTOZERO ; 
     405#endif 
     406   
     407  newcmd = NULL; 
     408  //int remoterfio; 
     409  //int localrfio; 
     410  sendwinsize     = 256 ; 
     411  recvwinsize     = 256 ; 
     412  nbport = 1 ; 
     413  ackto                 = ACKTO; 
     414  recvcontrolto = CONTROLSOCKTO; 
     415  sendcontrolto = SENDCONTROLTO; 
     416  datato                        = DATASOCKTO; 
     417   
     418  remoteumask = SETTOZERO ; 
     419  remotecos   = -1 ; 
     420  remotedir = NULL ; 
     421  //int     incontrolsock ; 
     422  //int     outcontrolsock ; 
     423  myexitcode = SETTOZERO ; 
     424  hostname   = NULL ; 
     425  hp = NULL ; 
     426  username   = NULL ; 
     427  password   = NULL ; 
     428#ifdef CERTIFICATE_AUTH 
     429  service    = NULL ; 
     430#endif 
     431  mychildren = NULL ; 
     432  //int     nbpidchild ; 
     433#ifdef CASTOR 
     434  castfd = -1 ; 
     435  castfilename = NULL ; 
     436#endif 
     437  transferoption = TROPT_TMP | TROPT_DIR | TROPT_MODE | TROPT_ACC;  
     438  filemode ; 
     439  lastaccess[9] ; 
     440  lastmodif[9] ; 
     441  buffersizeperstream = 256 ; 
     442  //int     requestedstreamnumber ; 
     443  //my64_t  filesize ; 
     444  curfilename = NULL ; 
     445  realfilename   = NULL ; 
     446  myports        = NULL ; 
     447  mysockets      = NULL ; 
     448  readbuffer     = NULL ; 
     449  compbuffer     = NULL ;  
     450  resfd = -1 ; 
     451  simulation_mode = SETTOZERO; 
     452   
     453  connectionisbroken = SETTOZERO ; 
     454   
     455  pasvport_min = 0 ; 
     456  pasvport_max = 0 ; 
     457   
     458  commandList = NULL; 
     459  first = NULL; 
     460  iterator = NULL; 
     461} 
     462 
     463#endif // NDG_PYTHON_EMBED 
     464 
     465 
     466#ifdef NDG_PYTHON_EMBED 
    372467bbftpc_main(int argc, char **argv, char **envp) { 
     468  bbftpc_reset_globals(); 
     469   
    373470#else 
    374471main(argc, argv, envp) 
  • TI05-delivery/trunk/src/python_ext/bbftpc.c

    r1187 r1238  
    7373  Py_DECREF(client_args); 
    7474 
    75   for (i=0; i<argv_s.argc; i++) { 
    76     fprintf(stderr, "delivery.bbftpc.run argument: %s\n", argv_s.argv[i]); 
    77   } 
    78    
    7975  bbftpc_main(argv_s.argc, argv_s.argv, environ); 
    8076  ndg_argv_clear(&argv_s); ndg_argv_free(&argv_s); 
Note: See TracChangeset for help on using the changeset viewer.