Changeset 31584 in vbox for trunk/src/VBox
- Timestamp:
- Aug 11, 2010 9:51:16 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/socket.cpp
r31582 r31584 760 760 rtSocketErrorReset(); 761 761 #ifdef RT_OS_WINDOWS 762 int cbNow = cbBuffer >= INT_MAX/2 ? INT_MAX/2 : (int)cbBuffer; 763 #else 764 size_t cbNow = cbBuffer; 765 #endif 766 ssize_t cbRead = recv(pThis->hNative, pvBuffer, cbNow, MSG_NOSIGNAL); 762 int cbNow = cbBuffer >= INT_MAX/2 ? INT_MAX/2 : (int)cbBuffer; 763 764 int cbRead = recv(pThis->hNative, pvBuffer, cbNow, MSG_NOSIGNAL); 765 if (cbRead >= 0) 766 { 767 *pcbRead = cbRead; 768 rc = VINF_SUCCESS; 769 } 770 else 771 rc = rtSocketError(); 772 773 if (rc == VERR_TRY_AGAIN) 774 rc = VINF_TRY_AGAIN; 775 #else 776 ssize_t cbRead = recv(pThis->hNative, pvBuffer, cbBuffer, MSG_NOSIGNAL); 767 777 if (cbRead >= 0) 768 778 *pcbRead = cbRead; … … 773 783 } 774 784 else 775 rc = RTErrConvertFromErrno(errno); 785 rc = rtSocketError(); 786 #endif 776 787 777 788 rtSocketUnlock(pThis); … … 797 808 rtSocketErrorReset(); 798 809 #ifdef RT_OS_WINDOWS 799 int cbNow = RT_MIN((int)cbBuffer, INT_MAX/2); 800 #else 801 size_t cbNow = cbBuffer; 802 #endif 803 ssize_t cbWritten = send(pThis->hNative, pvBuffer, cbNow, MSG_NOSIGNAL); 810 int cbNow = RT_MIN((int)cbBuffer, INT_MAX/2); 811 812 int cbWritten = send(pThis->hNative, pvBuffer, cbNow, MSG_NOSIGNAL); 813 814 if (cbWritten >= 0) 815 { 816 *pcbWritten = cbWritten; 817 rc = VINF_SUCCESS; 818 } 819 else 820 rc = rtSocketError(); 821 822 if (rc == VERR_TRY_AGAIN) 823 rc = VINF_TRY_AGAIN; 824 #else 825 ssize_t cbWritten = send(pThis->hNative, pvBuffer, cbBuffer, MSG_NOSIGNAL); 804 826 if (cbWritten >= 0) 805 827 *pcbWritten = cbWritten; … … 810 832 } 811 833 else 812 rc = RTErrConvertFromErrno(errno); 834 rc = rtSocketError(); 835 #endif 813 836 814 837 rtSocketUnlock(pThis);
Note:
See TracChangeset
for help on using the changeset viewer.