c++ - Socket Packet Post Data Truncated -
i working c++ socket programming, posting long string webpage processed. program runs ok, however, data sending truncated. webpage not process data successfully.
#maxline[4096] ssize_t myclass::send_data(const char *host,const char *page,const char *poststr) { char sendline[maxline+1], recvlin[maxline+1]; size_t n; int c_length = strlen(poststr); snprintf(sendline,maxsub , "post %s http/1.0\r\n" "host: %s\r\n" "content-type: application/x-www-form-urlencoded\r\n" "content-length: %d\r\n\r\n" "%s", page, host, c_length, poststr); int line_length = sizeof(sendline); int sig_status = send(sock, sendline, line_length,0); if (sig_status < 0){ signal(sigpipe,sig_ign); } return n; }
how can not truncated data sending?
Comments
Post a Comment