if (evcon->bufev != NULL)
bufferevent_free(evcon->bufev);
- if (evcon->fd != -1)
+ if (evcon->fd != -1) {
+ shutdown(evcon->fd, 1);
evutil_closesocket(evcon->fd);
+ }
if (evcon->bind_address != NULL)
mm_free(evcon->bind_address);
/* inform interested parties about connection close */
if (evhttp_connected(evcon) && evcon->closecb != NULL)
(*evcon->closecb)(evcon, evcon->closecb_arg);
-
+
+ shutdown(evcon->fd, 1);
evutil_closesocket(evcon->fd);
evcon->fd = -1;
}