Changeset 19210
- Timestamp:
- 2009-04-22T22:32:44+12:00 (15 years ago)
- Location:
- gsdl/trunk/runtime-src/src/w32server
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/runtime-src/src/w32server/netio.cpp
r9598 r19210 35 35 #include "locate.h" 36 36 #include "d_winsock.h" 37 #include "settings.h" 37 38 38 39 //Private Variables and Declarations … … 217 218 ServerSockAddr.sin_port = d_htons( (WORD) bind_port); 218 219 ServerSockAddr.sin_family = AF_INET; 219 ServerSockAddr.sin_addr.s_addr = d_htonl(INADDR_ANY); 220 220 if (gsdl_external_access) { 221 ServerSockAddr.sin_addr.s_addr = d_htonl(INADDR_ANY); 222 } 223 else { 224 ServerSockAddr.sin_addr.s_addr = d_htonl(INADDR_LOOPBACK); 225 } 226 227 221 228 // Try to bind the socket with the address 222 229 if (d_bind(ServerSocket, (LPSOCKADDR) &ServerSockAddr, -
gsdl/trunk/runtime-src/src/w32server/resource.h
r11319 r19210 40 40 #define ID_ARM_127_0_0_1 1026 41 41 #define ID_ARM_LOCALHOST 1027 42 #define ID_EXTERNAL_ACCESS 1028 42 43 #define ID_PROJECT_SETTINGS 40001 43 44 #define ID_PROJECT_EXIT 40002 -
gsdl/trunk/runtime-src/src/w32server/settings.cpp
r19015 r19210 61 61 // general settings 62 62 int gsdl_port_num = 80; 63 int gsdl_external_access = 0; 63 64 int gsdl_auto_enter = 0; 64 65 int gsdl_browser = GS_DEFAULT; … … 310 311 311 312 write_ini_line(fout, "portnumber", text_t(gsdl_port_num)); 313 write_ini_line(fout, "externalaccess", text_t(gsdl_external_access)); 312 314 write_ini_line(fout, "autoenter", text_t(gsdl_auto_enter)); 313 315 write_ini_line(fout, "browser", text_t(gsdl_browser)); … … 402 404 // general settings 403 405 gsdl_port_num = 80; 406 gsdl_external_access = 0; 404 407 gsdl_auto_enter = 0; 405 408 gsdl_start_browser = 1; … … 464 467 } else if (key == "portnumber") { 465 468 gsdl_port_num = value.getint(); 469 470 } else if (key == "externalaccess") { 471 gsdl_external_access = value.getint(); 466 472 467 473 } else if (key == "autoenter") { … … 636 642 gsdl_port_num = GetDlgItemInt(hwndDlg, SERVER_PORT_EDIT_BOX, &bres, 0); 637 643 if (!bres) gsdl_port_num = 80; 638 644 645 // whether to allow external access or not 646 res = SendDlgItemMessage(hwndDlg, ID_EXTERNAL_ACCESS, BM_GETCHECK, 0, 0); 647 gsdl_external_access = (res == 1); 648 639 649 // whether to enter the library automatically on startup 640 650 res = SendDlgItemMessage(hwndDlg, ID_AUTO_ENTER_LIBRARY, BM_GETCHECK, 0, 0); 641 651 gsdl_auto_enter = (res == 1); 642 652 643 653 // which browser to use 644 654 gsdl_browser = read_dialog_browser_field (hwndDlg); … … 666 676 // set current values 667 677 SetDlgItemInt(hwndDlg, SERVER_PORT_EDIT_BOX, gsdl_port_num, FALSE); 678 SendDlgItemMessage(hwndDlg, ID_EXTERNAL_ACCESS, BM_SETCHECK, 679 gsdl_external_access ? 1 : 0, 0); 668 680 SendDlgItemMessage(hwndDlg, ID_AUTO_ENTER_LIBRARY, BM_SETCHECK, 669 681 gsdl_auto_enter ? 1 : 0, 0); … … 877 889 int old_gsdl_show_console = gsdl_show_console; 878 890 int old_gsdl_port_num = gsdl_port_num; 891 int old_gsdl_external_access = gsdl_external_access; 879 892 880 893 int res = 0; … … 912 925 if (res == 1) { 913 926 // only update if exited via the OK button 914 if (gsdl_port_num != old_gsdl_port_num) { 927 if ((gsdl_port_num != old_gsdl_port_num) 928 || (gsdl_external_access != old_gsdl_external_access)) { 915 929 EndHTTPServer(); 916 930 StartHTTPServer(window); -
gsdl/trunk/runtime-src/src/w32server/settings.h
r16310 r19210 62 62 // general settings 63 63 extern int gsdl_port_num; 64 extern int gsdl_external_access; 64 65 extern int gsdl_auto_enter; 65 66 extern int gsdl_browser;
Note:
See TracChangeset
for help on using the changeset viewer.