@@ -428,7 +428,7 @@ static HashTable parse_post_request(const String msg) {
428428}
429429buffer [line_len ] = '\0' ;
430430
431- String key = strtok (buffer , ":" ), value = strtok (NULL , ": " );
431+ String key = strtok (buffer , ":" ), value = strtok (NULL , "\n " );
432432
433433while (* value == ' ' )
434434value ++ ;
@@ -756,24 +756,7 @@ int main(const int argc, String *const argv) {
756756}
757757
758758compute_flags (argc , argv , & _verbose_flag );
759-
760- // parse_post_request(
761- // "Host: 192.168.1.77:8888\n"
762- // "Connection: keep-alive\n"
763- // "Content-Length: 41\n"
764- // "Cache-Control: max-age=0\n"
765- // "Origin: http://192.168.1.77:8888\n"
766- // "Upgrade-Insecure-Requests: 1\n"
767- // "DNT: 1\n"
768- // "Content-Type: application/x-www-form-urlencoded\n"
769- // "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36\n"
770- // "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\n"
771- // "Referer: http://192.168.1.77:8888/\n"
772- // "Accept-Encoding: gzip, deflate\n"
773- // "Accept-Language: en-US,en;q=0.9\n\n"
774- // "name=a%24aa&email=qqq%40ddd.com&pas%21sword=zzz\n"
775- // );
776- // return 0;
759+
777760if (!is_valid_port ()) {
778761fprintf (stderr , RED "Port Error: Invalid port %s\n" RESET , _port );
779762exit (EXIT_FAILURE );
@@ -817,8 +800,6 @@ int main(const int argc, String *const argv) {
817800 "Using: %s\n" RESET ,
818801 _port , _doc_root , _log_root , sqlite_get_version ());
819802
820- // sqlite_exec("SELECT * FROM test;");
821-
822803const int default_root_len = strnlen (_doc_root , PATH_MAX );
823804
824805while (_sigint_flag ) {
@@ -838,10 +819,9 @@ int main(const int argc, String *const argv) {
838819
839820if (recv (newfd , msg , MSG_LEN , 0 ) > 0 ) {
840821if (_verbose_flag )
841- printf (CYAN "MSG :\n%s\n" RESET , msg );
822+ printf (CYAN "INBOUND MESSAGE :\n%s\n" RESET , msg );
842823process_request (newfd , msg , ipv6_address );
843- }
844- else {
824+ } else {
845825const String err_msg = strerror (errno );
846826
847827if (_verbose_flag )
0 commit comments