Commit 301ad473 authored by Matteo Quintiliani's avatar Matteo Quintiliani
Browse files

Fixed bug but added TODO


git-svn-id: file:///home/quintiliani/svncopy/nmxptool/trunk@68 3cd66e75-5955-46cb-a940-c26e5fc5497d
parent 71859445
......@@ -134,11 +134,22 @@ int nmxp_sendConnectRequest(int isock, char *naqs_username, char *naqs_password,
char crc32buf[100];
NMXP_CONNECT_REQUEST connectRequest;
strcpy(connectRequest.username, naqs_username);
if(naqs_username) {
strcpy(connectRequest.username, naqs_username);
} else {
int i;
for(i=0; i < 12; i++) {
connectRequest.username[i] = 0;
}
}
connectRequest.version = htonl(0);
connectRequest.connection_time = htonl(connection_time);
if(strlen(naqs_username) == 0 && strlen(naqs_password) == 0 ) {
nmxp_log(0, 0, "TODO improve check username and password!\n");
if(naqs_username == NULL && naqs_password == NULL ) {
sprintf(crc32buf, "%d%d", connectRequest.version, connection_time);
} else if(strlen(naqs_username) == 0 && strlen(naqs_password) == 0 ) {
sprintf(crc32buf, "%d%d", connectRequest.version, connection_time);
} else if(strlen(naqs_username) != 0 && strlen(naqs_password) != 0 ) {
sprintf(crc32buf, "%s%d%d%s", naqs_username, connectRequest.version,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment