Changeset 1784 for box/chris/general/lib/server/WinNamedPipeStream.cpp
- Timestamp:
- 01/08/2007 00:18:50 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
box/chris/general/lib/server/WinNamedPipeStream.cpp
r1464 r1784 64 64 catch (std::exception &e) 65 65 { 66 ::syslog(LOG_ERR,"Caught exception while destroying "67 "named pipe, ignored .");66 BOX_ERROR("Caught exception while destroying " 67 "named pipe, ignored: " << e.what()); 68 68 } 69 69 } … … 101 101 if (mSocketHandle == INVALID_HANDLE_VALUE) 102 102 { 103 ::syslog(LOG_ERR, "CreateNamedPipeW failed: %s",104 GetErrorMessage(GetLastError()) .c_str());103 BOX_ERROR("Failed to CreateNamedPipeW(" << pName << "): " << 104 GetErrorMessage(GetLastError())); 105 105 THROW_EXCEPTION(ServerException, SocketOpenError) 106 106 } … … 110 110 if (!connected) 111 111 { 112 ::syslog(LOG_ERR, "ConnectNamedPipe failed: %s",113 GetErrorMessage(GetLastError()) .c_str());112 BOX_ERROR("Failed to ConnectNamedPipe(" << pName << "): " << 113 GetErrorMessage(GetLastError())); 114 114 Close(); 115 115 THROW_EXCEPTION(ServerException, SocketOpenError) … … 127 127 if (mReadableEvent == INVALID_HANDLE_VALUE) 128 128 { 129 ::syslog(LOG_ERR, "Failed to create the Readable event: %s",130 GetErrorMessage(GetLastError()) .c_str());129 BOX_ERROR("Failed to create the Readable event: " << 130 GetErrorMessage(GetLastError())); 131 131 Close(); 132 132 THROW_EXCEPTION(CommonException, Internal) … … 145 145 if (err != ERROR_IO_PENDING) 146 146 { 147 ::syslog(LOG_ERR, "Failed to start overlapped read: "148 "%s", GetErrorMessage(err).c_str());147 BOX_ERROR("Failed to start overlapped read: " << 148 GetErrorMessage(err)); 149 149 Close(); 150 150 THROW_EXCEPTION(ConnectionException, … … 184 184 if (err == ERROR_PIPE_BUSY) 185 185 { 186 ::syslog(LOG_ERR, "Failed to connect to backup"187 " daemon:it is busy with another connection");186 BOX_ERROR("Failed to connect to backup daemon: " 187 "it is busy with another connection"); 188 188 } 189 189 else 190 190 { 191 ::syslog(LOG_ERR, "Failed to connect to backup "192 "daemon: %s", GetErrorMessage(err).c_str());191 BOX_ERROR("Failed to connect to backup daemon: " << 192 GetErrorMessage(err)); 193 193 } 194 194 THROW_EXCEPTION(ServerException, SocketOpenError) … … 262 262 if (err == ERROR_BROKEN_PIPE) 263 263 { 264 ::syslog(LOG_ERR, "Control"265 " clientdisconnected");264 BOX_ERROR("Control client " 265 "disconnected"); 266 266 } 267 267 else 268 268 { 269 ::syslog(LOG_ERR, 270 "Failed to wait for " 269 BOX_ERROR("Failed to wait for " 271 270 "ReadFile to complete: " 272 "%s", 273 GetErrorMessage(err).c_str()); 271 << GetErrorMessage(err)); 274 272 } 275 273 … … 327 325 else if (err == ERROR_BROKEN_PIPE) 328 326 { 329 ::syslog(LOG_ERR, 330 "Control client disconnected"); 327 BOX_ERROR("Control client disconnected"); 331 328 mReadClosed = true; 332 329 } 333 330 else 334 331 { 335 ::syslog(LOG_ERR, "Failed to start " 336 "overlapped read: %s", 337 GetErrorMessage(err).c_str()); 332 BOX_ERROR("Failed to start overlapped read: " 333 << GetErrorMessage(err)); 338 334 Close(); 339 335 THROW_EXCEPTION(ConnectionException, … … 388 384 else 389 385 { 390 ::syslog(LOG_ERR, "Failed to read from " 391 "control socket: %s", 392 GetErrorMessage(err).c_str()); 386 BOX_ERROR("Failed to read from control socket: " 387 << GetErrorMessage(err)); 393 388 THROW_EXCEPTION(ConnectionException, 394 389 Conn_SocketReadError) … … 441 436 { 442 437 DWORD err = GetLastError(); 443 ::syslog(LOG_ERR, "Failed to write to control socket: "444 "%s", GetErrorMessage(err).c_str());438 BOX_ERROR("Failed to write to control socket: " << 439 GetErrorMessage(err)); 445 440 Close(); 446 441 … … 475 470 if (mSocketHandle == INVALID_HANDLE_VALUE && mIsConnected) 476 471 { 477 fprintf(stderr, "Inconsistent connected state\n"); 478 ::syslog(LOG_ERR, "Inconsistent connected state"); 472 BOX_ERROR("Named pipe: inconsistent connected state"); 479 473 mIsConnected = false; 480 474 } … … 489 483 if (!CancelIo(mSocketHandle)) 490 484 { 491 ::syslog(LOG_ERR, "Failed to cancel outstanding " 492 "I/O: %s", 493 GetErrorMessage(GetLastError()).c_str()); 485 BOX_ERROR("Failed to cancel outstanding I/O: " << 486 GetErrorMessage(GetLastError())); 494 487 } 495 488 496 489 if (mReadableEvent == INVALID_HANDLE_VALUE) 497 490 { 498 ::syslog(LOG_ERR, "Failed to destroy Readable"499 " event:invalid handle");491 BOX_ERROR("Failed to destroy Readable event: " 492 "invalid handle"); 500 493 } 501 494 else if (!CloseHandle(mReadableEvent)) 502 495 { 503 ::syslog(LOG_ERR, "Failed to destroy Readable " 504 "event: %s", 505 GetErrorMessage(GetLastError()).c_str()); 496 BOX_ERROR("Failed to destroy Readable event: " << 497 GetErrorMessage(GetLastError())); 506 498 } 507 499 … … 510 502 if (!FlushFileBuffers(mSocketHandle)) 511 503 { 512 ::syslog(LOG_INFO, "FlushFileBuffers failed: %s",513 GetErrorMessage(GetLastError()) .c_str());504 BOX_ERROR("Failed to FlushFileBuffers: " << 505 GetErrorMessage(GetLastError())); 514 506 } 515 507 … … 519 511 if (err != ERROR_PIPE_NOT_CONNECTED) 520 512 { 521 ::syslog(LOG_ERR, "DisconnectNamedPipe " 522 "failed: %s", 523 GetErrorMessage(err).c_str()); 513 BOX_ERROR("Failed to DisconnectNamedPipe: " << 514 GetErrorMessage(err)); 524 515 } 525 516 } … … 537 528 if (!result) 538 529 { 539 ::syslog(LOG_ERR, "CloseHandle failed: %s",540 GetErrorMessage(GetLastError()) .c_str());530 BOX_ERROR("Failed to CloseHandle: " << 531 GetErrorMessage(GetLastError())); 541 532 THROW_EXCEPTION(ServerException, SocketCloseError) 542 533 } … … 586 577 if (!FlushFileBuffers(mSocketHandle)) 587 578 { 588 ::syslog(LOG_WARNING, "FlushFileBuffers failed: %s",589 GetErrorMessage(GetLastError()) .c_str());579 BOX_ERROR("Failed to FlushFileBuffers: " << 580 GetErrorMessage(GetLastError())); 590 581 } 591 582 }
Note: See TracChangeset
for help on using the changeset viewer.
