delete two no need call clear_closed_event

This commit is contained in:
zhengfangxin
2015-09-26 21:03:38 +08:00
parent 48f79fe6d4
commit cb9feb34bd

View File

@@ -1176,6 +1176,7 @@ clear_closed_event(struct socket_server *ss, struct socket_message * result, int
if (s) { if (s) {
if (s->type == SOCKET_TYPE_INVALID && s->id == id) { if (s->type == SOCKET_TYPE_INVALID && s->id == id) {
e->s = NULL; e->s = NULL;
break;
} }
} }
} }
@@ -1245,21 +1246,19 @@ socket_server_poll(struct socket_server *ss, struct socket_message * result, int
return SOCKET_UDP; return SOCKET_UDP;
} }
} }
if (e->write) { if (e->write && type != SOCKET_CLOSE && type != SOCKET_ERROR) {
// Try to dispatch write message next step if write flag set. // Try to dispatch write message next step if write flag set.
e->read = false; e->read = false;
--ss->event_index; --ss->event_index;
} }
if (type == -1) if (type == -1)
break; break;
clear_closed_event(ss, result, type);
return type; return type;
} }
if (e->write) { if (e->write) {
int type = send_buffer(ss, s, result); int type = send_buffer(ss, s, result);
if (type == -1) if (type == -1)
break; break;
clear_closed_event(ss, result, type);
return type; return type;
} }
break; break;