comparison svr-service.c @ 165:0cfba3034be5

Fixed DEBUG_TRACE macro so that we don't get semicolons left about the place
author Matt Johnston <matt@ucc.asn.au>
date Sun, 02 Jan 2005 20:25:56 +0000
parents f789045062e6
children a98a2138364a
comparison
equal deleted inserted replaced
161:b9d3f725e00b 165:0cfba3034be5
37 void recv_msg_service_request() { 37 void recv_msg_service_request() {
38 38
39 unsigned char * name; 39 unsigned char * name;
40 unsigned int len; 40 unsigned int len;
41 41
42 TRACE(("enter recv_msg_service_request")); 42 TRACE(("enter recv_msg_service_request"))
43 43
44 name = buf_getstring(ses.payload, &len); 44 name = buf_getstring(ses.payload, &len);
45 45
46 /* ssh-userauth */ 46 /* ssh-userauth */
47 if (len == SSH_SERVICE_USERAUTH_LEN && 47 if (len == SSH_SERVICE_USERAUTH_LEN &&
48 strncmp(SSH_SERVICE_USERAUTH, name, len) == 0) { 48 strncmp(SSH_SERVICE_USERAUTH, name, len) == 0) {
49 49
50 send_msg_service_accept(name, len); 50 send_msg_service_accept(name, len);
51 m_free(name); 51 m_free(name);
52 TRACE(("leave recv_msg_service_request: done ssh-userauth")); 52 TRACE(("leave recv_msg_service_request: done ssh-userauth"))
53 return; 53 return;
54 } 54 }
55 55
56 /* ssh-connection */ 56 /* ssh-connection */
57 if (len == SSH_SERVICE_CONNECTION_LEN && 57 if (len == SSH_SERVICE_CONNECTION_LEN &&
60 dropbear_exit("request for connection before auth"); 60 dropbear_exit("request for connection before auth");
61 } 61 }
62 62
63 send_msg_service_accept(name, len); 63 send_msg_service_accept(name, len);
64 m_free(name); 64 m_free(name);
65 TRACE(("leave recv_msg_service_request: done ssh-connection")); 65 TRACE(("leave recv_msg_service_request: done ssh-connection"))
66 return; 66 return;
67 } 67 }
68 68
69 m_free(name); 69 m_free(name);
70 /* TODO this should be a MSG_DISCONNECT */ 70 /* TODO this should be a MSG_DISCONNECT */
73 73
74 } 74 }
75 75
76 static void send_msg_service_accept(unsigned char *name, int len) { 76 static void send_msg_service_accept(unsigned char *name, int len) {
77 77
78 TRACE(("accepting service %s", name)); 78 TRACE(("accepting service %s", name))
79 79
80 CHECKCLEARTOWRITE(); 80 CHECKCLEARTOWRITE();
81 81
82 buf_putbyte(ses.writepayload, SSH_MSG_SERVICE_ACCEPT); 82 buf_putbyte(ses.writepayload, SSH_MSG_SERVICE_ACCEPT);
83 buf_putstring(ses.writepayload, name, len); 83 buf_putstring(ses.writepayload, name, len);