* Doc updates
* Fixes about socket, stream core, a superfluous stream. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1670 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -328,6 +328,7 @@ bool wxFTP::Abort(void)
|
||||
wxInputStream *wxFTP::GetInputStream(const wxString& path)
|
||||
{
|
||||
wxString tmp_str;
|
||||
size_t calc_size;
|
||||
|
||||
if (!SendCommand("TYPE I", '2'))
|
||||
return NULL;
|
||||
|
@@ -358,6 +358,7 @@ bool wxSocketBase::Close()
|
||||
wxSocketBase& wxSocketBase::Read(char* buffer, size_t nbytes)
|
||||
{
|
||||
m_lcount = GetPushback(buffer, nbytes, FALSE);
|
||||
nbytes -= m_lcount;
|
||||
|
||||
// If we have got the whole needed buffer or if we don't want to
|
||||
// wait then it returns immediately.
|
||||
|
@@ -285,6 +285,9 @@ size_t wxStreamBuffer::Read(void *buffer, size_t size)
|
||||
{
|
||||
wxASSERT(m_stream != NULL);
|
||||
|
||||
if (m_mode == write)
|
||||
return 0;
|
||||
|
||||
// ------------------
|
||||
// Buffering disabled
|
||||
// ------------------
|
||||
@@ -334,6 +337,9 @@ size_t wxStreamBuffer::Read(wxStreamBuffer *s_buf)
|
||||
char buf[BUF_TEMP_SIZE];
|
||||
size_t s = 0, bytes_read = BUF_TEMP_SIZE;
|
||||
|
||||
if (m_mode == write)
|
||||
return 0;
|
||||
|
||||
while (bytes_read == BUF_TEMP_SIZE) {
|
||||
bytes_read = Read(buf, bytes_read);
|
||||
bytes_read = s_buf->Write(buf, bytes_read);
|
||||
@@ -346,6 +352,9 @@ size_t wxStreamBuffer::Write(const void *buffer, size_t size)
|
||||
{
|
||||
wxASSERT(m_stream != NULL);
|
||||
|
||||
if (m_mode == read)
|
||||
return 0;
|
||||
|
||||
// ------------------
|
||||
// Buffering disabled
|
||||
// ------------------
|
||||
@@ -392,6 +401,9 @@ size_t wxStreamBuffer::Write(wxStreamBuffer *sbuf)
|
||||
char buf[BUF_TEMP_SIZE];
|
||||
size_t s = 0, bytes_count = BUF_TEMP_SIZE, b_count2;
|
||||
|
||||
if (m_mode == read)
|
||||
return 0;
|
||||
|
||||
while (bytes_count == BUF_TEMP_SIZE) {
|
||||
b_count2 = sbuf->Read(buf, bytes_count);
|
||||
bytes_count = Write(buf, b_count2);
|
||||
|
Reference in New Issue
Block a user