Changeset 4675
- Timestamp:
- 02/20/07 17:01:03 (2 years ago)
- Files:
-
- wired/branches/p7/wired/commands.c (modified) (3 diffs)
- wired/branches/p7/wired/server.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wired/branches/p7/wired/commands.c
r4568 r4675 222 222 wd_client_t *client = argument; 223 223 wi_string_t *string; 224 wi_p7_message_t *message; 224 225 wi_socket_state_t state; 225 226 wi_uinteger_t i = 0; … … 252 253 } 253 254 254 wd_client_lock_socket(client);255 /* wd_client_lock_socket(client); 255 256 string = wi_socket_read_to_string(client->socket, 0.0, WI_STR(WD_MESSAGE_SEPARATOR_STR)); 256 257 wd_client_unlock_socket(client); … … 263 264 } 264 265 265 wd_parse_command(string); 266 wd_parse_command(string);*/ 267 268 wd_client_lock_socket(client); 269 message = wi_p7_socket_read_message(client->p7_socket, 0.0); 270 wd_client_unlock_socket(client); 271 272 if(!message) { 273 wi_log_info(WI_STR("Could not read from %@: %m"), client->ip); 274 275 break; 276 } 277 278 wi_log_info(WI_STR("read %@"), message); 266 279 267 280 if(++i % 10 == 0) wired/branches/p7/wired/server.c
r4646 r4675 45 45 #include "files.h" 46 46 #include "main.h" 47 #include "messages.h" 47 48 #include "server.h" 48 49 #include "settings.h" … … 261 262 void wd_ssl_init(void) { 262 263 wd_rsa = wi_rsa_init_with_bits(wi_rsa_alloc(), 1024); 264 265 /* wi_p7_cipher_t *cipher = wi_p7_cipher_init_with_random_key(wi_p7_cipher_alloc(), WI_P7_CIPHER_AES_256); 266 267 wi_log_info(WI_STR("cipher = %@"), cipher); 268 269 if(!cipher) 270 wi_log_err(WI_STR("%m")); 271 272 wi_string_t *string0 = WI_STR("a"); 273 274 wi_log_info(WI_STR("string0 = %@"), string0); 275 276 wi_data_t *data0 = wi_string_data(string0); 277 278 wi_log_info(WI_STR("data0 = %@"), data0); 279 280 wi_data_t *data1 = wi_p7_cipher_encrypt_data(cipher, data0); 281 282 wi_log_info(WI_STR("data1 = %@"), data1); 283 284 wi_data_t *data2 = wi_p7_cipher_decrypt_data(cipher, data1); 285 286 if(!data2) 287 wi_log_err(WI_STR("%m")); 288 289 wi_log_info(WI_STR("data2 = %@"), data2); 290 291 wi_string_t *string1 = wi_string_with_data(data2); 292 293 wi_log_info(WI_STR("string1 = %@"), string1); 294 295 wi_release(cipher);*/ 263 296 } 264 297 … … 314 347 client = wi_autorelease(wd_client_init_with_socket(wd_client_alloc(), p7_socket)); 315 348 316 if(!wi_thread_create_thread(wd_control_thread , client))349 if(!wi_thread_create_thread(wd_control_thread2, client)) 317 350 wi_log_err(WI_STR("Could not create a thread for %@: %m"), ip); 318 351
