diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ChangeLog.ja | 6 | ||||
-rw-r--r-- | libsylph/session.c | 13 | ||||
-rw-r--r-- | libsylph/session.h | 2 |
4 files changed, 24 insertions, 3 deletions
@@ -1,5 +1,11 @@ 2005-11-25 + * libsylph/session.[ch]: session_read_data_as_file_cb(): don't write + to file until buffer is filled more than the half. Extended the + buffer size. + +2005-11-25 + * libsylph/session.c: session_recv_data_as_file_idle_cb(): fixed a bug that lost first part of message data. diff --git a/ChangeLog.ja b/ChangeLog.ja index 9c5ea588..d4dccf5e 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,11 @@ 2005-11-25 + * libsylph/session.[ch]: session_read_data_as_file_cb(): バッファが + 半分以上満たされるまでファイルに書き出さないようにした。バッファ + サイズを拡大。 + +2005-11-25 + * libsylph/session.c: session_recv_data_as_file_idle_cb(): メッセージ データの先頭部分を失うバグを修正。 diff --git a/libsylph/session.c b/libsylph/session.c index 77209c96..c73fe51d 100644 --- a/libsylph/session.c +++ b/libsylph/session.c @@ -775,10 +775,19 @@ static gboolean session_read_data_as_file_cb(SockInfo *source, if (data_begin_p > session->read_buf) { g_memmove(session->read_buf, data_begin_p, buf_data_len); - session->read_buf_p = - session->read_buf + buf_data_len; + data_begin_p = session->read_buf; + session->read_buf_p = session->read_buf + + session->preread_len; } g_print("buffer data (%d) <= PREREAD_SIZE\n", buf_data_len); + session->read_buf_p += session->read_buf_len; + session->preread_len = buf_data_len; + session->read_buf_len = 0; + return TRUE; + } + + if (READ_BUF_LEFT() >= (SESSION_BUFFSIZE / 2)) { + session->read_buf_p += session->read_buf_len; session->preread_len = buf_data_len; session->read_buf_len = 0; return TRUE; diff --git a/libsylph/session.h b/libsylph/session.h index 1bd948eb..d9cc3fdb 100644 --- a/libsylph/session.h +++ b/libsylph/session.h @@ -31,7 +31,7 @@ #include "socket.h" -#define SESSION_BUFFSIZE 4096 +#define SESSION_BUFFSIZE 8192 typedef struct _Session Session; |