Rev 187 | Rev 190 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 187 | Rev 188 | ||
---|---|---|---|
Line 888... | Line 888... | ||
888 | buffer_t http_buffer; // used for both request and reply |
888 | buffer_t http_buffer; // used for both request and reply |
889 | size_t dummy_size; |
889 | size_t dummy_size; |
890 | bool was_successful; |
890 | bool was_successful; |
891 | unsigned char color; |
891 | unsigned char color; |
892 | unsigned char part; |
892 | unsigned char part; |
893 | wchar_t *osversion; |
- | |
894 | char *base64buffer; // mallocated |
893 | char *base64buffer; // mallocated |
895 | int write_index; |
894 | int write_index; |
896 | int read_index; |
895 | int read_index; |
897 | int length; |
896 | int length; |
- | 897 | DWORD valsize; |
|
- | 898 | HKEY hKey; |
|
898 | SOCKET s; |
899 | SOCKET s; |
899 | int i; |
900 | int i; |
900 | int j; |
901 | int j; |
901 | 902 | ||
902 | // get a hand on the log file and read its contents |
903 | // get a hand on the log file and read its contents |
Line 1007... | Line 1008... | ||
1007 | Buffer_AppendCharArray (&http_buffer, "&player1="); Buffer_Append (&http_buffer, (the_board.players[COLOR_WHITE].type == PLAYER_INTERNET ? "I" : (the_board.players[COLOR_WHITE].type == PLAYER_COMPUTER ? "C" : "H")), 1); |
1008 | Buffer_AppendCharArray (&http_buffer, "&player1="); Buffer_Append (&http_buffer, (the_board.players[COLOR_WHITE].type == PLAYER_INTERNET ? "I" : (the_board.players[COLOR_WHITE].type == PLAYER_COMPUTER ? "C" : "H")), 1); |
1008 | Buffer_AppendCharArray (&http_buffer, "&player2="); Buffer_Append (&http_buffer, (the_board.players[COLOR_BLACK].type == PLAYER_INTERNET ? "I" : (the_board.players[COLOR_BLACK].type == PLAYER_COMPUTER ? "C" : "H")), 1); |
1009 | Buffer_AppendCharArray (&http_buffer, "&player2="); Buffer_Append (&http_buffer, (the_board.players[COLOR_BLACK].type == PLAYER_INTERNET ? "I" : (the_board.players[COLOR_BLACK].type == PLAYER_COMPUTER ? "C" : "H")), 1); |
1009 | Buffer_AppendCharArray (&http_buffer, "&board="); base64_encode (base64buffer, board_buffer.data, board_buffer.size); Buffer_AppendCString (&http_buffer, base64buffer); |
1010 | Buffer_AppendCharArray (&http_buffer, "&board="); base64_encode (base64buffer, board_buffer.data, board_buffer.size); Buffer_AppendCString (&http_buffer, base64buffer); |
1010 | Buffer_AppendCharArray (&http_buffer, "&log="); base64_encode (base64buffer, logfile_buffer.data, logfile_buffer.size); Buffer_AppendCString (&http_buffer, base64buffer); |
1011 | Buffer_AppendCharArray (&http_buffer, "&log="); base64_encode (base64buffer, logfile_buffer.data, logfile_buffer.size); Buffer_AppendCString (&http_buffer, base64buffer); |
1011 | Buffer_AppendCharArray (&http_buffer, "&description="); base64_encode (base64buffer, description_buffer.data, description_buffer.size); Buffer_AppendCString (&http_buffer, base64buffer); |
1012 | Buffer_AppendCharArray (&http_buffer, "&description="); base64_encode (base64buffer, description_buffer.data, description_buffer.size); Buffer_AppendCString (&http_buffer, base64buffer); |
1012 | Buffer_AppendCharArray (&http_buffer, "&os="); |
1013 | Buffer_AppendCharArray (&http_buffer, "&os="); RegOpenKeyExA (HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, KEY_READ, &hKey); valsize = (DWORD) sizeof (temp_string); RegQueryValueExA (hKey, "BuildLab", NULL, NULL, (unsigned char *) temp_string, &valsize); RegCloseKey (hKey); temp_string[valsize] = 0; base64_encode (base64buffer, temp_string, strlen (temp_string)); Buffer_AppendCString (&http_buffer, base64buffer); |
1013 | Buffer_AppendCharArray (&http_buffer, "&cpu="); |
1014 | Buffer_AppendCharArray (&http_buffer, "&cpu="); getenv_s (&dummy_size, temp_string, sizeof (temp_string), "PROCESSOR_IDENTIFIER"); base64_encode (base64buffer, temp_string, strlen (temp_string)); Buffer_AppendCString (&http_buffer, base64buffer); |
1014 | Buffer_AppendCharArray (&http_buffer, "&ram="); memory_status.dwLength = sizeof (memory_status); GlobalMemoryStatusEx (&memory_status); sprintf_s (temp_string, sizeof (temp_string), "Memory usage: %d%%\nPhysical total %d Mb (free %d Mb)\nPaging total %d Mb (free %d Mb)\nVirtual total %d Mb (free %d Mb)", (int) memory_status.dwMemoryLoad, (int) (memory_status.ullTotalPhys / (1024 * 1024)), (int) (memory_status.ullAvailPhys / (1024 * 1024)), (int) (memory_status.ullTotalPageFile / (1024 * 1024)), (int) (memory_status.ullAvailPageFile / (1024 * 1024)), (int) (memory_status.ullTotalVirtual / (1024 * 1024)), (int) (memory_status.ullAvailVirtual / (1024 * 1024))); base64_encode (base64buffer, temp_string, strlen (temp_string)); Buffer_AppendCString (&http_buffer, base64buffer); |
1015 | Buffer_AppendCharArray (&http_buffer, "&ram="); memory_status.dwLength = sizeof (memory_status); GlobalMemoryStatusEx (&memory_status); sprintf_s (temp_string, sizeof (temp_string), "Memory usage: %d%%\nPhysical total %d Mb (free %d Mb)\nPaging total %d Mb (free %d Mb)\nVirtual total %d Mb (free %d Mb)", (int) memory_status.dwMemoryLoad, (int) (memory_status.ullTotalPhys / (1024 * 1024)), (int) (memory_status.ullAvailPhys / (1024 * 1024)), (int) (memory_status.ullTotalPageFile / (1024 * 1024)), (int) (memory_status.ullAvailPageFile / (1024 * 1024)), (int) (memory_status.ullTotalVirtual / (1024 * 1024)), (int) (memory_status.ullAvailVirtual / (1024 * 1024))); base64_encode (base64buffer, temp_string, strlen (temp_string)); Buffer_AppendCString (&http_buffer, base64buffer); |
1015 | Buffer_Forget (&description_buffer); |
1016 | Buffer_Forget (&description_buffer); |
1016 | Buffer_Forget (&logfile_buffer); |
1017 | Buffer_Forget (&logfile_buffer); |
1017 | Buffer_Forget (&board_buffer); |
1018 | Buffer_Forget (&board_buffer); |
1018 | free (base64buffer); |
1019 | free (base64buffer); |