aboutsummaryrefslogtreecommitdiff
path: root/src/stream
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2012-12-11 11:14:24 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2012-12-11 11:14:24 +0000
commit77e9e4a935bc9109365afebf00a4d88a694973ed (patch)
tree13285f304f3a128320255df548d69f80c6ba7d70 /src/stream
parent8861ab9dc880d4ab8e24be3d66d1f2d60d3d950a (diff)
downloadgnunet-77e9e4a935bc9109365afebf00a4d88a694973ed.tar.gz
gnunet-77e9e4a935bc9109365afebf00a4d88a694973ed.zip
- rename
Diffstat (limited to 'src/stream')
-rw-r--r--src/stream/perf_stream_api.c4
-rw-r--r--src/stream/stream_api.c45
-rw-r--r--src/stream/test_stream_2peers.c4
-rw-r--r--src/stream/test_stream_2peers_halfclose.c4
-rw-r--r--src/stream/test_stream_big.c4
-rw-r--r--src/stream/test_stream_local.c4
-rw-r--r--src/stream/test_stream_sequence_wraparound.c4
7 files changed, 35 insertions, 34 deletions
diff --git a/src/stream/perf_stream_api.c b/src/stream/perf_stream_api.c
index 310e4c5ef..a3f188a8f 100644
--- a/src/stream/perf_stream_api.c
+++ b/src/stream/perf_stream_api.c
@@ -103,12 +103,12 @@ struct PeerData
103 /** 103 /**
104 * Peer's io write handle 104 * Peer's io write handle
105 */ 105 */
106 struct GNUNET_STREAM_IOWriteHandle *io_write_handle; 106 struct GNUNET_STREAM_WriteHandle *io_write_handle;
107 107
108 /** 108 /**
109 * Peer's io read handle 109 * Peer's io read handle
110 */ 110 */
111 struct GNUNET_STREAM_IOReadHandle *io_read_handle; 111 struct GNUNET_STREAM_ReadHandle *io_read_handle;
112 112
113 /** 113 /**
114 * The peer handle when we use the testbed servie 114 * The peer handle when we use the testbed servie
diff --git a/src/stream/stream_api.c b/src/stream/stream_api.c
index 1ca4031f2..0083e63fb 100644
--- a/src/stream/stream_api.c
+++ b/src/stream/stream_api.c
@@ -217,12 +217,12 @@ struct GNUNET_STREAM_Socket
217 /** 217 /**
218 * The write IO_handle associated with this socket 218 * The write IO_handle associated with this socket
219 */ 219 */
220 struct GNUNET_STREAM_IOWriteHandle *write_handle; 220 struct GNUNET_STREAM_WriteHandle *write_handle;
221 221
222 /** 222 /**
223 * The read IO_handle associated with this socket 223 * The read IO_handle associated with this socket
224 */ 224 */
225 struct GNUNET_STREAM_IOReadHandle *read_handle; 225 struct GNUNET_STREAM_ReadHandle *read_handle;
226 226
227 /** 227 /**
228 * The shutdown handle associated with this socket 228 * The shutdown handle associated with this socket
@@ -459,7 +459,7 @@ struct GNUNET_STREAM_ListenSocket
459/** 459/**
460 * The IO Write Handle 460 * The IO Write Handle
461 */ 461 */
462struct GNUNET_STREAM_IOWriteHandle 462struct GNUNET_STREAM_WriteHandle
463{ 463{
464 /** 464 /**
465 * The socket to which this write handle is associated 465 * The socket to which this write handle is associated
@@ -511,7 +511,7 @@ struct GNUNET_STREAM_IOWriteHandle
511/** 511/**
512 * The IO Read Handle 512 * The IO Read Handle
513 */ 513 */
514struct GNUNET_STREAM_IOReadHandle 514struct GNUNET_STREAM_ReadHandle
515{ 515{
516 /** 516 /**
517 * The socket to which this read handle is associated 517 * The socket to which this read handle is associated
@@ -901,7 +901,7 @@ ackbitmap_is_bit_set (const GNUNET_STREAM_AckBitmap *bitmap,
901static void 901static void
902write_data (struct GNUNET_STREAM_Socket *socket) 902write_data (struct GNUNET_STREAM_Socket *socket)
903{ 903{
904 struct GNUNET_STREAM_IOWriteHandle *io_handle = socket->write_handle; 904 struct GNUNET_STREAM_WriteHandle *io_handle = socket->write_handle;
905 unsigned int packet; 905 unsigned int packet;
906 906
907 for (packet=0; packet < io_handle->packets_sent; packet++) 907 for (packet=0; packet < io_handle->packets_sent; packet++)
@@ -958,7 +958,7 @@ write_data (struct GNUNET_STREAM_Socket *socket)
958static void 958static void
959cleanup_read_handle (struct GNUNET_STREAM_Socket *socket) 959cleanup_read_handle (struct GNUNET_STREAM_Socket *socket)
960{ 960{
961 struct GNUNET_STREAM_IOReadHandle *read_handle; 961 struct GNUNET_STREAM_ReadHandle *read_handle;
962 962
963 read_handle = socket->read_handle; 963 read_handle = socket->read_handle;
964 /* Read io time task should be there; if it is already executed then this 964 /* Read io time task should be there; if it is already executed then this
@@ -987,7 +987,7 @@ call_read_processor (void *cls,
987 const struct GNUNET_SCHEDULER_TaskContext *tc) 987 const struct GNUNET_SCHEDULER_TaskContext *tc)
988{ 988{
989 struct GNUNET_STREAM_Socket *socket = cls; 989 struct GNUNET_STREAM_Socket *socket = cls;
990 struct GNUNET_STREAM_IOReadHandle *read_handle; 990 struct GNUNET_STREAM_ReadHandle *read_handle;
991 GNUNET_STREAM_DataProcessor proc; 991 GNUNET_STREAM_DataProcessor proc;
992 void *proc_cls; 992 void *proc_cls;
993 size_t read_size; 993 size_t read_size;
@@ -1101,7 +1101,7 @@ read_io_timeout (void *cls,
1101 const struct GNUNET_SCHEDULER_TaskContext *tc) 1101 const struct GNUNET_SCHEDULER_TaskContext *tc)
1102{ 1102{
1103 struct GNUNET_STREAM_Socket *socket = cls; 1103 struct GNUNET_STREAM_Socket *socket = cls;
1104 struct GNUNET_STREAM_IOReadHandle *read_handle; 1104 struct GNUNET_STREAM_ReadHandle *read_handle;
1105 GNUNET_STREAM_DataProcessor proc; 1105 GNUNET_STREAM_DataProcessor proc;
1106 void *proc_cls; 1106 void *proc_cls;
1107 1107
@@ -1964,7 +1964,7 @@ handle_receive_close (struct GNUNET_STREAM_Socket *socket,
1964 1964
1965 wc = socket->write_handle->write_cont; 1965 wc = socket->write_handle->write_cont;
1966 wc_cls = socket->write_handle->write_cont_cls; 1966 wc_cls = socket->write_handle->write_cont_cls;
1967 GNUNET_STREAM_io_write_cancel (socket->write_handle); 1967 GNUNET_STREAM_write_cancel (socket->write_handle);
1968 socket->write_handle = NULL; 1968 socket->write_handle = NULL;
1969 if (NULL != wc) 1969 if (NULL != wc)
1970 wc (wc_cls, 1970 wc (wc_cls,
@@ -2091,7 +2091,7 @@ handle_close (struct GNUNET_STREAM_Socket *socket,
2091 2091
2092 wc = socket->write_handle->write_cont; 2092 wc = socket->write_handle->write_cont;
2093 wc_cls = socket->write_handle->write_cont_cls; 2093 wc_cls = socket->write_handle->write_cont_cls;
2094 GNUNET_STREAM_io_write_cancel (socket->write_handle); 2094 GNUNET_STREAM_write_cancel (socket->write_handle);
2095 socket->write_handle = NULL; 2095 socket->write_handle = NULL;
2096 if (NULL != wc) 2096 if (NULL != wc)
2097 wc (wc_cls, 2097 wc (wc_cls,
@@ -2543,7 +2543,7 @@ handle_ack (struct GNUNET_STREAM_Socket *socket,
2543 const struct GNUNET_STREAM_AckMessage *ack, 2543 const struct GNUNET_STREAM_AckMessage *ack,
2544 const struct GNUNET_ATS_Information*atsi) 2544 const struct GNUNET_ATS_Information*atsi)
2545{ 2545{
2546 struct GNUNET_STREAM_IOWriteHandle *write_handle; 2546 struct GNUNET_STREAM_WriteHandle *write_handle;
2547 uint64_t ack_bitmap; 2547 uint64_t ack_bitmap;
2548 unsigned int packet; 2548 unsigned int packet;
2549 int need_retransmission; 2549 int need_retransmission;
@@ -3274,13 +3274,13 @@ GNUNET_STREAM_close (struct GNUNET_STREAM_Socket *socket)
3274 { 3274 {
3275 LOG (GNUNET_ERROR_TYPE_WARNING, 3275 LOG (GNUNET_ERROR_TYPE_WARNING,
3276 "Closing STREAM socket when a read handle is pending\n"); 3276 "Closing STREAM socket when a read handle is pending\n");
3277 GNUNET_STREAM_io_read_cancel (socket->read_handle); 3277 GNUNET_STREAM_read_cancel (socket->read_handle);
3278 } 3278 }
3279 if (NULL != socket->write_handle) 3279 if (NULL != socket->write_handle)
3280 { 3280 {
3281 LOG (GNUNET_ERROR_TYPE_WARNING, 3281 LOG (GNUNET_ERROR_TYPE_WARNING,
3282 "Closing STREAM socket when a write handle is pending\n"); 3282 "Closing STREAM socket when a write handle is pending\n");
3283 GNUNET_STREAM_io_write_cancel (socket->write_handle); 3283 GNUNET_STREAM_write_cancel (socket->write_handle);
3284 //socket->write_handle = NULL; 3284 //socket->write_handle = NULL;
3285 } 3285 }
3286 /* Terminate the ack'ing task if they are still present */ 3286 /* Terminate the ack'ing task if they are still present */
@@ -3465,7 +3465,7 @@ GNUNET_STREAM_listen_close (struct GNUNET_STREAM_ListenSocket *lsocket)
3465 * is broken then write_cont is immediately called and NULL is 3465 * is broken then write_cont is immediately called and NULL is
3466 * returned. 3466 * returned.
3467 */ 3467 */
3468struct GNUNET_STREAM_IOWriteHandle * 3468struct GNUNET_STREAM_WriteHandle *
3469GNUNET_STREAM_write (struct GNUNET_STREAM_Socket *socket, 3469GNUNET_STREAM_write (struct GNUNET_STREAM_Socket *socket,
3470 const void *data, 3470 const void *data,
3471 size_t size, 3471 size_t size,
@@ -3473,7 +3473,7 @@ GNUNET_STREAM_write (struct GNUNET_STREAM_Socket *socket,
3473 GNUNET_STREAM_CompletionContinuation write_cont, 3473 GNUNET_STREAM_CompletionContinuation write_cont,
3474 void *write_cont_cls) 3474 void *write_cont_cls)
3475{ 3475{
3476 struct GNUNET_STREAM_IOWriteHandle *io_handle; 3476 struct GNUNET_STREAM_WriteHandle *io_handle;
3477 struct GNUNET_STREAM_DataMessage *data_msg; 3477 struct GNUNET_STREAM_DataMessage *data_msg;
3478 const void *sweep; 3478 const void *sweep;
3479 struct GNUNET_TIME_Relative ack_deadline; 3479 struct GNUNET_TIME_Relative ack_deadline;
@@ -3524,7 +3524,7 @@ GNUNET_STREAM_write (struct GNUNET_STREAM_Socket *socket,
3524 size = GNUNET_STREAM_ACK_BITMAP_BIT_LENGTH * socket->max_payload_size; 3524 size = GNUNET_STREAM_ACK_BITMAP_BIT_LENGTH * socket->max_payload_size;
3525 num_needed_packets = 3525 num_needed_packets =
3526 (size + (socket->max_payload_size - 1)) / socket->max_payload_size; 3526 (size + (socket->max_payload_size - 1)) / socket->max_payload_size;
3527 io_handle = GNUNET_malloc (sizeof (struct GNUNET_STREAM_IOWriteHandle)); 3527 io_handle = GNUNET_malloc (sizeof (struct GNUNET_STREAM_WriteHandle));
3528 io_handle->socket = socket; 3528 io_handle->socket = socket;
3529 io_handle->write_cont = write_cont; 3529 io_handle->write_cont = write_cont;
3530 io_handle->write_cont_cls = write_cont_cls; 3530 io_handle->write_cont_cls = write_cont_cls;
@@ -3609,7 +3609,8 @@ probe_data_availability (void *cls,
3609/** 3609/**
3610 * Tries to read data from the stream. Should not be called when another read 3610 * Tries to read data from the stream. Should not be called when another read
3611 * handle is present; the existing read handle should be canceled with 3611 * handle is present; the existing read handle should be canceled with
3612 * GNUNET_STREAM_io_read_cancel(). Only one read handle per socket is present at any time 3612 * GNUNET_STREAM_read_cancel(). Only one read handle per socket is present at
3613 * any time
3613 * 3614 *
3614 * @param socket the socket representing a stream 3615 * @param socket the socket representing a stream
3615 * @param timeout the timeout period 3616 * @param timeout the timeout period
@@ -3622,13 +3623,13 @@ probe_data_availability (void *cls,
3622 * read handle is present (only one read handle per socket is present 3623 * read handle is present (only one read handle per socket is present
3623 * at any time) 3624 * at any time)
3624 */ 3625 */
3625struct GNUNET_STREAM_IOReadHandle * 3626struct GNUNET_STREAM_ReadHandle *
3626GNUNET_STREAM_read (struct GNUNET_STREAM_Socket *socket, 3627GNUNET_STREAM_read (struct GNUNET_STREAM_Socket *socket,
3627 struct GNUNET_TIME_Relative timeout, 3628 struct GNUNET_TIME_Relative timeout,
3628 GNUNET_STREAM_DataProcessor proc, 3629 GNUNET_STREAM_DataProcessor proc,
3629 void *proc_cls) 3630 void *proc_cls)
3630{ 3631{
3631 struct GNUNET_STREAM_IOReadHandle *read_handle; 3632 struct GNUNET_STREAM_ReadHandle *read_handle;
3632 3633
3633 LOG (GNUNET_ERROR_TYPE_DEBUG, 3634 LOG (GNUNET_ERROR_TYPE_DEBUG,
3634 "%s: %s()\n", 3635 "%s: %s()\n",
@@ -3657,7 +3658,7 @@ GNUNET_STREAM_read (struct GNUNET_STREAM_Socket *socket,
3657 default: 3658 default:
3658 break; 3659 break;
3659 } 3660 }
3660 read_handle = GNUNET_malloc (sizeof (struct GNUNET_STREAM_IOReadHandle)); 3661 read_handle = GNUNET_malloc (sizeof (struct GNUNET_STREAM_ReadHandle));
3661 read_handle->proc = proc; 3662 read_handle->proc = proc;
3662 read_handle->proc_cls = proc_cls; 3663 read_handle->proc_cls = proc_cls;
3663 read_handle->socket = socket; 3664 read_handle->socket = socket;
@@ -3678,7 +3679,7 @@ GNUNET_STREAM_read (struct GNUNET_STREAM_Socket *socket,
3678 * @param ioh handle to operation to cancel 3679 * @param ioh handle to operation to cancel
3679 */ 3680 */
3680void 3681void
3681GNUNET_STREAM_io_write_cancel (struct GNUNET_STREAM_IOWriteHandle *ioh) 3682GNUNET_STREAM_write_cancel (struct GNUNET_STREAM_WriteHandle *ioh)
3682{ 3683{
3683 struct GNUNET_STREAM_Socket *socket = ioh->socket; 3684 struct GNUNET_STREAM_Socket *socket = ioh->socket;
3684 unsigned int packet; 3685 unsigned int packet;
@@ -3706,7 +3707,7 @@ GNUNET_STREAM_io_write_cancel (struct GNUNET_STREAM_IOWriteHandle *ioh)
3706 * @param ioh handle to operation to cancel 3707 * @param ioh handle to operation to cancel
3707 */ 3708 */
3708void 3709void
3709GNUNET_STREAM_io_read_cancel (struct GNUNET_STREAM_IOReadHandle *ioh) 3710GNUNET_STREAM_read_cancel (struct GNUNET_STREAM_ReadHandle *ioh)
3710{ 3711{
3711 struct GNUNET_STREAM_Socket *socket; 3712 struct GNUNET_STREAM_Socket *socket;
3712 3713
diff --git a/src/stream/test_stream_2peers.c b/src/stream/test_stream_2peers.c
index 3ddd1aa46..1dd15fdd1 100644
--- a/src/stream/test_stream_2peers.c
+++ b/src/stream/test_stream_2peers.c
@@ -61,12 +61,12 @@ struct PeerData
61 /** 61 /**
62 * Peer's io write handle 62 * Peer's io write handle
63 */ 63 */
64 struct GNUNET_STREAM_IOWriteHandle *io_write_handle; 64 struct GNUNET_STREAM_WriteHandle *io_write_handle;
65 65
66 /** 66 /**
67 * Peer's io read handle 67 * Peer's io read handle
68 */ 68 */
69 struct GNUNET_STREAM_IOReadHandle *io_read_handle; 69 struct GNUNET_STREAM_ReadHandle *io_read_handle;
70 70
71 /** 71 /**
72 * Peer's shutdown handle 72 * Peer's shutdown handle
diff --git a/src/stream/test_stream_2peers_halfclose.c b/src/stream/test_stream_2peers_halfclose.c
index 617ab99a8..852880868 100644
--- a/src/stream/test_stream_2peers_halfclose.c
+++ b/src/stream/test_stream_2peers_halfclose.c
@@ -55,12 +55,12 @@ struct PeerData
55 /** 55 /**
56 * Peer's io write handle 56 * Peer's io write handle
57 */ 57 */
58 struct GNUNET_STREAM_IOWriteHandle *io_write_handle; 58 struct GNUNET_STREAM_WriteHandle *io_write_handle;
59 59
60 /** 60 /**
61 * Peer's io read handle 61 * Peer's io read handle
62 */ 62 */
63 struct GNUNET_STREAM_IOReadHandle *io_read_handle; 63 struct GNUNET_STREAM_ReadHandle *io_read_handle;
64 64
65 /** 65 /**
66 * Peer's shutdown handle 66 * Peer's shutdown handle
diff --git a/src/stream/test_stream_big.c b/src/stream/test_stream_big.c
index 1546c9672..a923f374c 100644
--- a/src/stream/test_stream_big.c
+++ b/src/stream/test_stream_big.c
@@ -53,12 +53,12 @@ struct PeerData
53 /** 53 /**
54 * Peer's io write handle 54 * Peer's io write handle
55 */ 55 */
56 struct GNUNET_STREAM_IOWriteHandle *io_write_handle; 56 struct GNUNET_STREAM_WriteHandle *io_write_handle;
57 57
58 /** 58 /**
59 * Peer's io read handle 59 * Peer's io read handle
60 */ 60 */
61 struct GNUNET_STREAM_IOReadHandle *io_read_handle; 61 struct GNUNET_STREAM_ReadHandle *io_read_handle;
62 62
63 /** 63 /**
64 * Peer's shutdown handle 64 * Peer's shutdown handle
diff --git a/src/stream/test_stream_local.c b/src/stream/test_stream_local.c
index be299cd06..587c56ceb 100644
--- a/src/stream/test_stream_local.c
+++ b/src/stream/test_stream_local.c
@@ -52,12 +52,12 @@ struct PeerData
52 /** 52 /**
53 * Peer's io write handle 53 * Peer's io write handle
54 */ 54 */
55 struct GNUNET_STREAM_IOWriteHandle *io_write_handle; 55 struct GNUNET_STREAM_WriteHandle *io_write_handle;
56 56
57 /** 57 /**
58 * Peer's io read handle 58 * Peer's io read handle
59 */ 59 */
60 struct GNUNET_STREAM_IOReadHandle *io_read_handle; 60 struct GNUNET_STREAM_ReadHandle *io_read_handle;
61 61
62 /** 62 /**
63 * Peer's shutdown handle 63 * Peer's shutdown handle
diff --git a/src/stream/test_stream_sequence_wraparound.c b/src/stream/test_stream_sequence_wraparound.c
index 1e1cfa3bc..ac230f2b3 100644
--- a/src/stream/test_stream_sequence_wraparound.c
+++ b/src/stream/test_stream_sequence_wraparound.c
@@ -56,12 +56,12 @@ struct PeerData
56 /** 56 /**
57 * Peer's io write handle 57 * Peer's io write handle
58 */ 58 */
59 struct GNUNET_STREAM_IOWriteHandle *io_write_handle; 59 struct GNUNET_STREAM_WriteHandle *io_write_handle;
60 60
61 /** 61 /**
62 * Peer's io read handle 62 * Peer's io read handle
63 */ 63 */
64 struct GNUNET_STREAM_IOReadHandle *io_read_handle; 64 struct GNUNET_STREAM_ReadHandle *io_read_handle;
65 65
66 /** 66 /**
67 * Peer's shutdown handle 67 * Peer's shutdown handle