Changeset 1264 for TI05-delivery


Ignore:
Timestamp:
03/07/06 10:19:20 (13 years ago)
Author:
spascoe
Message:

Client-side python API now works on all test cases.

Location:
TI05-delivery/trunk
Files:
5 edited

Legend:

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

    r1259 r1264  
    143143 
    144144  /* Send version verification message.  */ 
    145   if (ndg_message_send(NDG_HANDSHAKE, strlen(NDG_HANDSHAKE) + 1, logmessage) == -1) { 
     145  if (ndg_message_send(NDG_HANDSHAKE, strlen(NDG_HANDSHAKE), logmessage) == -1) { 
    146146    return -1; 
    147147  } 
     
    163163  } 
    164164 
    165   if (ndg_message_send(privatestr, strlen(privatestr) + 1, logmessage) == -1) { 
     165  if (ndg_message_send(privatestr, strlen(privatestr), logmessage) == -1) { 
    166166    return -1; 
    167167  } 
  • TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/ndg.c

    r1187 r1264  
    5050 
    5151  /* Send response */ 
    52   if (ndg_message_send(NDG_HANDSHAKE, strlen(NDG_HANDSHAKE) + 1, logmessage) == -1) { 
     52  if (ndg_message_send(NDG_HANDSHAKE, strlen(NDG_HANDSHAKE), logmessage) == -1) { 
    5353    return -1; 
    5454  } 
     
    204204 * 
    205205 * The message length is sent in a separate header. 
     206 * The message is guaranteed to be NULL terminated.  This is done by 
     207 * allocating length+1 bytes and filling them with \0. 
    206208 * 
    207209 * @param buffer is set to newly allocated message buffer. 
     
    221223  } 
    222224 
    223   if ((*buffer = (char *)malloc(*length * sizeof(char))) == NULL) { 
     225  if ((*buffer = (char *)calloc(*length+1, sizeof(char))) == NULL) { 
    224226    sprintf(logmessage, "ngd_message_recv malloc error"); 
    225227    return -1; 
  • TI05-delivery/trunk/src/python_ext/bbftpc.c

    r1259 r1264  
    229229  } 
    230230 
    231   if (ndg_client_message_send(buffer, len+1, logmessage) == -1) { 
     231  if (ndg_client_message_send(buffer, len, logmessage) == -1) { 
    232232    PyErr_SetString(PyExc_IOError, logmessage); 
    233233    return NULL; 
  • TI05-delivery/trunk/test/runclient.py

    r1259 r1264  
    1414NDG_MESSAGE_LEN = 256 
    1515 
    16 NDG_HANDSHAKE = "NDG-Delivery-server %s" % VERSION 
     16NDG_HANDSHAKE = "NDG-Delivery-client %s" % VERSION 
    1717 
    1818 
     
    2323 
    2424class AuthClientHandler(object): 
    25     def __init__(self, privatestr=""): 
     25    def __init__(self, privatestr="none"): 
    2626        self.privatestr = privatestr 
    2727 
    2828    def authenticate(self): 
    29         print >>sys.stderr, "Waiting 20s for gdb connect: pid=%d" % os.getpid(), 
    30         time.sleep(20) 
    31         print >>sys.stderr, "continueing" 
     29        #print >>sys.stderr, "Waiting 20s for gdb connect: pid=%d" % os.getpid(), 
     30        #time.sleep(20) 
     31        #print >>sys.stderr, "continueing" 
    3232 
    3333        BC.send(NDG_HANDSHAKE) 
    3434        resp = BC.recv() 
     35 
     36        print "Received Auth handshake: %s" % resp 
    3537 
    3638        BC.send(self.privatestr) 
     
    5557    i = args.index('-P') 
    5658except ValueError: 
    57     privatestr = "" 
     59    privatestr = "none" 
    5860    pass 
    5961else: 
  • TI05-delivery/trunk/test/test_embedded.py

    r1247 r1264  
    2424 
    2525import delivery.server as server 
     26import traceback 
    2627 
    2728 
     
    3435        #fh.close() 
    3536        #time.sleep(20) 
     37 
     38        msg = self.recv() 
     39        syslog.syslog(syslog.LOG_DEBUG, 'AuthContext received Auth message: %s' % msg) 
     40                 
     41        self.send(NDG_HANDSHAKE) 
     42 
     43        privatestr = self.recv() 
     44        syslog.syslog(syslog.LOG_DEBUG, "AuthContext received privatestr: %s" % privatestr) 
    3645         
    37         msg = self.recvCStr() 
    38  
    39         syslog.syslog(syslog.LOG_DEBUG, 'AuthContext received Auth message: %s' % msg) 
    40  
    41         self.send(NDG_HANDSHAKE) 
    42  
    43         privatestr = self.recvCStr() 
    44         syslog.syslog(syslog.LOG_DEBUG, "AuthContext received privatestr: %s" % privatestr) 
    45  
    4646        return self.makeAuthzHandler(msg, "TestCaseUser") 
    4747 
Note: See TracChangeset for help on using the changeset viewer.