Commit 04b6f18e5694329a34c9431a999436961bc15609
1 parent
88292e38
Modifications for usage of new queue code.
Showing
5 changed files
with
4 additions
and
7 deletions
| @@ -47,8 +47,6 @@ TR_cepWriteBuffered(TR_CommEndPoint this, size_t * size) | @@ -47,8 +47,6 @@ TR_cepWriteBuffered(TR_CommEndPoint this, size_t * size) | ||
| 47 | case -1: // FAILURE | 47 | case -1: // FAILURE |
| 48 | case -2: // remote close | 48 | case -2: // remote close |
| 49 | TR_delete(data); | 49 | TR_delete(data); |
| 50 | - TR_queueDestroy(this->write_buffer); | ||
| 51 | - *size = this->write_buffer_size; | ||
| 52 | break; | 50 | break; |
| 53 | 51 | ||
| 54 | default: | 52 | default: |
| @@ -71,7 +69,7 @@ TR_cepWriteBuffered(TR_CommEndPoint this, size_t * size) | @@ -71,7 +69,7 @@ TR_cepWriteBuffered(TR_CommEndPoint this, size_t * size) | ||
| 71 | } | 69 | } |
| 72 | break; | 70 | break; |
| 73 | } | 71 | } |
| 74 | - | 72 | + |
| 75 | if (send <= 0) break; | 73 | if (send <= 0) break; |
| 76 | } | 74 | } |
| 77 | 75 |
| @@ -118,7 +118,7 @@ const char * TR_cepEventStrings[] = { | @@ -118,7 +118,7 @@ const char * TR_cepEventStrings[] = { | ||
| 118 | "TR_CEP_EVENT_SHUT_WRITE", | 118 | "TR_CEP_EVENT_SHUT_WRITE", |
| 119 | "TR_CEP_EVENT_CLOSE", | 119 | "TR_CEP_EVENT_CLOSE", |
| 120 | }; | 120 | }; |
| 121 | - | 121 | + |
| 122 | intptr_t comm_end_point_events[TR_CEP_EVENT_MAX + 1]; | 122 | intptr_t comm_end_point_events[TR_CEP_EVENT_MAX + 1]; |
| 123 | TR_INIT_IFACE(TR_Class, commEndPointCtor, commEndPointDtor, NULL); | 123 | TR_INIT_IFACE(TR_Class, commEndPointCtor, commEndPointDtor, NULL); |
| 124 | TR_INIT_IFACE(TR_CommEndPoint, NULL, NULL); | 124 | TR_INIT_IFACE(TR_CommEndPoint, NULL, NULL); |
| @@ -62,7 +62,7 @@ connectorAccept(void * _this, TR_Event event) | @@ -62,7 +62,7 @@ connectorAccept(void * _this, TR_Event event) | ||
| 62 | while (socket) { | 62 | while (socket) { |
| 63 | TR_socketNonblock((TR_Socket)socket); | 63 | TR_socketNonblock((TR_Socket)socket); |
| 64 | TR_Connection new_con = TR_new( | 64 | TR_Connection new_con = TR_new( |
| 65 | - TR_Connection, | 65 | + TR_Connection, |
| 66 | socket, | 66 | socket, |
| 67 | connection->protocol, | 67 | connection->protocol, |
| 68 | CEP_DEFAULT_READ_SIZE); | 68 | CEP_DEFAULT_READ_SIZE); |
| @@ -101,7 +101,7 @@ protocolHandlerCompose(void * _this, TR_Event event) | @@ -101,7 +101,7 @@ protocolHandlerCompose(void * _this, TR_Event event) | ||
| 101 | NULL)); | 101 | NULL)); |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | - if (endpoint->write_buffer->nmsg == 1) { | 104 | + if (TR_queueSize(endpoint->write_buffer) >= 1) { |
| 105 | TR_eventHandlerIssueEvent( | 105 | TR_eventHandlerIssueEvent( |
| 106 | (TR_EventHandler)_this, | 106 | (TR_EventHandler)_this, |
| 107 | TR_eventSubjectEmit( | 107 | TR_eventSubjectEmit( |
Please
register
or
login
to post a comment