problem with sending packet from client to server
-
Hi, when i m trying to transfer the encoded packet after escape encoding it from client to server using foloowing code snippet....... AES_EncodeForService(data,key,&res,&len); // disard & strcpy(tempstr,""); j=0; for (i=12;i%s",tempstr); // construct a packet with header followed by footer........ strcpy(packet,header); strcat(packet,withCode); // set buffer len=strlen(packet); sprintf(sendbuf,"POST /services/ws.asp HTTP/1.0\r\nContent-type: application/x-www-form-urlencoded\r\nContent-length: %d\r\n%s\r\n\r\n",len,packet); // length of buffer len=strlen(sendbuf); // send packet.............. bytesSent = send(ConnectSocket,sendbuf,len,0); printf("\nBytes Sent: %ld\n\n", bytesSent ); /// receive packet.......... bytesRecv = recv(ConnectSocket,recvbuf,10000,0); // if doesn't receive the bytes..... if (bytesRecv <= 0) printf("\n Error : %d",WSAGetLastError()); // display the received content......... else { printf("\n Receive buffer : %s\n\n",recvbuf); AES_Decode(recvbuf,key,&recvData,&len); printf("\n Decode : %s \n\n",recvData); } my problem is that the characters which r not aphanumeric get changed and hence does not able to decode it properly. chirag_a_chauahn
-
Hi, when i m trying to transfer the encoded packet after escape encoding it from client to server using foloowing code snippet....... AES_EncodeForService(data,key,&res,&len); // disard & strcpy(tempstr,""); j=0; for (i=12;i%s",tempstr); // construct a packet with header followed by footer........ strcpy(packet,header); strcat(packet,withCode); // set buffer len=strlen(packet); sprintf(sendbuf,"POST /services/ws.asp HTTP/1.0\r\nContent-type: application/x-www-form-urlencoded\r\nContent-length: %d\r\n%s\r\n\r\n",len,packet); // length of buffer len=strlen(sendbuf); // send packet.............. bytesSent = send(ConnectSocket,sendbuf,len,0); printf("\nBytes Sent: %ld\n\n", bytesSent ); /// receive packet.......... bytesRecv = recv(ConnectSocket,recvbuf,10000,0); // if doesn't receive the bytes..... if (bytesRecv <= 0) printf("\n Error : %d",WSAGetLastError()); // display the received content......... else { printf("\n Receive buffer : %s\n\n",recvbuf); AES_Decode(recvbuf,key,&recvData,&len); printf("\n Decode : %s \n\n",recvData); } my problem is that the characters which r not aphanumeric get changed and hence does not able to decode it properly. chirag_a_chauahn