Subject | Hash | Author | Date (UTC) |
---|---|---|---|
Cosmetic changes. | c147533732f8b7b4bbe2725f04bcce0df0271c70 | Catalin(ux) M. BOIE | 2009-08-20 15:31:12 |
Call del_obj only if we have a valid file descriptor. | 95c90269de0fa59a6ea69c2067827bbf57db16d5 | Catalin(ux) M. BOIE | 2009-08-20 15:29:42 |
Conn_enqueue returns now the number of bytes queued or -1. You should really check the error code. | ab88f823936ad67ba08aa5fd7984ea735c6c7dd7 | Catalin(ux) M. BOIE | 2009-08-20 15:28:42 |
Added CONN_STATE_ERROR. | e20e518e10f686eb0b248ae23fe193ea7344594b | Catalin(ux) M. BOIE | 2009-08-20 15:27:50 |
Added ERROR_INTERNAL. | 380a956dacfc05f0668e6a3fac941a464b5d7deb | Catalin(ux) M. BOIE | 2009-08-20 15:27:08 |
Added helper raise_error. | 10abeda5c6e4d1fb2c7011b9d2d070ea4db1cc11 | Catalin(ux) M. BOIE | 2009-08-20 15:26:32 |
Correctly set error state and errno code. | 6eca4a62d11c1881c8803d927e8155f15ca39072 | Catalin(ux) M. BOIE | 2009-08-20 15:25:11 |
Converted #defines to enums. | 6bafbb8f6887be62ccc668411b3e336d732c82dc | Catalin(ux) M. BOIE | 2009-08-20 15:20:38 |
Let *_move_slot functions return an error code (useless right now). | 353a5edd7b350383ee79cb5d8536568fb733445b | Catalin(ux) M. BOIE | 2009-08-20 15:19:24 |
Fixed the case when all connection are closed (app didn't exit). | 79d111839a75354c60a675a5c7ff328a38d4b8c8 | Catalin(ux) M. BOIE | 2009-06-22 14:50:59 |
Bump up the version to 1.0.21. | 574437c47f27ead82d5a891be30312c6725d5142 | Catalin(ux) M. BOIE | 2009-05-20 14:29:02 |
Fixed a use of an uninit variable! Oops! | 381473f2077d895d5064f1ea2e82d5a215ad5770 | Catalin(ux) M. BOIE | 2009-05-20 14:28:24 |
Bump up the version to 1.0.20. | 2270d4d69a1479a68c61c908bb2e421984f2d785 | Catalin(ux) M. BOIE | 2009-05-20 14:10:52 |
Fixed an underflow in Conn_rtrim. Oops! | dd361465e5f31adcc337b4eca9ebeec6c1713c42 | Catalin(ux) M. BOIE | 2009-05-20 14:10:28 |
Missed a '('. Oops! | 920f9fda5fecd14e1cfcdb8bd66164f3bd215b93 | Catalin(ux) M. BOIE | 2009-05-20 14:05:59 |
Try harder to respect the trigger interval; in the start fire after interval. | e7e5a52e7a6b7ad59da38bf660269e025f10ade4 | Catalin(ux) M. BOIE | 2009-05-06 11:19:09 |
Bump up the version. | e3723ad356330457959f6d9100be81d7eaacc57d | Catalin(ux) M. BOIE | 2009-04-17 14:33:30 |
Added reconnect executable to .gitignore. | 585adaa455a4ab751733bd872faf10c97a880d17 | Catalin(ux) M. BOIE | 2009-04-17 14:33:06 |
Made the server example (s.c) nicer and did more error checking. | 519cf83b2d28bee0d3bb25bbc962b3ef5677ee92 | Catalin(ux) M. BOIE | 2009-04-17 14:32:07 |
Added a reconnect example. | 59b8156a8c5d17c90b5b064b1e1043b365ddac0a | Catalin(ux) M. BOIE | 2009-04-17 14:31:47 |
File | Lines added | Lines deleted |
---|---|---|
Conn.c | 14 | 16 |
Conn_engine_core.c | 1 | 0 |
File Conn.c changed (mode: 100644) (index 9d549e0..071b761) | |||
... | ... | static void Conn_move_slot(const unsigned int dst, const unsigned int src) | |
1114 | 1114 | } | } |
1115 | 1115 | ||
1116 | 1116 | /* | /* |
1117 | * Does the polling of file descriptors. | ||
1117 | 1118 | * Returns: -1 on error, 0 nothing to do, 1 if some work was done | * Returns: -1 on error, 0 nothing to do, 1 if some work was done |
1118 | 1119 | * timeout is in 1/1000 seconds increments. | * timeout is in 1/1000 seconds increments. |
1119 | 1120 | */ | */ |
... | ... | int Conn_poll(const int timeout) | |
1122 | 1123 | int ret; | int ret; |
1123 | 1124 | int timeout2; | int timeout2; |
1124 | 1125 | unsigned int i, last; | unsigned int i, last; |
1125 | struct Conn *C; | ||
1126 | 1126 | ||
1127 | Log(11, "Conn_poll(timeout=%d Conn_no=%d)\n", | ||
1128 | timeout, Conn_no); | ||
1129 | |||
1130 | if (Conn_no == 0) | ||
1131 | return 0; | ||
1127 | Log(11, "%s: timeout=%d Conn_no=%d)\n", | ||
1128 | __FUNCTION__, timeout, Conn_no); | ||
1132 | 1129 | ||
1133 | 1130 | if (timeout == -1) | if (timeout == -1) |
1134 | 1131 | timeout2 = 1000; | timeout2 = 1000; |
... | ... | int Conn_poll(const int timeout) | |
1136 | 1133 | timeout2 = timeout; | timeout2 = timeout; |
1137 | 1134 | ||
1138 | 1135 | loop: | loop: |
1136 | if (Conn_no == 0) | ||
1137 | return 0; | ||
1138 | |||
1139 | 1139 | if (Conn_pending > 0) | if (Conn_pending > 0) |
1140 | 1140 | Conn_trytoconnect(); | Conn_trytoconnect(); |
1141 | 1141 | ||
... | ... | int Conn_poll(const int timeout) | |
1143 | 1143 | if (ret < 0) | if (ret < 0) |
1144 | 1144 | return -1; | return -1; |
1145 | 1145 | ||
1146 | Log(15, "Do compacting, expiration and band stuff...\n"); | ||
1146 | Log(15, "\tDo compacting, expiration and band stuff...\n"); | ||
1147 | 1147 | i = 0; | i = 0; |
1148 | 1148 | while (i < Conn_no) { | while (i < Conn_no) { |
1149 | C = &Conns[i]; | ||
1149 | /* | ||
1150 | * Save last position because Conn_free_intern | ||
1151 | * decrements Conn_no | ||
1152 | */ | ||
1153 | last = Conn_no - 1; | ||
1150 | 1154 | ||
1151 | 1155 | /* Closing connection if it is in error state */ | /* Closing connection if it is in error state */ |
1152 | 1156 | if (C->error_state > 0) { | if (C->error_state > 0) { |
... | ... | int Conn_poll(const int timeout) | |
1167 | 1171 | } | } |
1168 | 1172 | ||
1169 | 1173 | /* test if it expired/timeout */ | /* test if it expired/timeout */ |
1170 | Conn_expire(C); | ||
1174 | Conn_expire(&Conns[i]); | ||
1171 | 1175 | ||
1172 | 1176 | /* add tokens */ | /* add tokens */ |
1173 | Conn_band_update(C); | ||
1177 | Conn_band_update(&Conns[i]); | ||
1174 | 1178 | ||
1175 | 1179 | i++; | i++; |
1176 | 1180 | } | } |
... | ... | int Conn_poll(const int timeout) | |
1178 | 1182 | /* Blocking accept if full queue or unblock if not */ | /* Blocking accept if full queue or unblock if not */ |
1179 | 1183 | Conn_accept_allow(); | Conn_accept_allow(); |
1180 | 1184 | ||
1181 | /* Any work left to do? */ | ||
1182 | if (Conn_no == 0) { | ||
1183 | Log(10, "Nothing remained to poll for!\n"); | ||
1184 | return 0; | ||
1185 | } | ||
1186 | |||
1187 | 1185 | if (timeout == -1) | if (timeout == -1) |
1188 | 1186 | goto loop; | goto loop; |
1189 | 1187 |
File Conn_engine_core.c changed (mode: 100644) (index d0ee070..effc505) | |||
... | ... | int Conn_alphanum(const char *s) | |
1257 | 1257 | ||
1258 | 1258 | return 1; | return 1; |
1259 | 1259 | } | } |
1260 |