comparison svr-algo.c @ 26:0969767bca0d

snapshot of stuff
author Matt Johnston <matt@ucc.asn.au>
date Mon, 26 Jul 2004 02:44:20 +0000
parents fe6bca95afa7
children e3adf4cf5465
comparison
equal deleted inserted replaced
25:e4b6e2d569b2 26:0969767bca0d
13 unsigned char * algolist = NULL; 13 unsigned char * algolist = NULL;
14 unsigned char * remotealgos[MAX_PROPOSED_ALGO]; 14 unsigned char * remotealgos[MAX_PROPOSED_ALGO];
15 unsigned int len; 15 unsigned int len;
16 unsigned int count, i, j; 16 unsigned int count, i, j;
17 algo_type * ret = NULL; 17 algo_type * ret = NULL;
18
19 *goodguess = 0;
18 20
19 /* get the comma-separated list from the buffer ie "algo1,algo2,algo3" */ 21 /* get the comma-separated list from the buffer ie "algo1,algo2,algo3" */
20 algolist = buf_getstring(buf, &len); 22 algolist = buf_getstring(buf, &len);
21 /* Debug this */ 23 /* Debug this */
22 TRACE(("buf_match_algo: %s", algolist)); 24 TRACE(("buf_match_algo: %s", algolist));
55 if (len == strlen(localalgos[j].name) && 57 if (len == strlen(localalgos[j].name) &&
56 strncmp(localalgos[j].name, remotealgos[i], len) == 0) { 58 strncmp(localalgos[j].name, remotealgos[i], len) == 0) {
57 /* set if it was a good guess */ 59 /* set if it was a good guess */
58 if (i == 0 && j == 0) { 60 if (i == 0 && j == 0) {
59 *goodguess = 1; 61 *goodguess = 1;
60 } else {
61 *goodguess = 0;
62 } 62 }
63 /* set the algo to return */ 63 /* set the algo to return */
64 ret = &localalgos[j]; 64 ret = &localalgos[j];
65 goto out; 65 goto out;
66 } 66 }